[][src]Struct vebtrees::VEBTree

pub struct VEBTree { /* fields omitted */ }

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]

pub fn new(max_size: usize) -> Self[src]

Creates a new VEBTree with given max capacity.

Arguments

  • max_size: the maximum capacity with which to initialize the tree

Returns

  • A tree initialized to the maximum capacity specified

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]

Finds the immediate previous element currently in the array

Arguments

  • self: the instance of VEBTree to operate on
  • value: the value to find the predecessor of

Returns

  • The predecessor of 'value' or None if not found

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]