Kruskal's MST
Recognize the pattern
Brute force idea
The naive version of Kruskal's MST sounds like this: Try all possible edge subsets that form a spanning tree — exponential. That direct path helps you understand the question, but it tends to treat every possibility as brand new instead of learning from earlier steps.
Better approach
The real unlock in Kruskal's MST comes when you notice this: Kruskal's: sort all edges by weight. Process edges cheapest first — add an edge if it connects two different components (Union-Find check). Stop after V-1 edges. Instead of recomputing the world every time, you preserve just enough context to let the next decision become obvious.
Key invariant
The compass for Kruskal's MST is this: The cheapest edge that connects two different components is always safe to add to the MST (cut property). Union-Find efficiently checks and merges components. As long as that statement keeps holding, you can trust the steps built on top of it.
Watch out for
A common way to get lost in Kruskal's MST is this: Not stopping after V-1 edges — a spanning tree of V vertices has exactly V-1 edges. Processing more is wasted work. Most mistakes here are not about syntax; they come from losing track of what your state, pointer, or structure is supposed to mean.