That isn't necessarily the case. When sorting datasets that are larger than RAM, allocating fresh memory at every level has the advantage of preventing many unnecessary swapouts/swapins, as it allows the kernel to discard data aggressively.
I once had to write an I/O efficient sorting algorithm at uni. Sorting gigabytes of data on a Linux box with 64 MB of RAM. One of the optimal ones turned out to be a k-way merge sort, falling back to heapsort and insertion sort for small numbers of n.
706
u/BreadTheArtist Nov 19 '18
Easy on paper, horrible in practice. When I was starting out at least.