Update the rank
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 else : NEW_LINE INDENT parent [ a ] = b NEW_LINE DEDENT