pub struct IndexedSet<T: Ord> {
pub root: Option<Box<Node<T>>>,
/* private fields */
}Expand description
IndexedSet
- スプレー木のクラス
Fields§
§root: Option<Box<Node<T>>>Implementations§
Source§impl<T> IndexedSet<T>
impl<T> IndexedSet<T>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn contains_key(&mut self, key: &T) -> bool
pub fn contains_key(&mut self, key: &T) -> bool
contains_key
- 値
keyを含むか
Sourcepub fn lower_bound(&mut self, key: &T) -> Option<&T>
pub fn lower_bound(&mut self, key: &T) -> Option<&T>
lower_bound
key以上の最小の値を返す
Sourcepub fn upper_bound(&mut self, key: &T) -> Option<&T>
pub fn upper_bound(&mut self, key: &T) -> Option<&T>
upper_bound
keyより大きい最小の値を返す
Sourcepub fn lower_bound_rev(&mut self, key: &T) -> Option<&T>
pub fn lower_bound_rev(&mut self, key: &T) -> Option<&T>
lower_bound_rev
key以下の最大の値を返す
Sourcepub fn upper_bound_rev(&mut self, key: &T) -> Option<&T>
pub fn upper_bound_rev(&mut self, key: &T) -> Option<&T>
upper_bound_rev
key未満の最大の値を返す
Sourcepub fn get_by_index(&self, n: usize) -> Option<&T>
pub fn get_by_index(&self, n: usize) -> Option<&T>
get_by_index
- 先頭からn番目の値を取得する(0-indexed)
Source§impl<T: Ord> IndexedSet<T>
impl<T: Ord> IndexedSet<T>
pub fn iter(&self) -> SplayTreeIterator<'_, T> ⓘ
Trait Implementations§
Source§impl<T: Ord + Clone> FromIterator<T> for IndexedSet<T>
impl<T: Ord + Clone> FromIterator<T> for IndexedSet<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T: Ord> IntoIterator for &'a IndexedSet<T>
impl<'a, T: Ord> IntoIterator for &'a IndexedSet<T>
Auto Trait Implementations§
impl<T> Freeze for IndexedSet<T>
impl<T> RefUnwindSafe for IndexedSet<T>where
T: RefUnwindSafe,
impl<T> Send for IndexedSet<T>where
T: Send,
impl<T> Sync for IndexedSet<T>where
T: Sync,
impl<T> Unpin for IndexedSet<T>
impl<T> UnwindSafe for IndexedSet<T>where
T: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more