Question: Java programming ( Least Frequently Used (LFU ) ): Details for LFU: AIM: Simulate LFU page replacement algorithms . Programming Language : Java ALGORITHM: 1.
Java programming (Least Frequently Used (LFU ) ):
Details for LFU:
AIM: Simulate LFU page replacement algorithms .
Programming Language:
Java
ALGORITHM:
1. Start
2. Read the number of frames
3. Read the number of pages
4. Read the page numbers
5. Initialize the values in frames to -1
6. Allocate the pages in to frames by selecting the page that will not be used for the longest period of time.
7. Display the number of page faults.
8. stop
OUTPUT:
OPTIMAL PAGE REPLACEMENT ALGORITHM
Enter no.of Frames....3
Enter no.of reference string..6
Enter reference string..
6 5 4 2 3 1
OPTIMAL PAGE REPLACEMENT ALGORITHM
The given reference string:
. 6 5 4 2 3 1
Reference NO 6-> 6 -1 -1
Reference NO 5-> 6 5 -1
Reference NO 4-> 6 5 4
Reference NO 2-> 2 5 4
Reference NO 3-> 2 3 4
Reference NO 1-> 2 3 1
No.of page faults...6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
