Data Structures & AlgorithmsVery hardGATE CS · Product-company placement
What is the maximum flow from S to T in the network with directed capacities A→C (5), B→A (10), B→C (13), B→T (9), C→T (12), S→A (14), S→B (3), S→T (9)?
- A. 26
- B. 30
- C. 17
- D. 20
Correct answer: C. 17
Augment along residual paths until none remains; the value 17 equals the capacity of a minimum S–T cut (max-flow min-cut). The total out of S (26) and into T (30) 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
- The boolean expression F & F & T ^ T (T = true, F = false, & = AND, | = OR, ^ = XOR) can be fully parenthesised in 5 ways. In how many of…
- Keys 60, 41, 30, 69, 50, 54, 52, 55, 21 are inserted in that order into an empty AVL tree. What is the preorder traversal of the final tree?
- The weighted undirected graph A–B (1), A–C (6), A–E (3), B–D (1), C–D (2), C–E (5), D–E (3) has repeated weights. How many different…
- The words stem, stack, step, star, start are inserted into an empty trie (one node per character, shared prefixes share nodes, plus a…
- What is the maximum flow from S to T in the network with directed capacities A→B (15), A→T (2), B→T (10), C→A (2), C→B (13), C→T (9), S→B…
- Symbols occur with frequencies 18, 23, 24, 28, 34, 35. How many bits does an optimal (Huffman) prefix code need for the whole message, and…