CS FundamentalsVery hardGATE CS · PSU (ISRO/BARC)

A file of 2400 blocks is sorted by external merge sort with M = 6 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. 6 passes, 28,800 transfers
  2. B. 4 passes, 19,200 transfers
  3. C. 5 passes, 24,000 transfers
  4. D. 5 passes, 12,000 transfers

Correct answer: C. 5 passes, 24,000 transfers

Pass 0 makes ⌈2400/6⌉ = 400 runs; each merge pass divides the run count by 5, needing 4 merge pass(es). Total 5 passes × 2 × 2400 = 24,000 transfers.

More DBMS and SQL questions

Exams that ask this topic