Consider the following page reference string:

1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6 

How many page faults would occur for the following replacement algorithms, assuming four frames and all frames are initially empty.
(A) LRU replacement: 10, FIFO replacement: 16, Optimal replacement: 11
(B) LRU replacement: 15, FIFO replacement: 16, Optimal replacement: 11
(C) LRU replacement: 15, FIFO replacement: 14, Optimal replacement: 8
(D) LRU replacement: 10, FIFO replacement: 14, Optimal replacement: 8


Answer: (D)

Explanation: Using least recently used (LRU) page replacement algorithm,
\"\"
So, number of page faults are 10.

Using first in first out (FIFO) page replacement algorithm,
\"\"
So, number of page faults are 14.

Using optimal page replacement algorithm,
\"\"
So, number of page faults are 8.

So, option (D) is correct.

Quiz of this Question


  • Last Updated : 06 Dec, 2018

Share your thoughts in the comments