Data Structures & AlgorithmsVery hardGATE CS · ICPC regional

A tree has the vertices B, D, K, O, Q, V, W, Y, Z and the edges D–K, K–W, W–V, D–B, W–Q, V–Y, V–Z, Q–O. A set D dominates the tree if every vertex is in D or adjacent to a vertex in D. What is the size of a smallest dominating set?

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

Correct answer: C. 3

A tree DP over three states per vertex gives 3. A vertex cover (4) is a different quantity, and the leaf count (4) is only a lower-bound heuristic.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic