CS FundamentalsVery hardGATE CS (PYQ pattern)

Working-set window Δ = 5 references: WS(t) is the set of distinct pages among the 5 most recent references up to and including time t (fewer than 5 references exist at the start). Reference string (times 1 to 24): 3, 2, 4, 6, 1, 1, 7, 5, 1, 3, 5, 1, 5, 2, 1, 1, 4, 4, 1, 2, 1, 5, 4, 1. At how many of the 24 instants is the working-set size exactly 4?

  1. A. 13
  2. B. 9
  3. C. 11
  4. D. 20

Correct answer: C. 11

Sliding the 5-reference window gives sizes [1, 2, 3, 4, 5, 4, 4, 4, 3, 4, 4, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 4, 4, 4]; exactly 11 of them equal 4.

More Operating Systems questions

Exams that ask this topic