Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 2.26 KB

readme.md

File metadata and controls

77 lines (56 loc) · 2.26 KB




mergesort.c: Merge Sort algorithm library in C



In computer science, merge sort is an efficient, general-purpose, comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output.

Installation

Installing using Clib

$ clib install abranhe/mergesort.c

Usage

#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.

API

void mergeSort(arr, first, last);

Implement merge sort.

Params:
  • array: unsorted Array
  • first: first element of the array to start sorting
  • last: last element of the array to finish sorting

Team

Carlos Abraham Logo
Carlos Abraham

License

MIT License © Carlos Abraham