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§
Sourcefn sub_predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
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
.
Sourcefn sub_successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
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
.
Sourcefn predecessor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
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
.
Sourcefn successor(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
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
.
Sourcefn first(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
fn first(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the smallest node of the left subtree of the tree node indexed by node
.
Sourcefn last(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
fn last(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>
Returns the biggest node of the right subtree of the tree node indexed by node
.
Sourcefn is_smaller(&self, node_u: NodeIndex<Ix>, node_v: NodeIndex<Ix>) -> bool
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.