Question: Write a JAVA program that implements the FIFO and LRU page replacement algorithms presented in chapter 8 of your text. First generate a random page-reference

Write a JAVA program that implements the FIFO and LRU page replacement algorithms presented in chapter 8 of your text.

First generate a random page-reference string (this should be 20 entries long) where page numbers range from 0 to 9.

Apply the random page-reference string to each algorithm, and record the number of page faults incurred by each algorithm. Implement the replacement algorithms so that the number of page frames can vary from 1 to 7. Record the number of page faults with each of these different page frames numbers and each of the different algorithms. Assume that demand paging is used.

Then do the same procedure except use the following page-reference string instead of the random one: 0,7,0,1,2,0,8,9,0,3,0,4,5,6,7,0,8,9,1,2

And then lastly do it with the page-reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1

Please do it in JAVA I know there is C and C++ code out there similar to this but I do not want that, do not just paste whatever and include comments so I can follow the code. Include screenshots of output so I can see it working.

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!