Objective
Master the Union-Find data structure from the RisingBrain DSA sheet.
References
Pattern Description
Disjoint Set Union (DSU). Two operations: find(x) returns root of x's component, union(x, y) merges two components. With path compression and union by rank, both run near O(1) amortized.
Sub-issues
| # |
Problem |
Difficulty |
| 1 |
Number of Connected Components in Graph |
Medium |
| 2 |
Redundant Connection |
Medium |
| 3 |
Accounts Merge |
Medium |
Notes
Language: Java
Objective
Master the Union-Find data structure from the RisingBrain DSA sheet.
References
Pattern Description
Disjoint Set Union (DSU). Two operations: find(x) returns root of x's component, union(x, y) merges two components. With path compression and union by rank, both run near O(1) amortized.
Sub-issues
Notes
Language: Java