Kruskal vs Prim
Kruskal is edge-centric: it globally sorts edges and builds multiple components that eventually merge into an MST. Prim is vertex/tree-centric: it grows one tree outward from a starting vertex. Kruskal is especially natural for edge lists and sparse graphs, while Prim is often convenient with adjacency structures and dense graphs.
Kruskal uses Union-Find.
Prim typically uses a priority queue.
Kruskal complexity: O(E log E).
Prim with binary heap: O(E log V).
Both produce an MST for a connected weighted undirected graph.