Struct BinarySearchST

Source
pub struct BinarySearchST<K, V> { /* private fields */ }

Implementations§

Source§

impl<K: PartialOrd, V> BinarySearchST<K, V>

Source

pub fn new(capacity: usize) -> Self

use algorithms_fourth::search::binary_search::BinarySearchST;
let bst :BinarySearchST<usize,usize > = BinarySearchST::new(10);

Trait Implementations§

Source§

impl<K: PartialOrd, V> ST<K, V> for BinarySearchST<K, V>

Source§

fn put(&mut self, key: K, value: V)

Source§

fn get(&self, key: &K) -> Option<&V>

Source§

fn delete(&mut self, key: &K)

Source§

fn is_empty(&self) -> bool

Source§

fn size(&self) -> usize

Source§

fn min(&self) -> Option<&K>

Source§

fn max(&self) -> Option<&K>

Source§

fn floor(&self, key: &K) -> Option<&K>

小于等于该值的键中的最大值
Source§

fn ceiling(&self, key: &K) -> Option<&K>

大于等于该值的键中的最小值
Source§

fn rank(&self, key: &K) -> usize

小于key的键的数量
Source§

fn select(&self, k: usize) -> Option<&K>

从小到大排序,第k个位置的键值(从0开始)
Source§

fn contains(&self, key: &K) -> bool

Source§

fn delete_min(&mut self)

Source§

fn delete_max(&mut self)

Source§

fn size_in(&self, lo: &K, hi: &K) -> usize

Auto Trait Implementations§

§

impl<K, V> Freeze for BinarySearchST<K, V>

§

impl<K, V> RefUnwindSafe for BinarySearchST<K, V>

§

impl<K, V> Send for BinarySearchST<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for BinarySearchST<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for BinarySearchST<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for BinarySearchST<K, V>
where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.