Class to represent Disjoint Set Data structure
class DisjointUnionSets { int [ ] rank , parent ; int n ; public DisjointUnionSets ( int n ) { rank = new int [ n ] ; parent = new int [ n ] ; this . n = n ; makeSet ( ) ; } public void makeSet ( ) {