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?
- A. 12
- B. 20
- C. 16
- 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
- A disk has cylinders 0 to 199. The head is at cylinder 60 moving upward. Pending requests: 18, 150, 72, 41, 177, 95, 33, 124. C-LOOK…
- FIFO page replacement is run on the reference string 3, 4, 2, 6, 1, 3, 4, 6, 7, 1, 1, 5, 3, 4, 7, 2, 1, 7 with an initially empty memory…
- The clock (second-chance) algorithm manages 4 frames, initially empty and filled in order 0..3. A page's reference bit is set to 1 when it…
- Assume every fork() succeeds and each printf output is flushed immediately. int main(void) { for (int i = 0; i < 4; i++) { if (fork() ==…
- A Unix-style file system has 1 KB blocks, 4-byte block pointers and inodes with 12 direct, one single-indirect and one double-indirect…
- Holes in memory (in KB, in address order): 250, 240, 230, 180, 140. Processes arrive and stay resident in this order: 100, 190, 200, 150…