3 ms·
As you point out, the sorting of arrays and sequential access files (tapes) have different algorithms. the cost of access to a tape record is not negligible an
by rsecora 6y ago
As you point out, the sorting of arrays and sequential access files (tapes) have different algorithms.
the cost of access to a tape record is not negligible and it is the main cost. But for arrays/memory it's almost 0, the weight of memory access.
Niklaus Wirth describes this in the classic book "(Algorithms + Data Structures = Programs)". There is a full chapter comparing the best/normal/worst case for each approach.
Those were "Elegant weapons for a more civilized Age.".