Trait outils::tree::bst::OrderedTree
[−]
[src]
pub trait OrderedTree<Ix = DefaultIndexType> where
Ix: IndexType, { fn sub_predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn sub_successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn first(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn last(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>; fn is_smaller(&self, node_u: NodeIndex<Ix>, node_v: NodeIndex<Ix>) -> bool; }
This trait defines operations for navigating the binary tree with respect to its in-order.
Required Methods
fn sub_predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the biggest node of the left subtree of the tree node indexed by node
.
fn sub_successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the smallest node of the right subtree of the tree node indexed by node
.
fn predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the biggest node of the whole tree which is smaller than the tree node
indexed by node
.
fn successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the smallest node of the whole tree which is bigger than the tree node
indexed by node
.
fn first(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the smallest node of the left subtree of the tree node indexed by node
.
fn last(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the biggest node of the right subtree of the tree node indexed by node
.
fn is_smaller(&self, node_u: NodeIndex<Ix>, node_v: NodeIndex<Ix>) -> bool
Returns true
if the tree node indexed by node_u
is smaller than the tree node
indexed by node_v
. Otherwise, and in particular if one of the specified indices
is invalid, false
is returned.
Implementors
impl<K, V> OrderedTree for AaTree<K, V> where
K: KeyType,
V: ValueType,impl<K, V, W> OrderedTree for WeightedAaTree<K, V, W> where
K: KeyType,
V: ValueType,
W: WeightType,impl<V> OrderedTree for AaForest<V> where
V: ValueType,impl<V, W> OrderedTree for WeightedAaForest<V, W> where
V: ValueType,
W: WeightType,