Data Structures & AlgorithmsHardICPC regional · matching theory
Problem: Which statement about Hall's theorem for a bipartite graph with sides L and R is correct?
- A. A matching exists iff the graph is connected
- B. A matching saturating L exists iff |L| = |R|
- C. Every bipartite graph with equal sides has a perfect matching of size |R| + 1
- D. A matching saturating L exists iff every subset S of L has at least |S| neighbours in R
Correct answer: D. A matching saturating L exists iff every subset S of L has at least |S| neighbours in R
Hall's condition on neighbourhoods is necessary and sufficient for matching every vertex of L. Equal side sizes alone do not guarantee a perfect matching.
More Coding Interview Problems questions
- Problem: Which claim about the complexity of deciding 2-SAT (satisfiability of clauses with at most two literals) is correct?
- Problem: Which of the following problems is NP-complete (decision version)?
- Problem: For Dijkstra on a graph with V vertices and E edges, which pairing of data structure and running time is correct?
- Problem: For a set of 40 items split into two halves of 20, the meet-in-the-middle approach solves subset-sum queries in roughly which time?
- Problem: Grundy numbers for the subtraction game where a move removes 1 or 2 stones: what are g(0) through g(5)? Run the code. python g =…
- Problem: Using the bubble sort rule, what is the array after exactly one left-to-right pass over [3, 1, 2]? Run the code. python a = [3…