Correctness
Theorem: Kruskal’s algorithm outputs an MST
that at all times T is a subset of an MST F.
Let e be the next edge chosen by Kruskal.
Claim that T U{e} is a subset of an MST.
If e not in F, let e’ in F connect two components of T.
Then F - {e’} + {e} is an MST.