Disjoint set implementation just for review.