src/test/java/edu/neu/coe/info6205/union_find/Alternative2.java
private int doPathHalving(int i) {
        while(i != parent[i]) {
            parent[i] = parent[parent[i]];    // update parent to grandparent =>  path compression
            i = parent[i];                    // Finding the next node
        }
        return i;
    }
/**
     * This implements the single-pass path-halving mechanism of path compression
     */
This implements the single-pass path-halving mechanism of path compression
This implements the single - pass path - halving mechanism of path compression
private int doPathHalving(int i) {
        while(i != parent[i]) {
            parent[i] = parent[parent[i]];    
            i = parent[i];                    
        }
        return i;
    }
private int doPathHalving ( int i ) { while ( i != parent [ i ] ) { parent [ i ] = parent [ parent [ i ] ] ; i = parent [ i ] ; } return i ; }
This implements the single-pass path-halving mechanism of path compression
This implements the single - pass path - halving mechanism of path compression
// update parent to grandparent =>  path compression // Finding the next node