https://github.com/mgechev/javascript-algorithms/blob/master/src/graphs/searching/weightquickunion.js#L52 Currently the sizes of the specified nodes are being used. It should use the root node size. Will send a PR if I have a second