Data Structures & AlgorithmsHardICPC regional · matching theory
Problem: What does the Kuhn-Munkres (Hungarian) algorithm compute on a bipartite graph with weights?
- A. The number of spanning trees
- B. The shortest path between all pairs
- C. The chromatic number
- D. A maximum-weight perfect matching when one exists
Correct answer: D. A maximum-weight perfect matching when one exists
The Hungarian method finds an optimal perfect matching for the assignment problem.
More Coding Interview Problems questions
- Problem: Which approach computes the number of distinct substrings of a string of length n in O(n log n) with a suffix array?
- Problem: Which graph algorithm checks whether a directed graph is a DAG in O(V + E)?
- Problem: What is the expected number of comparisons for a binary search on a sorted array of n = 1000 elements (successful search, worst…
- Problem: What is the time complexity of finding the articulation points and bridges together with one DFS?
- Problem: How many pairs (i < j) of integers in [1, 30] have i + j divisible by 6? Run the code. python print(sum(1 for i in range(1, 31)…
- Problem: How many integers in [1, 10000] are divisible by 9 but not by 27? Run the code. python print(sum(1 for x in range(1, 10001) if x…