pub struct MaxAugmentation;Expand description
Augmentation that tracks the maximum value in each subtree.
Useful for segment-tree-style range-max queries.
§Examples
use augmented_rbtree::{AugmentedRBTree, augmentations::MaxAugmentation};
let mut tree = AugmentedRBTree::<i32, i32, MaxAugmentation>::new();
tree.insert(1, 5);
tree.insert(2, 12);
tree.insert(3, 3);
assert_eq!(tree.root_stats(), Some(&Some(12)));Trait Implementations§
Source§impl<K, V> Augment<K, V> for MaxAugmentation
impl<K, V> Augment<K, V> for MaxAugmentation
Auto Trait Implementations§
impl Freeze for MaxAugmentation
impl RefUnwindSafe for MaxAugmentation
impl Send for MaxAugmentation
impl Sync for MaxAugmentation
impl Unpin for MaxAugmentation
impl UnsafeUnpin for MaxAugmentation
impl UnwindSafe for MaxAugmentation
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