Data Structures & AlgorithmsVery hardProduct company OA
What is the maximum flow from S to T in the network with capacities S→A 10, S→B 5, A→B 15, A→T 6, B→T 10?
- A. 16
- B. 21
- C. 15
- D. 11
Correct answer: C. 15
The cut {S} → {A, B, T} has capacity 10 + 5 = 15, so the flow cannot exceed 15; it is achieved by S→A 10 (6 to T, 4 to B) and S→B 5, with B→T carrying 9. The cut into T (6 + 10 = 16) is larger, so it is not the bottleneck; 21 just adds edges out of A and B.
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
- Weighted undirected graph: A–B 1, B–C 2, C–A 2, C–D 1, B–D 2. How many DIFFERENT minimum spanning trees does it have?
- Keys 85, 62, 86, 26, 40, 54, 92, 17, 18, 67 are inserted into an empty AVL tree (giving preorder 62, 40, 18, 17, 26, 54, 86, 85, 67, 92)…
- Keys 20, 24, 27, 35, 38 are searched with frequencies 4, 1, 3, 6, 11 respectively (only successful searches). The cost of a BST is Σ…
- DFS on the directed graph with adjacency lists A: CE; B: EFG; C: B; D: AG; E: C; F: G; G: – starts at A (scanning lists in the order…
- What is the minimum number of edges that must be deleted from the undirected graph with edges A–B, A–D, A–E, B–D, B–F, C–D, C–E, D–E, E–F…
- An undirected connected graph has edges A–C, B–D, B–F, B–H, C–D, C–F, D–G, D–I, E–H, F–G. How many articulation points (cut vertices) and…