FOR FREE YEAR SOLVED

UGC NET question on LRU:

 

Q. UGC NET 2015 

An LRU page replacement is used with 4 page frames and eight pages. How many page faults will occur with the reference string 0  1  7  2  3  2  7  1  0  3 if the four frames are initially empty?

 

A. 6           B. 7             C. 5          D. 8

 

You should know:

Before seeing the solution please follow the previous chapter: 

LRU page replacement algorithm.

 

Solution and explanation:

Given page references: 0, 1, 7, 2, 3, 2, 7, 1, 0, and 3.

 

 

The number of page faults is 7.

 

Shortcut method:

But in examination it is not possible to solve it by this elaborative way we can do it by a single frame like below:

Page references: 0, 1, 7, 2, 3, 2, 7, 1, 0, 3.

 

 

The above process is a shortcut and the easiest process to calculate page faults.

 

So, the number of page faults = 7.

 

Option B is correct.