pub struct BinaryTree<T>{
pub elem: Option<Box<T>>,
pub right: Option<Box<BinaryTree<T>>>,
pub left: Option<Box<BinaryTree<T>>>,
}
Fields§
§elem: Option<Box<T>>
§right: Option<Box<BinaryTree<T>>>
§left: Option<Box<BinaryTree<T>>>
Implementations§
Source§impl<T> BinaryTree<T>
impl<T> BinaryTree<T>
pub fn new(elem: T) -> BinaryTree<T>
pub fn delete(&mut self, del_elem: T) -> Option<T>
pub fn insert(&mut self, new_elem: T)
pub fn is_empty(&self) -> bool
pub fn contains(&self, search_elem: T) -> bool
pub fn clear(&mut self)
pub fn max(&self) -> Option<&T>
pub fn min(&self) -> Option<&T>
pub fn height(&self) -> usize
pub fn count(&self) -> usize
pub fn inorder(&self)
pub fn preorder(&self)
pub fn postorder(&self)
pub fn vec_insert(&mut self, elems: Vec<T>)
Auto Trait Implementations§
impl<T> Freeze for BinaryTree<T>
impl<T> RefUnwindSafe for BinaryTree<T>where
T: RefUnwindSafe,
impl<T> Send for BinaryTree<T>where
T: Send,
impl<T> Sync for BinaryTree<T>where
T: Sync,
impl<T> Unpin for BinaryTree<T>
impl<T> UnwindSafe for BinaryTree<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