Weighted quick-union using additional array