Merge sort in linear time