Trait OrderedTree

Source
pub trait OrderedTree<Ix = DefaultIndexType>
where Ix: IndexType,
{ // Required methods 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; }
Expand description

This trait defines operations for navigating the binary tree with respect to its in-order.

Required Methods§

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn first(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>

Returns the smallest node of the left subtree of the tree node indexed by node.

Source

fn last(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>

Returns the biggest node of the right subtree of the tree node indexed by node.

Source

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§

Source§

impl<K, V> OrderedTree for AaTree<K, V>
where K: KeyType, V: ValueType,

Source§

impl<K, V, W> OrderedTree for WeightedAaTree<K, V, W>
where K: KeyType, V: ValueType, W: WeightType,

Source§

impl<V> OrderedTree for AaForest<V>
where V: ValueType,

Source§

impl<V, W> OrderedTree for WeightedAaForest<V, W>
where V: ValueType, W: WeightType,