Kruskal builds the MST by sorting edges and adding them if they don’t create a cycle (usually with DSU/Union‑Find). Prim grows the MST from a start node using a priority queue of edges. Kruskal is often good for sparse graphs; Prim is convenient when you have adjacency lists.