JavaLab2/src/lab2/model/DisjointSet.java
public Integer find(Integer n){
        if(parents.get(n) != n)
            parents.set(n, find(parents.get(n)));
        return parents.get(n);
    }
//finds the subset to witch n-element belongs. O(log n)
finds the subset to witch n-element belongs.
finds the subset to witch n - element belongs .
public Integer find(Integer n){
        if(parents.get(n) != n)
            parents.set(n, find(parents.get(n)));
        return parents.get(n);
    }
public Integer find ( Integer n ) { if ( parents . get ( n ) != n ) parents . set ( n , find ( parents . get ( n ) ) ) ; return parents . get ( n ) ; }
finds the subset to witch n-element belongs.
finds the subset to witch n - element belongs .