Data Structures & AlgorithmsVery hardICPC regional · flow
Problem: Which statement about the Edmonds-Karp algorithm's number of augmentations is correct?
- A. It is exponential in the flow value
- B. It is O(V E) because each edge is critical O(V) times
- C. It is always exactly the flow value
- D. It is independent of the graph size
Correct answer: B. It is O(V E) because each edge is critical O(V) times
Shortest augmenting paths keep distances non-decreasing, so each edge becomes critical at most O(V) times.
More Coding Interview Problems questions
- Problem: Which problem is solved by the Floyd-Warshall algorithm in the presence of negative edges but no negative cycle?
- Problem: What is the running time of Prim's algorithm with a binary heap on a connected graph with V vertices and E edges?
- Problem: What is the maximum number of edges in a simple planar graph with V >= 3 vertices?
- Problem: Which theorem states that every tree on n vertices has exactly n - 1 edges?
- Problem: What is the number of spanning trees of a cycle graph Cn with n vertices?
- Problem: Which problem does the Gale-Shapley algorithm solve, and what is its typical outcome?