Data Structures & AlgorithmsVery hardGATE CS · Product-company placement
What is the maximum flow from S to T in the network with directed capacities A→B (15), A→C (9), A→T (12), B→T (12), C→B (12), S→A (6), S→B (9), S→C (4)?
- A. 19
- B. 24
- C. 18
- D. 22
Correct answer: C. 18
Augment along residual paths until none remains; the value 18 equals the capacity of a minimum S–T cut (max-flow min-cut). The total out of S (19) and into T (24) are only upper bounds.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- An undirected graph has edges A–B, A–D, B–H, C–D, C–F, C–G, D–G, E–F, E–H, F–G. BFS starts at A and always scans neighbours in…
- A binary tree with distinct labels has INORDER G D C I F A B H E and LEVEL-ORDER E A D H G I B C F. What is its postorder traversal?
- An undirected graph has edges A–D, B–D, B–F, C–D, C–E, D–G, E–F, E–H, F–G, G–H. BFS starts at A and always scans neighbours in…
- An undirected graph has edges A–C, A–E, B–D, B–E, C–D, C–F, D–G, E–F, E–G. An ITERATIVE DFS starts with stack [A]; it pops a vertex, skips…
- An undirected graph has edges A–B, A–E, A–F, B–D, B–E, B–F, C–D, C–G, E–G. An ITERATIVE DFS starts with stack [A]; it pops a vertex, skips…
- 0/1 knapsack with capacity 16: items (weight, value) = (9, 40), (3, 34), (2, 19), (7, 38), (7, 32). What is the maximum total value?