Consider the following pseudocode for the random page replacement algorithm. Which of the following best suits the blank?
Start traversing the pages
if pages < capacity
{
insert the pages until the size of the set reaches capacity or all the pages are processed
maintain the pages in a queue
increment page fault
}
else if
{
current page is present in the set
do nothing
}
else
{
replace the current page with __________
store current page in the queue
increment page fault
}
return page faults
Start traversing the pages
if pages < capacity
{
insert the pages until the size of the set reaches capacity or all the pages are processed
maintain the pages in a queue
increment page fault
}
else if
{
current page is present in the set
do nothing
}
else
{
replace the current page with __________
store current page in the queue
increment page fault
}
return page faultsA. any random page
B. recently used page
C. least recently used page
D. the first page of the frame
Answer: Option A

Join The Discussion