Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 C

A tree has these parent→child edges: 44→79, 83→17, 75→83, 15→75, 27→20, 79→92, 75→97, 65→15, 75→44, 17→27. A vertex cover is a set of vertices such that every edge has at least one endpoint in the set. What is the size of a minimum vertex cover?

  1. A. 3
  2. B. 8
  3. C. 5
  4. D. 6

Correct answer: C. 5

In a tree the minimum vertex cover equals the maximum matching (König's theorem), found greedily from the leaves up. Counting leaves or internal nodes is a common misreading, not the optimum.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic