[−][src]Struct rust_black_trees::unbalancetree::BSTree
Arena based memory tree structure
Trait Implementations
impl<T> BaseTree<T> for BSTree<T> where
T: PartialOrd,
T: PartialEq,
T: Debug,
[src]
T: PartialOrd,
T: PartialEq,
T: Debug,
type MNode = RegularNode<T>
fn get(&self, val: usize) -> &Self::MNode
[src]
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]. This allows us to do the same thing with less keystrokes. It does make the program not thread-safe, but a this data structure is a pretty terrible choice for a multi-threaded data structure anyways, since re-balancing can require that most of the tree be locked to one thread during an insertion or deletion
fn get_mut(&self, val: usize) -> &mut Self::MNode
[src]
fn get_root(&self) -> Option<usize>
[src]
fn set_root(&mut self, new_root: Option<usize>)
[src]
fn crement_size(&mut self, amount: isize)
[src]
fn attach_child(&self, p: usize, c: usize, side: Side)
[src]
fn rebalance_ins(&mut self, _n: usize)
[src]
fn rebalance_del(&mut self, _n: usize, _child: usize)
[src]
fn delete_replace(&mut self, n: usize) -> usize
[src]
fn replace_node(&mut self, to_delete: usize, to_attach: Option<usize>)
[src]
fn get_size(&self) -> usize
[src]
fn create_node(&mut self, val: T) -> usize
[src]
fn delete_node(&mut self, index: usize)
[src]
impl<T: Debug> Debug for BSTree<T>
[src]
impl<T> Tree<T> for BSTree<T> where
T: PartialOrd,
T: PartialEq,
T: Debug,
[src]
T: PartialOrd,
T: PartialEq,
T: Debug,
fn new() -> Self
[src]
fn contains(&self, val: &T) -> bool
[src]
fn insert(&mut self, val: T)
[src]
fn delete(&mut self, val: T) -> bool
[src]
fn rotate(&mut self, side: Side, n: usize)
[src]
fn find(&self, val: &T) -> usize
[src]
fn get_height(&self) -> usize
[src]
fn to_string(&self) -> String
[src]
fn to_pretty_string(&self) -> String
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for BSTree<T>
impl<T> !Send for BSTree<T>
impl<T> !Sync for BSTree<T>
impl<T> Unpin for BSTree<T>
impl<T> !UnwindSafe for BSTree<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,