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 927 / 942 1000
Component sum 861 / 873 1000
Minimum spanning tree 826 / 839 1100
Parking 721 / 734 1100
Remove edge 650 / 660 1200
Yet another problem 534 / 556 1200
Assignment query on tree 444 / 481 1400
Watering 359 / 365 1500
Minimum spanning tree 2 378 / 429 1600
Fatal meal 323 / 346 1600
Statement 227 / 244 1700
All pairs 222 / 232 1800
Query on tree 187 / 209 1800
Bad Apple!! 97 / 104 1800
Minimum spanning tree 3 119 / 138 1900