Data Structures & AlgorithmsHardICPC regional · matching

Problem: What is the time complexity of the Hopcroft-Karp algorithm for maximum matching on V vertices and E edges?

  1. A. O(V^3)
  2. B. O(E^2)
  3. C. O(V log V)
  4. D. O(E sqrt(V))

Correct answer: D. O(E sqrt(V))

Each phase is O(E) and there are O(sqrt V) phases, giving the O(E sqrt V) bound.

More Coding Interview Problems questions

Exams that ask this topic