pub struct AVLNode<T> {
pub value: T,
pub ptr: usize,
pub parent: Option<usize>,
pub lchild: Option<usize>,
pub rchild: Option<usize>,
pub height: usize,
pub balance_factor: isize,
/* private fields */
}
Fields§
§value: T
§ptr: usize
§parent: Option<usize>
§lchild: Option<usize>
§rchild: Option<usize>
§height: usize
§balance_factor: isize
Trait Implementations§
Source§impl<T: Debug + PartialOrd> Node<T> for AVLNode<T>
impl<T: Debug + PartialOrd> Node<T> for AVLNode<T>
Source§fn get(&self, ptr: usize) -> &AVLNode<T>
fn get(&self, ptr: usize) -> &AVLNode<T>
In order to return a reference to a value of a vector contained within a refcell, a raw pointer is used. The unsafe code could be avoided by replacing each call to self.get(n) with &self.data.borrow()[n] and each call to self.get_mut(n) with &mut self.data.borrow()[n]
fn to_self_string(&self) -> String
fn to_self_string_display(&self) -> (String, usize)
fn get_value(&self) -> &T
fn is(&self, val: &T) -> bool
fn greater(&self, val: &T) -> bool
fn lesser(&self, val: &T) -> bool
fn get_mut(&self, ptr: usize) -> &mut AVLNode<T>
fn get_child(&self, side: Side) -> Option<usize>
fn set_child(&mut self, child: usize, side: Side)
fn set_child_opt(&mut self, c: Option<usize>, side: Side)
fn set_parent(&mut self, p: Option<usize>)
fn get_parent(&self) -> Option<usize>
fn location(&self) -> usize
fn to_string(&self) -> String
fn to_pretty_string(&self, indent: usize) -> String
fn get_height(&self) -> usize
fn get_depth(&self) -> usize
fn get_size(&self) -> usize
fn get_leaf_count(&self) -> usize
fn find_min(&self) -> usize
fn side(&self) -> Side
fn get_sibling(&self) -> Option<usize>
fn get_uncle(&self) -> Option<usize>
fn is_child(&self, side: Side) -> bool
Auto Trait Implementations§
impl<T> Freeze for AVLNode<T>where
T: Freeze,
impl<T> !RefUnwindSafe for AVLNode<T>
impl<T> !Send for AVLNode<T>
impl<T> !Sync for AVLNode<T>
impl<T> Unpin for AVLNode<T>where
T: Unpin,
impl<T> !UnwindSafe for AVLNode<T>
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