GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Borůvka's algorithm is run on the graph with edges (weights) 0-1 (7), 0-3 (5), 1-2 (8), 1-3 (9), 1-4 (10), 2-4 (6), 3-4 (15), 3-5 (11), 4-5 (12), 4-6 (13), 5-6 (14). In the first phase every vertex picks its cheapest incident edge. How many distinct edges are selected in that phase?
- A. 7
- B. 6
- C. 4
- D. 5
Correct answer: D. 5
The picks are 0 → 0-3 (5), 1 → 0-1 (7), 2 → 2-4 (6), 3 → 0-3 (5), 4 → 2-4 (6), 5 → 3-5 (11), 6 → 4-6 (13). Duplicates collapse the seven picks into 5 distinct edges, leaving two components that the second phase joins with edge 1-2 (8); the MST weight is 50.
More Algorithms questions
- A weighted undirected graph on vertices 0–6 has edges (weight) 0-1 7, 0-3 5, 1-2 8, 1-3 9, 1-4 10, 2-4 6, 3-4 15, 3-5 11, 4-5 12, 4-6 13…
- How many satisfying assignments does the formula (x₁ ∨ x₂) ∧ (¬x₁ ∨ x₃) ∧ (¬x₂ ∨ ¬x₃) ∧ (x₂ ∨ x₄) ∧ (¬x₄ ∨ x₃) ∧ (x₁ ∨ ¬x₄) have over the…
- A topological order of the DAG with edges A→B, A→C, B→D, C→D, C→E, D→F, E→F, E→G, G→F, H→C, H→G is produced by running DFS (roots in…
- A directed graph has edges s→a, s→b, s→c, s→d, a→m, b→m, c→m, m→p, m→q, m→r, p→t, q→t, r→t, d→t. Let E be the maximum number of…
- Men m0–m3 and women w0–w3 have the preference lists (best first) m0: w2 w0 w1 w3; m1: w0 w1 w3 w2; m2: w1 w2 w0 w3; m3: w2 w3 w1 w0; w0…
- Union by rank without path compression is performed (ties: the root of the second argument is attached below the root of the first) on…