williamfiset / Algorithms

A collection of algorithms and data structures
MIT License
17.18k stars 4.34k forks source link

Recently merged PR's bug fix in UnionFind #276

Closed berkelmas closed 3 years ago

berkelmas commented 3 years ago

Accidentally in this PR, I have make id[root] = 0 instead of making sz[root] = 0. In this PR, I am fixing that by changing the modified array as sz.

williamfiset commented 3 years ago

The ids of the roots were swapped in the PR, actually fixed in a6e72cd6c1c7e5a4fde916c4140d6d2b4076762e. Thanks again for pointing this out I will try and be more careful in upcoming PRs so that this doesn't happen.

berkelmas commented 3 years ago

Sure. You're welcome