Data Structures & AlgorithmsVery hardICPC regional · matching theory
Problem: Which problem does the Gale-Shapley algorithm solve, and what is its typical outcome?
- A. Shortest paths with negative edges
- B. Minimum cut
- C. Longest common subsequence
- D. Stable marriage: the men-proposing version gives a stable matching optimal for the proposers
Correct answer: D. Stable marriage: the men-proposing version gives a stable matching optimal for the proposers
Men-proposing deferred acceptance yields the stable matching that is best for the men among all stable matchings.
More Coding Interview Problems questions
- Problem: What is the time complexity of building a Fenwick tree from an array of n values in O(n) time?
- Problem: What does the Booth's algorithm compute?
- Problem: Which claim about the Manacher algorithm is correct?
- Problem: Which concept is used by the Rabin-Karp algorithm to compare substrings in constant time?
- Problem: What is the number of comparisons needed by heapsort in the worst case for n elements?
- Problem: Which algorithm finds the k-th smallest element in expected linear time?