[−][src]Trait rust_black_trees::tree::BaseTree
Associated Types
Loading content...Required methods
fn get(&self, val: usize) -> &Self::MNode
fn get_mut(&self, val: usize) -> &mut Self::MNode
fn delete_node(&mut self, index: usize)
fn create_node(&mut self, val: T) -> usize
fn rebalance_ins(&mut self, n: usize)
fn rebalance_del(&mut self, n: usize, child: usize)
fn delete_replace(&mut self, n: usize) -> usize
fn replace_node(&mut self, to_delete: usize, to_attach: Option<usize>)
fn attach_child(&self, p: usize, c: usize, side: Side)
fn get_root(&self) -> Option<usize>
fn set_root(&mut self, new_root: Option<usize>)
fn get_size(&self) -> usize
fn crement_size(&mut self, val: isize)
Implementors
impl<T> BaseTree<T> for AVLTree<T> where
T: PartialOrd,
T: PartialEq,
T: Debug,
[src]
T: PartialOrd,
T: PartialEq,
T: Debug,
type MNode = AVLNode<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> BaseTree<T> for RBTree<T> where
T: PartialOrd,
T: PartialEq,
T: Debug,
[src]
T: PartialOrd,
T: PartialEq,
T: Debug,
type MNode = ColorNode<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> 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