Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Prim's algorithm grows the MST by

Prim's algorithm grows the MST by

Asorting all edges and skipping those that close cycles
Bstart at a source, add the lightest edge out of the tree each step
Crunning breadth-first search from every vertex
Drunning Dijkstra and taking the path edges
Answer & Solution
Correct answer: B. start at a source, add the lightest edge out of the tree each step
Prim starts at one vertex and grows a single tree, always picking the lightest edge that crosses from inside to outside. Repeats |V| − 1 times. Sorting all edges first is Kruskal's strategy. BFS doesn't pick edges by weight. Dijkstra finds shortest paths (sum-of-edges), not MST.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions