implement weighted quick union

In this pull request
- Implement weighted quick union
@GingerBear i saw your code, but i think they are same