A system uses optimal policy for a page replacement. It has 4 page frames with no pages loaded to begin with. Consider the following scenario
Case-1: System first accesses 200 distinct pages in sequential order and then access same 200 distinct pages in same order.
Case-2: System first accesses 200 distinct pages in sequential order and then access same 200 distinct page in reverse order.
The difference in the number of faults occurred in both case are _________.
here 1 to 4 (4PF)...after then....now we will repalce 4 ,5,6,7.....so on(becz upcoming element would be farthest than present 1,2,3...after servicing 0f 200 pages...remaining pages in PM would be 1,2,3,200...as we start from second loop 1,2,3 hit and then we will repalce 1,2,3,4,5,6..so on and 200 remain as it is becoz it is upcoming request.....therefor total 4 hit(1,2,3,200)...means (400-4=396PF)...
Case:- Same....u can imagine
@_anu Please Check This https://gateoverflow.in/70912/gate-made-easy-mock-test