Implemented the QuickUnionUF.java.