Trait BinaryTree

Source
pub trait BinaryTree<T>
where T: Clone + PartialEq,
{ type Position; // Required methods fn left(&self, node: Self::Position) -> Option<Self::Position>; fn right(&self, node: Self::Position) -> Option<Self::Position>; fn sibling(&self, node: Self::Position) -> Option<Self::Position>; }
Expand description

Abstract interface definition for a binary tree type

Required Associated Types§

Required Methods§

Source

fn left(&self, node: Self::Position) -> Option<Self::Position>

Returns the position of the left child of a given node

Source

fn right(&self, node: Self::Position) -> Option<Self::Position>

Returns the position of the right child of a given node

Source

fn sibling(&self, node: Self::Position) -> Option<Self::Position>

Returns the position of the sibling of a given node

Implementors§

Source§

impl<T> BinaryTree<T> for BinTree<T>
where T: Clone + PartialEq,