Data Structures & AlgorithmsVery hardGATE CS · ISRO Scientist
How many simple paths between two fixed vertices u and v of the complete graph K_n are there for n = 8?
- A. 5040
- B. 1957
- C. 720
- D. 28
Correct answer: B. 1957
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 distinct binary trees that use each label 1 to n exactly once (shape and labels both matter) are there for n = 4?
- How many labelled unrooted trees on n vertices are there for n = 4?
- How many spanning trees of the cycle Cn are there for n = 4?
- How many full binary trees (every node has 0 or 2 children) with n internal nodes are there for n = 11?
- How many labelled rooted trees on n vertices (any vertex may be the root) are there for n = 6?
- How many labelled unrooted trees on n vertices are there for n = 6?