Merge sort algorithm.