Weighted Quick Union - Union Find implementation.