weighted union-find set