A) 6 B) 7 C) 5 D) 8.
Answer B.
Explanation.
LRU-
Whenever a page is used it is stamped with a counter value. When a page is to be replaced page with lowest stamp value is selected as the victim.
0172 3 2 7 1 0 3.
0(1 page fault,Counter=1),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=4).
0 is selected as the victim .and replaced by.3. now frame is.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=4)
2 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=6)
7 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
1 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=8),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
0 is not in the frame so counter 5 is the least so 3 is replaced by 0.and page fault is increased.
0(6 page fault,counter=9),1(2 page fault,Counter=8),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
3 replaces 2
0(6 page fault,counter=9),1(2 page fault,Counter=8),7(3 page fault,Counter=7),3 (7 page fault,Counter=10)
Answer B.
Explanation.
LRU-
Whenever a page is used it is stamped with a counter value. When a page is to be replaced page with lowest stamp value is selected as the victim.
0172 3 2 7 1 0 3.
0(1 page fault,Counter=1),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=4).
0 is selected as the victim .and replaced by.3. now frame is.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=4)
2 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=3),2 (4 page fault,Counter=6)
7 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=2),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
1 is already in the frame so counter is increased.
3(5 page fault,counter=5),1(2 page fault,Counter=8),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
0 is not in the frame so counter 5 is the least so 3 is replaced by 0.and page fault is increased.
0(6 page fault,counter=9),1(2 page fault,Counter=8),7(3 page fault,Counter=7),2 (4 page fault,Counter=6)
3 replaces 2
0(6 page fault,counter=9),1(2 page fault,Counter=8),7(3 page fault,Counter=7),3 (7 page fault,Counter=10)
Visit this site for more Operating System Questions
ReplyDeleteno 7
ReplyDeletehttp://academyera.com/operating-systems-subject-wise-gate-cs-questions