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 683 / 695 1000
Component sum 628 / 642 1000
Minimum spanning tree 599 / 606 1100
Parking 517 / 527 1100
Remove edge 469 / 481 1200
Yet another problem 397 / 414 1200
Assignment query on tree 324 / 354 1400
Watering 243 / 249 1500
Minimum spanning tree 2 265 / 309 1600
Fatal meal 234 / 255 1600
Statement 164 / 176 1700
All pairs 169 / 178 1800
Query on tree 134 / 157 1800
Bad Apple!! 53 / 58 1800
Minimum spanning tree 3 96 / 113 1900