Trait seg_tree::nodes::PersistentNode
source · [−]pub trait PersistentNode: Node {
fn left_child(&self) -> usize;
fn right_child(&self) -> usize;
fn set_children(&mut self, left: usize, right: usize);
}
Expand description
Required trait by nodes of persistent segment trees.
Required methods
fn left_child(&self) -> usize
fn left_child(&self) -> usize
Gives index of left child.
fn right_child(&self) -> usize
fn right_child(&self) -> usize
Gives index of right child.
fn set_children(&mut self, left: usize, right: usize)
fn set_children(&mut self, left: usize, right: usize)
Sets saved index of both left and right children.
Implementors
impl<T> PersistentNode for Min<T> where
T: Ord + Clone,
This is a pretty generic implementation of PersistentNode for a struct.
impl<T> PersistentNode for Sum<T> where
T: Add<Output = T> + Clone,
This is a pretty generic implementation of PersistentNode for a struct.