Data Structures & AlgorithmsModerateGATE CS · ISRO Scientist
How many labelled unrooted trees on n vertices are there for n = 5?
- A. 625
- B. 125
- C. 14
- D. 60
Correct answer: B. 125
Use the closed-form count for this family: it follows from the standard counting argument (Cayley's formula, the Catalan recurrence, or Kirchhoff's matrix-tree theorem). Each distractor is a different formula that looks similar.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- How many labelled rooted trees on n vertices (any vertex may be the root) are there for n = 5?
- How many Hamiltonian cycles of the complete graph Kn (direction ignored) are there for n = 7?
- How many spanning trees of the cycle Cn are there for n = 9?
- How many full binary trees (every node has 0 or 2 children) with n internal nodes are there for n = 10?
- How many spanning trees of the cycle Cn are there for n = 12?
- How many labelled unrooted trees on n vertices are there for n = 9?