Question: Part - 2 ( 9 pts ) - Write a program named: ReplacePage In separate methods, implement the FIFO and LRU page - replacement algorithms

Part-2(9 pts)- Write a program named: ReplacePage
In separate methods, implement the FIFO and LRU page-replacement algorithms as presented in
Ch10(slides 10.35 and 10.38, respectively).
Allow each method to accept as arguments: a reference string, a desired number of page
frame, and optionally a flag to enable/disable output (used for part-3 extra credit)
Each method should return the number of page fault
As a test case, use 3 as number of page frame and the exact reference string shown on the slides:
String testRefStr ="70120304230321201701"; // in Java
Print out results for both FIFO and LRU. A sample example for FIFO is shown below:
Additionally, for FIFO, show the effect of Belady's Anomaly by using this reference string:
String testRefStr2="123412512345"; // in Java
Print out results for 3 and 4 page frames - they should match the result presented on slide 10.35
 Part-2(9 pts)- Write a program named: ReplacePage In separate methods, implement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!