[−][src]Struct vebtrees::VEBTree
An implementation of Van Emde Boas Trees in Rust
Fields
- children: Vec
- the child VEBTrees of this tree - aux: Vec
- a single element Vec that holds to aux tree uses a Vec wrapper to allocate it on the heap without hardcore mutable reference nonsense. - max: Option
- The maximum of the currently stored elements, none if there are no stored elements, equal to min if there is only one element - min: Option
- The minimum of the currently stored elements, none if there are no stored elements, equal to max if there is only one element
Methods
impl VEBTree
[src]
impl VEBTree
[src]
pub fn contains(&self, value: usize) -> bool
[src]
Returns whether or not the given element is in the tree
Arguments
- self: the instance of the VEBTree
- value: the value for which to check membership
Returns
- Whether or not the value is contained in the tree
pub fn search(&self, value: usize) -> Option<usize>
[src]
Searches the tree for the given value and returns the value if it is in the tree, None if not.
Arguments
- self: the instance of the VEBTree to operate on
- value: the value to search for in the tree
Returns
- The value being searched for or None if the value is not in the tree.
pub fn insert(&mut self, value: usize)
[src]
Insert a value into the array, does nothing if the value is already present.
Arguments
- self: the instance of the VEBTree to operate on
- value: the value to insert into the tree
pub fn delete(&mut self, value: usize)
[src]
Deletes an element from the VEBTree
Arguments
- self: the instance of the VEBTree to operate on
- value: the value to delete from the tree
pub fn minimum(&self) -> Option<usize>
[src]
Gets the minimum of the currently stored elements
Arguments
- self: the instance of VEBTree to operate on
Returns
- The minimum element currently stored in the tree
pub fn maximum(&self) -> Option<usize>
[src]
Gets the maximum of the currently stored elements
Arguments
- self: &Self - the instance of VEBTree to operate on.
Returns
- The maximum element currently stored in the tree
pub fn findnext(&self, value: usize) -> Option<usize>
[src]
Finds the next consecutive element currently in the tree
Arguments
- self: the instance of VEBTree to operate on.
- value: the value to find the successor of.
Returns
- The successor of 'value' or None if not found
pub fn findprev(&self, value: usize) -> Option<usize>
[src]
Trait Implementations
impl Eq for VEBTree
[src]
impl Clone for VEBTree
[src]
impl PartialEq<VEBTree> for VEBTree
[src]
impl Debug for VEBTree
[src]
Auto Trait Implementations
impl Send for VEBTree
impl Unpin for VEBTree
impl Sync for VEBTree
impl UnwindSafe for VEBTree
impl RefUnwindSafe for VEBTree
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,