pub struct BinTree<T: PartialEq> { /* private fields */ }Expand description
The BinTree struct contains operations specific to binary trees.
NOTE: Requires the PartialEq trait bounds for binary tree operations
Implementations§
Trait Implementations§
Source§impl<T> BinaryTree<T> for BinTree<T>
impl<T> BinaryTree<T> for BinTree<T>
Source§impl<T> Tree<T> for BinTree<T>
impl<T> Tree<T> for BinTree<T>
Source§fn get<'a>(&'a self, node: &'a Self::Position) -> Option<&'a T>
fn get<'a>(&'a self, node: &'a Self::Position) -> Option<&'a T>
Returns an immutable reference to the node’s data
Source§fn parent(&self, node: Self::Position) -> Option<Self::Position>
fn parent(&self, node: Self::Position) -> Option<Self::Position>
Returns an immutable reference to the parent of the given node
Source§fn num_children(&self, node: Self::Position) -> Option<usize>
fn num_children(&self, node: Self::Position) -> Option<usize>
Returns the number of children for a given node
Source§fn children(&self, node: Self::Position) -> Option<Vec<Self::Position>>
fn children(&self, node: Self::Position) -> Option<Vec<Self::Position>>
Returns a collection of the node’s children
Source§fn is_leaf(&self, node: Self::Position) -> bool
fn is_leaf(&self, node: Self::Position) -> bool
Returns true if the provided node has no children
type Position = Box<Node<T>>
Auto Trait Implementations§
impl<T> Freeze for BinTree<T>
impl<T> RefUnwindSafe for BinTree<T>where
T: RefUnwindSafe,
impl<T> Send for BinTree<T>where
T: Send,
impl<T> Sync for BinTree<T>where
T: Sync,
impl<T> Unpin for BinTree<T>
impl<T> UnwindSafe for BinTree<T>where
T: UnwindSafe,
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