Kruskal's Algorithm
Kruskal sorts edges by weight and adds an edge when it joins two different components. A union-find structure rejects edges that would close a cycle.
Costs
| Category | Algorithm |
| Difficulty | Hard |
| Time | O(E log E) |
| Result | a minimum spanning tree, or forest |
| Needs | an undirected weighted graph |
Questions
What is Kruskal's Algorithm?
Kruskal sorts edges by weight and adds an edge when it joins two different components. A union-find structure rejects edges that would close a cycle.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.