Inplace merge sort.