GATE Computer ScienceVery hardGATE CS
A connected weighted undirected graph has vertices 0 to 5 and edges (u, v, weight): (0,1,2), (0,2,2), (1,2,2), (1,3,3), (2,3,3), (2,4,3), (3,4,3), (3,5,4), (4,5,4), (0,5,6). How many different minimum spanning trees does it have?
- A. 24
- B. 30
- C. 36
- D. 32
Correct answer: B. 30
The minimum weight is 14, and exhaustive enumeration of all 5-edge spanning trees shows exactly 30 of them reach it. Ties at weights 2, 3 and 4 make many different edge choices equally cheap, so the MST is far from unique.
More Algorithms questions
- A tree has vertices 0 to 9 with edges 0-1, 0-2, 1-3, 1-4, 2-5, 2-6, 4-7, 4-8, 6-9, and vertex weights w0 = 5, w1 = 4, w2 = 6, w3 = 3, w4 =…
- Under the standard uniform-hashing approximations, a table with load factor α = 0.9 needs about ½(1 + 1/(1 − α)²) probes for an…
- The function below is called as g(12, 5). def g(n, k): if k == 0 or k == n: return 1 return g(n-1, k-1) + g(n-1, k) How many calls to g…
- Ten words are inserted into an initially empty trie (one node per character, plus a root): cat, car, cart, care, dog, dot, do, carbon…
- A directed graph has edges (weights): S→A 2, S→B 2, S→C 3, A→D 2, A→E 3, B→D 2, B→E 1, B→F 3, C→E 1, C→F 2, D→T 2, E→T 3, F→T 1. How many…
- Twelve keys 24, 17, 31, 9, 22, 5, 38, 13, 2, 27, 6, 20 are used to build a min-heap in an array in two ways: (1) by inserting them one at…