After union(A,B) and union(B,C), find(A) and find(C) identify the same component.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.
Disjoint-set union maintains groups under merge and connectivity-query operations using parent pointers. Experiment with a small example and see each step update.
After union(A,B) and union(B,C), find(A) and find(C) identify the same component.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.