CS FundamentalsHardGATE CS (PYQ pattern)

Banker's algorithm: 5 processes, resource types A, B, C with totals (10, 5, 7). Allocation / Maximum: P0 (0,1,0)/(7,5,3), P1 (2,0,0)/(3,2,2), P2 (3,0,2)/(9,0,2), P3 (2,1,1)/(2,2,2), P4 (0,0,2)/(4,3,3). How many different safe sequences does this state have?

  1. A. 12
  2. B. 20
  3. C. 16
  4. D. 24

Correct answer: C. 16

Available = (3,3,2); Need = P0 (7,4,3), P1 (1,2,2), P2 (6,0,0), P3 (0,1,1), P4 (4,3,1). Depth-first enumeration of all orders in which each process's Need fits the current Work vector gives 16 safe sequences.

More Operating Systems questions

Exams that ask this topic