pub fn merge(&mut self, u: usize, v: usize) -> usize {
        let mut a = self.find_set(u);
        let mut b = self.find_set(v);
        if a == b {
            return std::usize::MAX;
        }
        if self.nodes[a].size < self.nodes[b].size {
            std::mem::swap(&mut a, &mut b);
        }
        self.nodes[b].parent = a;
        self.nodes[a].size += self.nodes[b].size;
        a
    }
// Returns the new component of the merged sets,
// or std::usize::MAX if they were the same.
Returns the new component of the merged sets,
or std::usize::MAX if they were the same.
Returns the new component of the merged sets or std :: usize :: MAX if they were the same .
pub fn merge(&mut self, u: usize, v: usize) -> usize {
        let mut a = self.find_set(u);
        let mut b = self.find_set(v);
        if a == b {
            return std::usize::MAX;
        }
        if self.nodes[a].size < self.nodes[b].size {
            std::mem::swap(&mut a, &mut b);
        }
        self.nodes[b].parent = a;
        self.nodes[a].size += self.nodes[b].size;
        a
    }
pub fn merge ( & mut self , u : usize , v : usize ) -> usize { let mut a = self . find_set ( u ) ; let mut b = self . find_set ( v ) ; if a == b { return std :: usize :: MAX ; } if self . nodes [ a ] . size < self . nodes [ b ] . size { std :: mem :: swap ( & mut a , & mut b ) ; } self . nodes [ b ] . parent = a ; self . nodes [ a ] . size += self . nodes [ b ] . size ; a }
Returns the new component of the merged sets,
or std::usize::MAX if they were the same.
Returns the new component of the merged sets or std :: usize :: MAX if they were the same .
&mut self
u
usize
v
usize
&mut self
u
usize
v
usize