The following two arrays are used to implement disjoint set data structure . arr [ ] holds the parent nodes while rank array holds the rank of subset
int [ ] arr = new int [ n ] ; int [ ] rank = new int [ n ] ;