Solution (source code)

= Solution

Test \b[`Find-Set(u) == Find-Set(v)`]. Initially the sets are singleton <connected components> of the edgeless graph; processing an edge joins precisely the components it connects. By <induction> over the processed edges, the final sets are exactly the <connected components> of $G$.