Question: C++ Page Replacement Algorithm Write a program that will calculate the page faults when using LRU Your input file starts with the case number, number

  1. C++

    Page Replacement Algorithm

  2. Write a program that will calculate the page faults when using LRU
  3. Your input file starts with the case number, number of frames, and the sequence of page request
  4. Sample input file //input file Case 1, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 Case 2, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,0 Case 3, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,2

*just a reminder for example case 1 Case 1, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1

case number = Case 1,

number of frames, = 3,

the sequence of page request = 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1

5. A sample output file will look like the following. LRU algorithm Case 1, 12 faults Case 2, 11 faults Case 3, 13 faults

I want the code to be able to read the input from a file and write the output in another file. Like using ifstream and ofstream so that my input can be varies if i want to change the value

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!