Graphs hard time O(E log E) space O(V)
Minimum Spanning Tree (Kruskal)
Sort every edge by weight and walk the list cheapest-first. Take an edge if it joins two separate components; skip it if both ends are already connected, since that would make a cycle. After V-1 accepted edges everything is joined as cheaply as possible.
Sort every edge by weight, then walk the list from cheapest to dearest.
1 / 16
A fixed scene — scrub through it, or open the code.
Practice
Machine twin: /dsa-viz-v2/mst-kruskal.json — the full deterministic run as structured data.