Data Structures & AlgorithmsVery hardGATE CSE · Advanced

A weighted graph has vertices A, B, C, D and edges A-B 1, B-C 1, C-A 1, C-D 2, B-D 2, A-D 2. How many distinct minimum spanning trees does it have?

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

Correct answer: A. 9

Every MST has weight 4: any 2 of the 3 triangle edges (3 ways) plus any one weight-2 edge to D (3 ways) gives 9 trees.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic