pub struct AVLTree<T> {
pub root: Pointer,
/* private fields */
}
Fields§
§root: Pointer
Implementations§
Source§impl<T: PartialOrd + Copy + Debug> AVLTree<T>
impl<T: PartialOrd + Copy + Debug> AVLTree<T>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn get_height(&self) -> u32
pub fn get_balance_factor(&self, node: Pointer) -> i32
pub fn get_height_from_node(&self, node: Pointer) -> u32
pub fn insert(&mut self, val: T)
pub fn insert_below_node(&mut self, val: T, node: Pointer)
pub fn left_rotate(&mut self, current: Pointer)
pub fn right_rotate(&mut self, current: Pointer)
pub fn rebalance(&mut self, node: Pointer)
pub fn get_node(&self, val: T) -> Pointer
pub fn get_node_from_node(&self, node: Pointer, val: T) -> Pointer
pub fn delete(&mut self, val: T)
pub fn count_leaf_nodes(&self) -> u32
pub fn count_leaf_nodes_from_node(&self, node: Pointer) -> u32
pub fn print_in_order_traversal(&self)
pub fn min_of_right(&self, head: Pointer) -> Pointer
Trait Implementations§
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>where
T: Unpin,
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