Kruskal's algorithm
medium'Would this edge close a cycle?' is exactly 'are these two vertices already connected?' - which is what Union-Find answers in near-constant time.
Worst
O(E log E)Space O(V)Loading the kruskal's algorithm engine…