FUnction to perform union operation of disjoint set union
def Union ( parent , rank , minVal , a , b ) : NEW_LINE INDENT a = Find ( parent , a ) NEW_LINE b = Find ( parent , b ) NEW_LINE if ( rank [ a ] == rank [ b ] ) : NEW_LINE INDENT rank [ a ] += 1 NEW_LINE DEDENT if ( rank [ a ] > rank [ b ] ) : NEW_LINE INDENT parent [ b ] = a NEW_LINE DEDENT DEDENT