Wrote mergesort without in-place operations.