A function that does union of two sets of x and y ( uses union by rank )
static void unionSet ( subset [ ] subsets , int x , int y ) { int xroot = findSet ( subsets , x ) ; int yroot = findSet ( subsets , y ) ;