mergesort.c: Merge Sort algorithm library in C
Installing using Clib
$ clib install abranhe/mergesort.c
#include "mergesort.h"
int main()
{
int arr[] = {10, 7, 12, 27, 30};
mergeSort(arr, 0, 5);
// 7 10 12 27 30
}
See a real example.
Implement merge sort.
array
: unsorted Arrayfirst
: first element of the array to start sortinglast
: last element of the array to finish sorting
Carlos Abraham |
MIT License © Carlos Abraham