Module Disjoint Set Union (DSU)

Disjoint Set Union (DSU)

**Frequency: 6/10** A simple data structure.

Resources

- [CP Algorithms: Disjoint Set Union](https://cp-algorithms.com/data_structures/disjoint_set_union.html)

Problems

DSU 570 / 584 1000
Component sum 528 / 542 1000
Minimum spanning tree 504 / 512 1100
Parking 424 / 435 1100
Remove edge 392 / 401 1200
Yet another problem 322 / 337 1200
Assignment query on tree 264 / 287 1400
Watering 179 / 184 1500
Minimum spanning tree 2 213 / 258 1600
Fatal meal 188 / 208 1600
Statement 128 / 140 1700
All pairs 120 / 131 1800
Query on tree 102 / 126 1800
Bad Apple!! 16 / 20 1800
Minimum spanning tree 3 70 / 86 1900