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 641 / 653 1000
Component sum 587 / 601 1000
Minimum spanning tree 564 / 572 1100
Parking 479 / 490 1100
Remove edge 438 / 449 1200
Yet another problem 373 / 387 1200
Assignment query on tree 303 / 330 1400
Watering 222 / 227 1500
Minimum spanning tree 2 248 / 293 1600
Fatal meal 217 / 239 1600
Statement 149 / 161 1700
All pairs 151 / 160 1800
Query on tree 125 / 148 1800
Bad Apple!! 42 / 47 1800
Minimum spanning tree 3 85 / 101 1900