A merge sort algorithm