Data Structures & AlgorithmsHardICPC regional · matching theory

Problem: Which problem is solved by the Gale-Shapley algorithm in O(n^2) time with preference lists?

  1. A. Maximum flow
  2. B. Stable matching between two equal-sized sets
  3. C. Shortest paths
  4. D. Minimum vertex cover

Correct answer: B. Stable matching between two equal-sized sets

Proposals are made at most once per pair, so the algorithm runs in O(n^2).

More Coding Interview Problems questions

Exams that ask this topic