pub struct CartesianTree<'a, T: Ord> { /* private fields */ }
Expand description
A cartesian tree is a heap ordered binary tree derived from some underlying array. An in-order traversal of the tree yields the underlying array.
Implementations§
Source§impl<'a, T: Ord> CartesianTree<'a, T>
impl<'a, T: Ord> CartesianTree<'a, T>
pub fn in_order_traversal(&self) -> Vec<&T>
Sourcepub fn cartesian_tree_number(&self) -> u64
pub fn cartesian_tree_number(&self) -> u64
Calculates the cartesian tree number of this tree
using the sequence of push
and pop
operations
stored in the action_profile
. Note that calculating this
value only makes sense when the underlying array is small.
More specifically, this procedure assumes that the underlying
array has at most 32 items. This makes sense in our context
since we’re mostly interested in the cartesian tree numbers
of RMQ blocks
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for CartesianTree<'a, T>
impl<'a, T> RefUnwindSafe for CartesianTree<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for CartesianTree<'a, T>where
T: Sync,
impl<'a, T> Sync for CartesianTree<'a, T>where
T: Sync,
impl<'a, T> Unpin for CartesianTree<'a, T>
impl<'a, T> UnwindSafe for CartesianTree<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more