pub struct UnionFind<T>{ /* private fields */ }
Implementations§
Source§impl<T> UnionFind<T>
impl<T> UnionFind<T>
pub fn new() -> Self
pub fn from_iter<I>(iter: I) -> UnionFind<T>where
I: IntoIterator<Item = T>,
pub fn len(&self) -> usize
pub fn union_count(&self) -> usize
pub fn union_size(&mut self, p: T) -> Option<usize>
pub fn find(&mut self, p: T) -> Option<&T>
pub fn union(&mut self, p: T, q: T) -> Result<usize, String>
pub fn is_connected(&mut self, p: T, q: T) -> Result<bool, String>
pub fn add(&mut self, p: T)
Auto Trait Implementations§
impl<T> Freeze for UnionFind<T>
impl<T> RefUnwindSafe for UnionFind<T>where
T: RefUnwindSafe,
impl<T> Send for UnionFind<T>where
T: Send,
impl<T> Sync for UnionFind<T>where
T: Sync,
impl<T> Unpin for UnionFind<T>where
T: Unpin,
impl<T> UnwindSafe for UnionFind<T>where
T: UnwindSafe,
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