Trait nekolib::traits::DisjointSet
source · pub trait DisjointSet {
// Required methods
fn new(n: usize) -> Self;
fn len(&self) -> usize;
fn unite(&mut self, u: usize, v: usize) -> bool;
fn repr(&self, u: usize) -> usize;
fn count(&self, u: usize) -> usize;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn equiv(&self, u: usize, v: usize) -> bool { ... }
fn subset(&self, u: usize) -> Vec<usize> { ... }
fn partition(&self) -> Vec<Vec<usize>> { ... }
}
Expand description
共通要素を持たない集合族で、併合が可能なもの。