Take Small example.
8 distinct pages={1,2,3,4,5,6,7,8} and having 3 page frames.
A. In same order
Seq |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
f0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
3 |
3 |
5 |
5 |
7 |
7 |
f1 |
|
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
4 |
4 |
6 |
6 |
6 |
f2 |
|
|
3 |
4 |
5 |
6 |
7 |
8 |
8 |
8 |
8 |
8 |
8 |
8 |
8 |
8 |
In this table 1 2 and 8 are hit that is in bold and italic.
here first access sequence no hits from second access sequence n-1 hit at starting and only 1 hit at last page reference = n hits here n is num.of frames
B. In reverse Order
Seq |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
f0 |
1 |
1 |
1 |
4 |
4 |
4 |
7 |
7 |
7 |
7 |
7 |
|
|
|
|
|
f1 |
|
2 |
2 |
2 |
5 |
5 |
5 |
8 |
8 |
8 |
8 |
|
|
|
|
|
f2 |
|
|
3 |
3 |
3 |
6 |
6 |
6 |
6 |
6 |
6 |
|
|
|
|
|
Here 8 7 and 6 are hits which are in bold and italic
Here no hits in first access sequence but in second access sequence first n frames are hits and other are miss .
So ans should be=0