pub struct BalancedBinaryTree<K: Ord, M: ActedMonoid> { /* private fields */ }Expand description
平衡二分木
Implementations§
Source§impl<K: Ord + Clone, M: ActedMonoid> BalancedBinaryTree<K, M>
impl<K: Ord + Clone, M: ActedMonoid> BalancedBinaryTree<K, M>
Sourcepub fn insert_lower(&mut self, key: K, val: M::Val)
pub fn insert_lower(&mut self, key: K, val: M::Val)
key, val を挿入する(lowerbound 版)
- 既存の同一 key は右側(>=)に送るので,新要素は「同一 key の先頭」に入る
Sourcepub fn insert_upper(&mut self, key: K, val: M::Val)
pub fn insert_upper(&mut self, key: K, val: M::Val)
key, val を挿入する(upperbound 版)
- 既存の同一 key は左側(<=)に送るので,新要素は「同一 key の末尾」に入る
Sourcepub fn insert_unique(&mut self, key: K, val: M::Val) -> bool
pub fn insert_unique(&mut self, key: K, val: M::Val) -> bool
key がまだ存在しないときだけ (key, val) を挿入する
- 返り値: 挿入できたら true, 既に存在していたら false
Sourcepub fn get_range<R: RangeBounds<K> + Debug>(&mut self, range: R) -> M::Val
pub fn get_range<R: RangeBounds<K> + Debug>(&mut self, range: R) -> M::Val
区間(key の範囲)の集約値を返す
Sourcepub fn apply<R: RangeBounds<K> + Debug>(&mut self, range: R, act: M::Act)
pub fn apply<R: RangeBounds<K> + Debug>(&mut self, range: R, act: M::Act)
区間(key の範囲)に作用を適用する
Trait Implementations§
Source§impl<K: Ord, M: ActedMonoid> Default for BalancedBinaryTree<K, M>
impl<K: Ord, M: ActedMonoid> Default for BalancedBinaryTree<K, M>
Source§impl<K, M> ShowBinaryTree<Ptr> for BalancedBinaryTree<K, M>
impl<K, M> ShowBinaryTree<Ptr> for BalancedBinaryTree<K, M>
Source§fn print_node(&self, ptr: &Ptr) -> String
fn print_node(&self, ptr: &Ptr) -> String
<required> ノードの値を表示する
Source§fn print_as_binary_tree(&self)
fn print_as_binary_tree(&self)
2分木としてフォーマットする
Auto Trait Implementations§
impl<K, M> Freeze for BalancedBinaryTree<K, M>
impl<K, M> RefUnwindSafe for BalancedBinaryTree<K, M>where
K: RefUnwindSafe,
<M as ActedMonoid>::Val: RefUnwindSafe,
<M as ActedMonoid>::Act: RefUnwindSafe,
impl<K, M> Send for BalancedBinaryTree<K, M>
impl<K, M> Sync for BalancedBinaryTree<K, M>
impl<K, M> Unpin for BalancedBinaryTree<K, M>
impl<K, M> UnwindSafe for BalancedBinaryTree<K, M>
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