pub struct VEBTree { /* private fields */ }
Expand description
The van Emde Boas tree itself.
Implementations§
Source§impl VEBTree
impl VEBTree
Sourcepub fn new(max_elem: i64) -> Result<Self, &'static str>
pub fn new(max_elem: i64) -> Result<Self, &'static str>
Generates a new van Emde Boas tree. Will return an error if the input is less than 1 or greater than the max value of an isize.
Sourcepub fn minimum(&self) -> Option<i64>
pub fn minimum(&self) -> Option<i64>
Returns the lowest value stored in the tree, or None if it’s empty. Takes constant time.
Sourcepub fn maximum(&self) -> Option<i64>
pub fn maximum(&self) -> Option<i64>
Returns the highest value stored in the tree, or None if it’s empty. Takes constant time.
Sourcepub fn universe(&self) -> i64
pub fn universe(&self) -> i64
Returns the maximum value it’s possible to store in the tree. Takes constant time.
Sourcepub fn has(&self, x: i64) -> bool
pub fn has(&self, x: i64) -> bool
Returns true if this van Emde Boas tree contains the specified value. Takes O(log(log(U))) time, where U is the argument to the constructor.
Sourcepub fn find_next(&self, x: i64) -> Option<i64>
pub fn find_next(&self, x: i64) -> Option<i64>
Finds the next highest value in this van Emde Boas tree, or None if it doesn’t exit. Takes O(log(log(U))) time, where U is the argument to the constructor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VEBTree
impl RefUnwindSafe for VEBTree
impl Send for VEBTree
impl Sync for VEBTree
impl Unpin for VEBTree
impl UnwindSafe for VEBTree
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