Not Recently Used Algorithm (NRU) Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Not Recently Used Algorithm (NRU)”.

1. Which page replacement strategy uses referenced bits and modified bits to replace the page?
a) First in first out
b) Least recently used algorithm
c) Not recently used algorithm
d) Optimal page replacement algorithm
View Answer

Answer: c
Explanation: The not recently used algorithm is one of the page replacement algorithms. Page replacement algorithms in operating systems are used to decide which page should be evicted to make room for the upcoming pages. Not recently used algorithm is a page replacement strategy that uses referenced bits and modified bits to replace the page.

2. Not recently used page replacement algorithm uses a counter.
a) True
b) False
View Answer

Answer: b
Explanation: The not frequently used algorithm is a page replacement algorithm that uses a counter to keep track of how frequently the page has been used. Here, the page which has the lowest count may be swapped out. The not recently used algorithm doesn’t use a counter, it uses only referenced bit and modified bit.

3. In the not recently used algorithm, what do the R bits and M bits refer to?
a) R – read/write, M – modified
b) R – not referenced, M – modified
c) R – read/write, M – not modified
d) R – referenced, M – not modified
View Answer

Answer: a
Explanation: After every memory reference, the bits are set by hardware but are cleared only by the software. The R bit is set when the page is referenced by performing read or write. M bit is set when the page is modified.
advertisement
advertisement

4. Consider the given page reference string 3, 1, 0, 2, 1, 5, 6, 2, 8, 6, 9, 1. How many page faults will occur if the program has 4-page frames available to it and it uses the not recently used algorithm?
a) 6
b) 7
c) 8
d) 9
View Answer

Answer: d
Explanation: All the slots are empty initially, 3 1 02 are allocated → 4 page faults. 1 is already present → 0 page fault. When 5 came, 3 wasn’t used recently, replace it → 1 page fault When 6 came, 0 wasn’t used recently, replace it → 1 page fault 2 is already present → 0 page fault When 8 came, 1 wasn’t used recently, replace it → 1 page fault 6 is already present → 0 page fault When 9 came, 5 wasn’t used recently, replace it → 1 page fault When 1 came, 2 wasn’t used recently, replace it → 1 page fault Hence, total 9 page faults.

5. In the not recently used algorithm, which page is to be replaced when the new page comes in?
a) Referenced, modified
b) Not referenced, not modified
c) Referenced, not modified
d) Not referenced, modified
View Answer

Answer: b
Explanation: Not recently used page replacement algorithm, as the name suggests, evicts the page that hasn’t been used recently. Whenever a page is referred, it is marked by setting a referenced bit. It randomly picks up the page from the lowest numbered nonempty class. Hence, the page which is not referenced and not modified will be replaced first.

6. Consider the given page reference string 2, 6, 1, 2, 0, 1, 5, 3. What will be the page fault rate, if the program has 3-page frames available to it and it uses the not recently used algorithm?
a) 1 / 2
b) 2 / 4
c) 3 / 4
d) 3 / 8
View Answer

Answer: c
Explanation: All the slots are empty initially, 2 6 1 are allocated →3 page faults. 2 is already present → 0 page fault. When 0 came, 6 wasn’t used recently, replace it → 1 page fault 1 is already present → 0 page fault When 5 came, 2 wasn’t used recently, replace it → 1 page fault When 3 came, 0 wasn’t used recently, replace it → 1 page fault Total 9 page faults. Now, page fault rate = page fault / total pages = 6 / 8 = 3 / 4.

7. The page which is referenced and not modified is less important than the page which is modified but not referenced.
a) True
b) False
View Answer

Answer: b
Explanation: In the not recently used algorithm, instead of removing the page that is recently used, we remove a modified page, which is not referenced in one clock tick. Hence, a page that is referenced and not modified is more important than the page which is modified but not referenced.

advertisement

8. Which among the following is a disadvantage of the not recently used algorithm?
a) Implementation is complex
b) It uses a queue data structure for implementation
c) Time consuming
d) It cannot be implemented
View Answer

Answer: c
Explanation:  In the not recently used algorithm to decide which page is to be evicted when the new page comes in, we have to scan through the reference bits and modified bits. Hence, the performance is not that good, as it takes time to classify.

Sanfoundry Global Education & Learning Series – Data Structures & Algorithms.

advertisement

To practice all areas of Data Structures & Algorithms, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.