External SortingAnalysisSo the obvious question is: How many passes are required to sort N pages using a buffer of size B? The first passThe first pass creates ceil(N/B) runs.Subsequent passes
Total passesSo the total number of passes is: 1 + logB−1(ceil(N/B)) = 1 + log(ceil(N/B)) / log(B−1). |