diff --git a/Union_Find.py b/Union_Find.py index d06131d..a13405f 100644 --- a/Union_Find.py +++ b/Union_Find.py @@ -24,7 +24,7 @@ def union(parent, rank, x, y): elif rank[xroot] > rank[yroot]: parent[yroot] = xroot else: - parent[xroot] = yroot + parent[xroot] = yroot # if same then select any one of them as parent and increment its rank by 1 rank[yroot] += 1