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 557 / 570 1000
Component sum 516 / 530 1000
Minimum spanning tree 492 / 500 1100
Parking 419 / 429 1100
Remove edge 390 / 399 1200
Yet another problem 319 / 334 1200
Assignment query on tree 260 / 283 1400
Watering 173 / 178 1500
Minimum spanning tree 2 207 / 247 1600
Fatal meal 179 / 199 1600
Statement 122 / 132 1700
All pairs 116 / 127 1800
Query on tree 99 / 122 1800
Minimum spanning tree 3 66 / 82 1900