Data Structures & AlgorithmsVery hardGATE CS · ISRO Scientist
How many Hamiltonian cycles of the complete graph K_n (direction ignored) are there for n = 4?
- A. 12
- B. 3
- C. 24
- D. 6
Correct answer: B. 3
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 structurally different binary trees with n nodes (shape only, labels ignored) are there for n = 4?
- How many spanning trees of the wheel Wn (a hub joined to every vertex of an n-cycle rim) are there for n = 10?
- How many full binary trees (every node has 0 or 2 children) with n internal nodes are there for n = 5?
- How many spanning trees of the cycle Cn are there for n = 6?
- How many spanning trees does the complete bipartite graph K{3,3} have, with 3 vertices on one side and 3 on the other?
- How many spanning trees does the complete bipartite graph K{4,4} have, with 4 vertices on one side and 4 on the other?