GATE Computer ScienceHardGATE CS (PYQ pattern)

A labelled tree on vertices {0, …, 7} has Prüfer sequence (3, 3, 3, 6, 6, 1). What is the diameter (in edges) of the tree?

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

Correct answer: B. 4

Decoding (repeatedly joining the smallest current leaf to the next sequence entry) gives edges [(0, 3), (1, 6), (1, 7), (2, 3), (3, 4), (3, 6), (5, 6)]; its longest path has 4 edges.

More Discrete Mathematics questions

Exams that ask this topic