[][src]Struct competitive_hpp::union_find::UnionFind

pub struct UnionFind { /* fields omitted */ }

UnionFind

Example:

use competitive_hpp::union_find::UnionFind;

let mut uf = UnionFind::new(5);
uf.union(0, 1);
uf.union(2, 3);
uf.union(1, 4);

uf.find(1); // 0
uf.is_same(0, 1); // true
uf.group_size(0); // 3

Methods

impl UnionFind[src]

pub fn new(n: usize) -> Self[src]

pub fn find(&mut self, x: usize) -> usize[src]

pub fn union(&mut self, x: usize, y: usize)[src]

pub fn is_same(&mut self, x: usize, y: usize) -> bool[src]

pub fn group_size(&mut self, x: usize) -> usize[src]

Trait Implementations

impl Clone for UnionFind[src]

impl Debug for UnionFind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.