Related Articles

Related Articles

GATE | GATE-CS-2015 (Set 1) | Question 56
  • Difficulty Level : Expert
  • Last Updated : 20 Feb, 2015

Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First-In-First Out (FIFO) and Least Recently Used (LRU)?

(A) Both incur the same number of page faults
(B) FIFO incurs 2 more page faults than LRU
(C) LRU incurs 2 more page faults than FIFO
(D) FIFO incurs 1 more page faults than LRU


Answer: (A)

Explanation:

3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3

In both FIFO and LRU, we get following after 
considering 3, 8, 2, 3, 9, 1, 3 8 2 9 1

FIFO
6 replaces 3
8 2 9 1 6

3 replaces 8
2 9 1 6 3

8 replaces 2
9 1 6 3 8

2 replaces 9
1 6 3 8 2

No more page faults

LRU
6 replaces 8
3 2 9 1 6
 
8 replaces 2
3 9 1 6 8

2 replaces 1
3 9 6 8 2

1 replaces 8
3 9 6 2 1 


Quiz of this Question

sudo-gate-course

My Personal Notes arrow_drop_up
Recommended Articles
Page :