Weighted quick-union with halving