-
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1, a2 ,..., a20, a1, a2,..., a20), where each ai is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is _________.
-
- 1
- 2
- 3
- 4
Correct Option: A
a1 a2 ........a20 a1 a2 ...........a20
For first a1 to a20, The no. of page faults = 20
Now a1to a9, Hit again a10 to a20 replace only 9th position, so no. of page faults = 11. S0, total no. of page faults = 31
For first a1 to a20 there are 20 page faults.
Next a1 to a9, Hit again a10 to a19, replace any location from 0 to 9 for a20 Hit. So total no. of page faults = 30.
Difference = 31 – 30 = 1