Data Structures & AlgorithmsVery hardGATE CS · ISRO Scientist

How many distinct binary trees that use each label 1 to n exactly once (shape and labels both matter) are there for n = 6?

  1. A. 95040
  2. B. 46656
  3. C. 720
  4. D. 792

Correct answer: A. 95040

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.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic