Intermediate Data Structures & Algorithms
Q46 / 100

What is the difference between Prim's and Kruskal's algorithms?

Correct! Well done.

Incorrect.

The correct answer is B) Prim's grows the MST from a vertex; Kruskal's adds edges globally in non-decreasing weight order using Union-Find

B

Correct Answer

Prim's grows the MST from a vertex; Kruskal's adds edges globally in non-decreasing weight order using Union-Find

Explanation

Both find Minimum Spanning Trees. Prim's is vertex-based and faster for dense graphs. Kruskal's is edge-based and faster for sparse graphs using Union-Find.

Progress
46/100