pub struct AvlTree<T: Ord + Debug + PartialEq + Eq + Clone> { /* private fields */ }
Implementations§
Source§impl<T: Ord + Debug + PartialEq + Eq + Clone> AvlTree<T>
impl<T: Ord + Debug + PartialEq + Eq + Clone> AvlTree<T>
pub fn new() -> Self
pub fn height(&self) -> Option<i32>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, value: &T) -> bool
Sourcepub fn insert(&mut self, value: T) -> bool
pub fn insert(&mut self, value: T) -> bool
If the value is not found in the AVL tree, insert it and return true
.
Otherwise, do not insert and return false
.
pub fn remove(&mut self, elem: &T) -> bool
pub fn iter(&self) -> AvlIter<'_, T> ⓘ
Trait Implementations§
impl<T: Eq + Ord + Debug + PartialEq + Eq + Clone> Eq for AvlTree<T>
impl<T: Ord + Debug + PartialEq + Eq + Clone> StructuralPartialEq for AvlTree<T>
Auto Trait Implementations§
impl<T> Freeze for AvlTree<T>
impl<T> RefUnwindSafe for AvlTree<T>where
T: RefUnwindSafe,
impl<T> Send for AvlTree<T>where
T: Send,
impl<T> Sync for AvlTree<T>where
T: Sync,
impl<T> Unpin for AvlTree<T>
impl<T> UnwindSafe for AvlTree<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.