Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Kruskal's algorithm builds the MST by

Kruskal's algorithm builds the MST by

Astarting at any vertex and growing one tree by the cheapest crossing edge
Brunning DFS twice on the graph
Csorting edges by weight ascending and adding each that doesn't create a cycle
Drunning Dijkstra from every vertex
Answer & Solution
Correct answer: C. sorting edges by weight ascending and adding each that doesn't create a cycle
Kruskal's strategy: sort the edge list, scan ascending, add each edge unless it closes a cycle with edges already accepted. Stop when |V| − 1 edges are picked. Starting at one vertex and growing one tree is Prim's strategy. Dijkstra solves shortest paths, not MST. Two DFS calls don't yield an MST.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions