CS FundamentalsVery hardGATE CS · PSU (ISRO/BARC)

A file of 1000 blocks is sorted by external merge sort with M = 11 buffer blocks (sorted runs of M blocks are created in pass 0, then (M − 1)-way merges). How many passes in total are needed, and how many block transfers if each pass reads and writes every block once?

  1. A. 4 passes, 8,000 transfers
  2. B. 3 passes, 6,000 transfers
  3. C. 3 passes, 3,000 transfers
  4. D. 2 passes, 4,000 transfers

Correct answer: B. 3 passes, 6,000 transfers

Pass 0 makes ⌈1000/11⌉ = 91 runs; each merge pass divides the run count by 10, needing 2 merge pass(es). Total 3 passes × 2 × 1000 = 6,000 transfers.

More DBMS and SQL questions

Exams that ask this topic