Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
-
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 of frames, and the sequence of page request
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started