Write a program to compare the performance of the LRU and the Optimal page replacement
algorithms. The program will take a reference string and the number of frames as inputs.
Assume the maximum length of a reference string is 20 and there are 5 diffent pages from
page 1 to page 5. The reference string can be randomly generated and the number of frames
is entered through the keyboard. For example, the system generates a reference string
2 1 3 4 5 2 3 ...5 and you enter the number of frames 3. Compare the number of page
faults generated by the Optimal and LRU algorithms. Print out the page replacement process
in your own way as long as it is clear. You can observe how LRU differs from the optimal.