emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[QZ6] Confusion on the tree graph of disjoint set #159

Closed BaichenRong closed 4 years ago

BaichenRong commented 4 years ago

I might be stupid but I really don't understand what it means in this graph. image Does that mean [3,1,0],[3,2] and[3,4] are 3 separated unions? Are we going to set up such a union by using find method only?

jdchoi77 commented 4 years ago

@BaichenRong according to the figure above, all keys end up being in the same set although how each key gets merged is different.