title: Weighted quick-union with path compression- Implementation
body: <p>I am implementing the quick union algorithm for a union/find structure. In the implementation given <strong><a href="http://algs4.cs.princeton.edu/15uf/WeightedQuickUnionPathCompressionUF.java.html" rel="nofollow">at the "Algorithms in Java" book site</a></strong>, the Princeton implementation fails to maintain the size invariant of tree while implementing path compression (in the <code>find()</code> method).  Shouldn't this adversely affect the algorithm?  or am I missing something?  Also, if I am right, how would we go about modifying the size array?</p>