Data Structures & AlgorithmsVery hardGATE CSE · Advanced

A cache with 3 slots serves the page requests 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. How many misses occur under LRU replacement and under FIFO replacement?

  1. A. LRU 9, FIFO 10
  2. B. LRU 9, FIFO 9
  3. C. LRU 10, FIFO 9
  4. D. LRU 10, FIFO 10

Correct answer: C. LRU 10, FIFO 9

Simulating both policies gives 10 misses for LRU and 9 for FIFO on this particular sequence; LRU is not always better.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic