GATE Computer ScienceEasyGATE CS (PYQ pattern)
How many spanning trees does K₅ minus one edge have (5 vertices, all pairs joined except one)?
- A. 50
- B. 64
- C. 100
- D. 75
Correct answer: D. 75
K₅ has 5³ = 125 spanning trees and each of its 10 edges appears in 125·4/10 = 50 of them. Removing one edge leaves 125 − 50 = 75 (brute force over all 4-edge subsets agrees). 50 is the number that contain the removed edge.
More Algorithms questions
- How many times does x++ execute? for (i = 1; i < 200; i = 2) for (j = i; j < 200; j += i) x++;
- The solution of the recurrence T(n) = 2T(n/2) + n/log n (with T(1) = 1, logs base 2) is:
- The solution of T(n) = 4T(n/2) + n² log n is:
- Matrices A1 to A6 have dimensions 5×40, 40×10, 10×30, 30×8, 8×25 and 25×6. The minimum number of scalar multiplications needed to compute…
- A text uses 8 symbols with frequencies 5, 9, 12, 13, 16, 45, 3 and 7. If a Huffman code is built, the total number of bits needed for the…
- A 0/1 knapsack has capacity 50 and items given as (value, weight): (60, 10), (100, 20), (120, 30), (75, 25). The maximum total value is: