Question: Note: Please write code in C++ This is the Pseudocode below Loop for 1,000 experiments Generate a memory trace Loop for working set size from
Note: Please write code in C++
This is the Pseudocode below
Loop for 1,000 experiments
Generate a memory trace
Loop for working set size from 2 through 20
Faults[working set size][LRU] += LRU( working set size, trace )
Faults[working set size][FIFO] += FIFO ( working set size, trace )
Faults[working set size][Clock] += Clock ( working set size, trace )
Faults[working set size][Random] += Random ( working set size, trace )
End of working set size loop
End of Experiment loop
Loop for working set size from 2 through 20
Test trace with:
Print( working set size,
Faults[working set size][LRU] / 1000.0,
Faults[working set size][FIFO] / 1000.0,
Faults[working set size][Clock] / 1000.0,
Faults[working set size][Random] / 1000.0 )
End of working set size loop
External to the program, generate a plot which depicts the performance of each of the algorithms.
Generate a memory trace
Each memory trace is 1,000 addresses.
Loop over parts from 0 to 9
Base address equals 25 times a uniform random value in [0,99], inclusive.
Index over addresses within part from 0 to 99.
Address[100*part+index] = Base + uniform random in [0,49], inclusive.
Instructions: You can follow the slides below to further understand the step and algorithm

![from 2 through 20 Faults[working set size][LRU] += LRU( working set size,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f909d53e6ec_01266f909d484750.jpg)
![trace ) Faults[working set size][FIFO] += FIFO ( working set size, trace](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f909d65bfab_01366f909d5a9f30.jpg)
![) Faults[working set size][Clock] += Clock ( working set size, trace )](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f909d74cf1f_01466f909d6a34df.jpg)
![Faults[working set size][Random] += Random ( working set size, trace ) End](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f909d8434e3_01566f909d7a15b9.jpg)

Basic Algorithms Algorithms used for the selection of a page to replace: . Optimal Least recently used (LRU) First-in-first-out (FIFO) . Clock Basic Algorithms Algorithms used for the selection of a page to replace: . Optimal Least recently used (LRU) First-in-first-out (FIFO) . Clock
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
