CS FundamentalsHardGATE CS

A file of 12,000 blocks is sorted by external merge sort with 25 buffer blocks: the run-creation pass makes runs of 25 blocks, and each merge pass merges up to 24 runs. Counting both reads and writes in every pass (including writing the final output), how many block transfers are needed?

  1. A. 48,000
  2. B. 72,000
  3. C. 96,000
  4. D. 60,000

Correct answer: B. 72,000

Run creation makes ⌈12000 / 25⌉ = 480 runs. Merging with fan-in 24 needs 2 passes (24² = 576 ≥ 480), so 3 passes in all, each reading and writing every block: 3 × 2 × 12,000 = 72,000.

More DBMS and SQL questions

Exams that ask this topic