CS FundamentalsVery hardGATE CS

A buddy system manages 512 KB, initially one free block. Requests arrive: A = 70 KB, B = 35 KB, C = 80 KB, then A is freed, then D = 60 KB. Each request takes the lowest-addressed free block of the right power-of-two size. At which address (in KB) does D start?

  1. A. 0
  2. B. 192
  3. C. 128
  4. D. 384

Correct answer: B. 192

A gets 128 KB at 0 (splitting 512→256+256→128+128). B gets 64 KB at 128 (splitting 128→64+64). C gets 128 KB at 256. Freeing A frees 0–127 (its buddy 128–255 is split, so no merge). D needs 64 KB, and a free 64 KB block already exists at 192 (B's buddy), so it is used without splitting the 128 KB block at 0.

More Operating Systems questions

Exams that ask this topic