IterativeMergeSort principal coding.