Data Structures & AlgorithmsVery hardGATE CS · ICPC regional

Connected undirected weighted graph on vertices A, B, C, D, E with edges A–B (3), A–C (3), B–C (3), B–D (3), C–D (1), C–E (4). Among all spanning trees whose total weight is strictly greater than the minimum spanning tree weight, what is the smallest possible total weight?

  1. A. 13
  2. B. 14
  3. C. 10
  4. D. 11

Correct answer: A. 13

The minimum spanning tree weighs 11; the true second value is 13, found only by enumerating trees. Swapping just one MST edge for the cheapest non-tree edge is the tempting shortcut that misses it.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic