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
Related Questions on Miscellaneous on Data Structures
Which data structure is used to implement a binary heap efficiently?
A. Array
B. Linked List
C. Stack
D. Queue
In which scenario would you use a Bloom Filter?
A. For implementing a stack-based algorithm
B. To maintain a balanced binary tree
C. For efficient sorting of elements
D. To test membership in a large dataset
A. Queue
B. Stack
C. Heap
D. Array

Join The Discussion