weighted-quick-union with halving-path-compression