Quick Find - Lazy Approach

Quick Union - Lazy Approach

Integer array id[] of length N.

Interpretation: id[i] is parent of i.

Root of i is id[id[id[...id[i]...]]].

Afterunion(3,5)

Java Implementation

Last updated

Was this helpful?