Struct i_tree::tree::Tree

source ·
pub struct Tree<T> {
    pub store: Store<T>,
    pub root: u32,
    /* private fields */
}

Fields§

§store: Store<T>§root: u32

Implementations§

source§

impl<T: Clone + PartialEq + Eq + PartialOrd + Ord> Tree<T>

source

pub fn is_empty(&self) -> bool

source

pub fn new(empty: T, capacity: usize) -> Self

source

pub fn clear_all(&mut self)

source

pub fn is_black(&self, index: u32) -> bool

source

pub fn node(&self, index: u32) -> &Node<T>

source

pub fn mut_node(&mut self, index: u32) -> &mut Node<T>

source

pub fn insert(&mut self, value: T)

source

pub fn fix_red_black_properties_after_insert( &mut self, n_index: u32, p_origin: u32 )

source

pub fn delete(&mut self, value: T)

source

pub fn delete_if_exist(&mut self, value: T)

source

pub fn delete_index(&mut self, index: u32) -> u32

source

pub fn find(&self, value: T) -> Option<T>

source

pub fn height(&self) -> usize

Trait Implementations§

source§

impl<T: Clone + PartialEq + Eq + PartialOrd + Ord> Array<T> for Tree<T>

source§

fn ordered_list(&self) -> Vec<T>

source§

fn fill_ordered_list(&self, list: &mut Vec<T>)

source§

fn fill_ordered_list_with_stack( &self, list: &mut Vec<T>, stack: &mut Vec<StackNode> )

Auto Trait Implementations§

§

impl<T> Freeze for Tree<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Tree<T>
where T: RefUnwindSafe,

§

impl<T> Send for Tree<T>
where T: Send,

§

impl<T> Sync for Tree<T>
where T: Sync,

§

impl<T> Unpin for Tree<T>
where T: Unpin,

§

impl<T> UnwindSafe for Tree<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.