What is the number of page hits in the LRU (Least Recently Used) page…

2026

What is the number of page hits in the LRU (Least Recently Used) page replacement policy for 3 page frames and the reference string 0, 1, 7, 2, 3, 2, 7, 1, 0, 3? Assume all 3 frames are initially empty.

  1. A.

    2

  2. B.

    3

  3. C.

    4

  4. D.

    5

Attempted by 31 students.

Show answer & explanation

Correct answer: A

Simulate LRU with 3 initially empty frames. Show frames from least recently used to most recently used after each reference.

Reference 0: miss, frames = [0]
Reference 1: miss, frames = [0, 1]
Reference 7: miss, frames = [0, 1, 7]
Reference 2: miss, replace 0, frames = [1, 7, 2]
Reference 3: miss, replace 1, frames = [7, 2, 3]
Reference 2: hit, frames = [7, 3, 2]
Reference 7: hit, frames = [3, 2, 7]
Reference 1: miss, replace 3, frames = [2, 7, 1]
Reference 0: miss, replace 2, frames = [7, 1, 0]
Reference 3: miss, replace 7, frames = [1, 0, 3]

The only hits occur at the second occurrence of page 2 and the second occurrence of page 7. Hence, the number of page hits is 2.

Explore the full course: Niacl Ao It Specialist