Data Structures & AlgorithmsModerateGATE CS · TCS NQT

Problem: The complete graph K6 has 15 edges. A perfect matching of 3 disjoint edges is removed. How many edges remain?

  1. A. 15
  2. B. 9
  3. C. 12
  4. D. 3

Correct answer: C. 12

A perfect matching on 6 vertices has 6 / 2 = 3 edges, so 15 − 3 = 12 edges remain. Removing 6 edges (one per vertex) gives 9, 15 forgets the removal, and 3 is the number of edges removed.

More Coding Interview Problems questions

Exams that ask this topic