pub struct IntervalMaxEnd;Expand description
Augmentation for interval trees: tracks the maximum interval endpoint in each subtree.
When keys are interval start points and values are interval end points, this augmentation
allows efficient overlap queries: if root_stats() < query_start, no interval overlaps.
§Examples
use augmented_rbtree::{AugmentedRBTree, augmentations::IntervalMaxEnd};
// Key = interval start, Value = interval end
let mut tree = AugmentedRBTree::<i32, i32, IntervalMaxEnd>::new();
tree.insert(1, 5); // interval [1, 5]
tree.insert(3, 10); // interval [3, 10]
tree.insert(8, 12); // interval [8, 12]
// Max endpoint in the whole tree
assert_eq!(tree.root_stats(), Some(&Some(12)));Trait Implementations§
Source§impl<K> Augment<K, K> for IntervalMaxEnd
impl<K> Augment<K, K> for IntervalMaxEnd
Auto Trait Implementations§
impl Freeze for IntervalMaxEnd
impl RefUnwindSafe for IntervalMaxEnd
impl Send for IntervalMaxEnd
impl Sync for IntervalMaxEnd
impl Unpin for IntervalMaxEnd
impl UnsafeUnpin for IntervalMaxEnd
impl UnwindSafe for IntervalMaxEnd
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