Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions