Featured
Kruskal's Algorithm
Build a minimum spanning tree by scanning edges from lightest to heaviest and keeping each one that does not close a cycle, checked with a union-find. Spanning forests, tie-breaking, and why the sort dominates the cost.
- Difficulty
- Medium
- Time
- O(E log E)
- Space
- O(V + E)
- Video
- Code in 4 languages
- Quiz · 10 questions