General External Merge Sort
To sort a file with N pages using B buffer pages:
Pass 0: use B buffer pages. Produce sorted runs of B pages each.
Pass 2, …, etc.: merge B-1 runs.
B Main memory buffers
INPUT 1
INPUT B-1
OUTPUT
Disk
Disk
INPUT 2
. . .
. . .
. . .
More than 3 buffer pages. How can we utilize them?
Previous slide
Next slide
Back to first slide
View graphic version