Iterative merge sort.