Algorithm

added disjoint set datastructure