Data Structures & AlgorithmsHardGATE CS · ISRO Scientist
How many spanning trees of the cycle C_n are there for n = 5?
- A. 5
- B. 32
- C. 4
- D. 10
Correct answer: A. 5
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 Hamiltonian cycles of the complete graph Kn (direction ignored) are there for n = 9?
- How many simple paths between two fixed vertices u and v of the complete graph Kn are there for n = 9?
- How many structurally different binary trees with n nodes (shape only, labels ignored) are there for n = 5?
- How many distinct binary trees that use each label 1 to n exactly once (shape and labels both matter) are there for n = 6?
- How many simple paths between two fixed vertices u and v of the complete graph Kn are there for n = 8?
- How many distinct binary trees that use each label 1 to n exactly once (shape and labels both matter) are there for n = 4?