/// Creates a new UnionFind data structure with n elements
Creates a new UnionFind data structure with n elements
Creates a new UnionFind data structure with n elements
pub fn new(n: usize) -> Self {
        let mut id = vec![0; n];
        let mut size = vec![0; n];
        for i in 0..n {
            id[i] = i;
            size[i] = 1;
        }
        Self { id, size, count: n }
    }
pub fn new ( n : usize ) -> Self { let mut id = vec ! [ 0 n ] ; let mut size = vec ! [ 0 n ] ; for i in 0 .. n { id [ i ] = i ; size [ i ] = 1 ; } Self { id , size , count : n } }
Creates a new UnionFind data structure with n elements
Creates a new UnionFind data structure with n elements
n
usize