Question: Please help C++ Optimal Page Replacement Algorithm Here is the code so far: // DECLARATION int n, m, i, j, k, hit = 0; double

Please help C++ Optimal Page Replacement Algorithm

Here is the code so far:

// DECLARATION int n, m, i, j, k, hit = 0; double hitratio; // PROMPT THE USER cout > n; cout > m; cout

// USE VECTOR vector p(m); cout > p[i]; } vector> a(n, vector(m, -1)); map mp; for (i = 0; i op; vector> c; for (auto q : mp) { c.push_back({ q.second,q.first }); } for (int q = i + 1; q

vector hitv(m); for (i = 1; i

cout

Input should be:

No. of frames: 3

No. of processes: 20

Processes: 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

And the output should be a matrix for the processes and frames, and:

Hits: 11

Faults: 9

However, I keep getting this instead:

Please help C++ Optimal Page Replacement Algorithm Here is the code so

Please fix the code. Thank you!

Process 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Frame 7 7 7 2 2 3 3 4 4 4 0 0 0 0 0 0 0 7 7 7 Frame 1 EOOOOOOO 2 2 2 2 2 1 1 1 1 1 0 0 Frame 2 E E1111111 3 3 3 3 3 2 2 2 2 2 1 1 1 11 11 Hit: 6 Page Fault: 14 Hit Ratio: 0

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!