GATE Computer ScienceVery hardGATE CSE
An undirected weighted graph on vertices 0..6 has edges, written (u, v, weight): (0,1,2), (0,2,2), (1,2,2), (1,3,3), (2,3,3), (3,4,1), (3,5,4), (4,5,4), (4,6,5), (5,6,5), (2,6,6). How many distinct minimum spanning trees (as edge sets) does it have?
- A. 25
- B. 23
- C. 24
- D. 48
Correct answer: C. 24
Enumerating all 6-edge spanning trees, the minimum weight is 17 and exactly 24 trees attain it.
More Algorithms questions
- A directed graph has edges S→A (4), S→B (2), B→A (−3), A→C (2), B→D (3), D→C (−5). Dijkstra's algorithm is run from S: each extracted…
- Lomuto partition (pivot = last element, i starts at −1, for each j with A[j] ≤ pivot do i++ and swap A[i], A[j]; finally swap A[i+1] with…
- A max-heap is built from the array [3, 9, 2, 1, 4, 5, 8, 7, 6, 10] using the bottom-up procedure (sift-down from index ⌊n/2⌋−1 to 0…
- A hash table of size 11 uses double hashing with h1(k) = k mod 11 and h2(k) = 7 − (k mod 7), probing slot (h1 + i·h2) mod 11 for i = 0, 1…
- How many distinct spanning trees does the complete bipartite graph K(3,4) have?
- Floyd–Warshall is run on a 5-vertex digraph (vertices 0..4) with arc weights 0→1:3, 0→3:7, 1→0:8, 1→2:2, 2→0:5, 2→3:1, 3→0:2, 3→4:4 (no…