FUnction to perform union operation of disjoint set union
void Union ( vector < int > & parent , vector < int > & rank , vector < int > & minVal , int a , int b ) { a = Find ( parent , a ) ; b = Find ( parent , b ) ; if ( rank [ a ] == rank [ b ] ) rank [ a ] ++ ; if ( rank [ a ] > rank [ b ] ) { parent [ b ] = a ;