2 Use LRU and Optimal algorithms with a three frame and four
2. Use LRU and Optimal algorithms with a three frame and four frame allocation for the following sequence of page references: <1,2,3, 4, 5, 2,4,6,7,8, 9, 0,3,10,8,4,10,6,7,8,4,2,3 >.
Solution
LRU
3 Frames
4 Frames
OPTIMAL
3 Frames
4 Frames
| 1 | 2 | 3 | 4 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 0 | 3 | 10 | 8 | 4 | 10 | 6 | 7 | 8 | 4 | 2 | 3 | 
| f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | |||
| 1 | 1 | 1 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 8 | 8 | 3 | 3 | 4 | 4 | 4 | 4 | 7 | 7 | 7 | 2 | 2 | 
| 2 | 2 | 2 | 5 | 5 | 5 | 6 | 6 | 6 | 9 | 9 | 9 | 10 | 10 | 10 | 10 | 10 | 10 | 8 | 8 | 8 | 3 | |
| 3 | 3 | 3 | 2 | 2 | 2 | 7 | 7 | 7 | 0 | 0 | 0 | 8 | 8 | 8 | 6 | 6 | 6 | 4 | 4 | 4 | 

