Function to perform the find operation to find the parent of a disjoint set
def Find ( parent , a ) : NEW_LINE INDENT if parent [ a ] == a : NEW_LINE INDENT parent [ a ] = a NEW_LINE return parent [ a ] NEW_LINE DEDENT else : NEW_LINE INDENT parent [ a ] = Find ( parent , parent [ a ] ) NEW_LINE return parent [ a ] NEW_LINE DEDENT DEDENT