CS FundamentalsModerateGATE CS

The reference string of a process is 1 2 1 3 4 4 5 2 3 2 2 6 7 7 6 1. Using a working-set window of the last 5 references (including the current one), what is the working-set size just after the 13th reference (the first 7) is made?

  1. A. 3
  2. B. 5
  3. C. 6
  4. D. 4

Correct answer: D. 4

At position 13 the window holds references 9-13: 3, 2, 2, 6, 7. The distinct pages are {3, 2, 6, 7}, so the size is 4; counting references instead of distinct pages would wrongly give 5.

More Operating Systems questions

Exams that ask this topic