GATE Computer ScienceVery hardGATE CSE · UGC NET
How many distinct spanning trees does the complete bipartite graph K(3,4) have?
- A. 288
- B. 600
- C. 16807
- D. 432
Correct answer: D. 432
By the matrix-tree theorem (verified by determinant), K(m,n) has m^(n−1)·n^(m−1) = 3^3·4^2 = 432 spanning trees.
More Algorithms questions
- 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…
- In how many ways can a longest strictly increasing subsequence be chosen (counting index sets, not distinct value sequences) from the…
- Randomised quicksort picks the pivot uniformly at random from the current sub-array and each partition of m elements uses exactly m−1…
- Bellman–Ford from source 0 on vertices 0..5 relaxes the directed edges (u→v, w) in this fixed order in every pass: 4→5 (1), 3→4 (1), 2→3…
- The recurrence T(n) = 2T(n/2) + n/log₂ n (with T(1) = 1) has the solution
- Top-down merge sort (split at ⌊n/2⌋, standard merge that stops comparing once one list is exhausted) sorts [38, 27, 43, 3, 9, 82, 10, 15…