GATE Computer ScienceHardGATE CS

A fully associative cache has 3 lines (one word each). The reference string 2, 3, 2, 1, 5, 2, 4, 5, 3, 2, 5, 2, 6, 1, 3, 6, 2, 5, 1, 4 is served. By how many misses does LRU replacement exceed the optimal (Belady/OPT) replacement policy?

  1. A. 5
  2. B. 3
  3. C. 4
  4. D. 2

Correct answer: B. 3

Simulation gives 14 misses for LRU and 11 for OPT (which always evicts the line whose next use is farthest in the future). The difference is 3.

More Computer Organization and Architecture questions

Exams that ask this topic