CS FundamentalsVery hardGATE CS

Banker's algorithm with 3 resource types. Available = (1,1,1). Allocation rows P0..P3: (1,0,1), (0,2,0), (2,1,0), (1,1,1); Maximum rows: (3,2,2), (1,3,1), (3,2,1), (2,2,2). How many distinct safe sequences exist?

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

Correct answer: C. 16

Needs: P0 (2,2,1), P1 (1,1,1), P2 (1,1,1), P3 (1,1,1). P0 cannot start (its need exceeds (1,1,1)) and cannot follow P1 alone (available (1,3,1) has only 1 of the first type), which removes 6+2 of the 24 orders, leaving 16.

More Operating Systems questions

Exams that ask this topic