Weighted quick-union and wqu with path compression