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
共通要素を持たない集合族で、併合が可能なもの。
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.