Added a more optimized implementation of DisjointSets

q