pub struct UnionFind(/* private fields */);
Implementations§
source§impl UnionFind
impl UnionFind
pub fn new(n: usize) -> UnionFind
pub fn unite(&mut self, u: usize, v: usize) -> bool
pub fn equiv(&self, u: usize, v: usize) -> bool
pub fn repr(&self, u: usize) -> usize
pub fn count(&self, u: usize) -> usize
pub fn partition(&self) -> Vec<Vec<usize>>
pub fn partition_len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UnionFind
impl !RefUnwindSafe for UnionFind
impl Send for UnionFind
impl !Sync for UnionFind
impl Unpin for UnionFind
impl UnwindSafe for UnionFind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)