Skip to content

Commit b86247a

Browse files
authored
Update disjoint_set_union.md
1 parent 6baac9a commit b86247a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/data_structures/disjoint_set_union.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ for (int i = m-1; i >= 0; i--) {
314314
}
315315
```
316316

317-
There is one optimization:
318-
We can use **union by rank**, if we store the next unpainted cell in an additional array `end[]`.
319-
Then we can merge two sets into one ranked according to their heuristics, and we obtain the solution in $O(\alpha(n))$.
317+
There is an optimization:
318+
We can use union by rank / size, if we store the next unpainted cell in an additional array `end[]`.
319+
Then we can merge two sets into one according to their heuristics, and we obtain the solution in $O(\alpha(n))$.
320320

321321
### Support distances up to representative
322322

0 commit comments

Comments
 (0)