October 2025
Intermediate to advanced
485 pages
13h 2m
English
Let’s work with the same scenario of sorting the integers from 1 to 32. In this scenario, naturally, we’d say that N=32. And let’s also continue using a computer whose block size is 4. In other words, B=4. But let’s now upgrade our computer (for just $99!) so that its main memory has a capacity to hold 16 values. Using our new jargon, we’d say that M=16.
With this upgraded RAM, we can achieve external Mergesort using only 16 I/Os via what I’ll call “Second-Attempt Mergesort.” This algorithm will simply be a bridge between Two-Way External Mergesort and our final algorithm, so I won’t even try to come up with a better name for it.
Second-Attempt Mergesort will take 16 I/Os to sort 32 values, which is faster ...
Read now
Unlock full access