Trait Tree

Source
pub trait Tree<T: Debug>: BaseTree<T> {
    // Required method
    fn new() -> Self;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn contains(&self, val: &T) -> bool { ... }
    fn insert(&mut self, val: T) { ... }
    fn delete(&mut self, val: T) -> bool { ... }
    fn rotate(&mut self, side: Side, n: usize) { ... }
    fn find(&self, val: &T) -> usize { ... }
    fn get_height(&self) -> usize { ... }
    fn get_leaf_count(&self) -> usize { ... }
    fn to_string(&self) -> String { ... }
    fn to_pretty_string(&self) -> String { ... }
}

Required Methods§

Source

fn new() -> Self

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn contains(&self, val: &T) -> bool

Source

fn insert(&mut self, val: T)

Source

fn delete(&mut self, val: T) -> bool

Source

fn rotate(&mut self, side: Side, n: usize)

Source

fn find(&self, val: &T) -> usize

Source

fn get_height(&self) -> usize

Source

fn get_leaf_count(&self) -> usize

Source

fn to_string(&self) -> String

Source

fn to_pretty_string(&self) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Tree<T> for AVLTree<T>
where T: PartialOrd + PartialEq + Debug,

Source§

impl<T> Tree<T> for RBTree<T>
where T: PartialOrd + PartialEq + Debug,

Source§

impl<T> Tree<T> for BSTree<T>
where T: PartialOrd + PartialEq + Debug,