Data Structures & AlgorithmsModerateProduct-company MCQ pattern

How many different spanning trees does the complete graph K₄ have?

  1. A. 4
  2. B. 12
  3. C. 6
  4. D. 16

Correct answer: D. 16

By Cayley's formula a complete graph on n labelled vertices has n^(n − 2) spanning trees: 4² = 16. Listing all 3-edge subsets of the 6 edges (20 of them) and removing the 4 triangles also gives 16.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic