pub struct SegmentTree<M: Monoid> {
pub N: usize,
/* private fields */
}Expand description
セグメント木
Fields§
§N: usize要素数
Implementations§
Source§impl<T: Ord + Bounded + Clone> SegmentTree<Indexed<Min<T>>>
impl<T: Ord + Bounded + Clone> SegmentTree<Indexed<Min<T>>>
Sourcepub fn new_with_index(N: usize) -> Self
pub fn new_with_index(N: usize) -> Self
セグメント木(インデックス付きで)を初期化する
- 時間計算量: $
O(N)$
Source§impl<T: Ord + Bounded + Clone> SegmentTree<Indexed<Max<T>>>
impl<T: Ord + Bounded + Clone> SegmentTree<Indexed<Max<T>>>
Sourcepub fn new_with_index(N: usize) -> Self
pub fn new_with_index(N: usize) -> Self
セグメント木を(インデックス付きで)初期化する
- 時間計算量: $
O(N)$
Source§impl<M: Monoid> SegmentTree<M>
impl<M: Monoid> SegmentTree<M>
Trait Implementations§
Source§impl<M> Debug for SegmentTree<M>
impl<M> Debug for SegmentTree<M>
Source§impl<M: Monoid> FromIterator<<M as Monoid>::Val> for SegmentTree<M>
impl<M: Monoid> FromIterator<<M as Monoid>::Val> for SegmentTree<M>
Source§impl<M> ShowBinaryTree<usize> for SegmentTree<M>
impl<M> ShowBinaryTree<usize> for SegmentTree<M>
Source§fn print_node(&self, i: &usize) -> String
fn print_node(&self, i: &usize) -> String
<required> ノードの値を表示する
Source§fn print_as_binary_tree(&self)
fn print_as_binary_tree(&self)
2分木としてフォーマットする
Auto Trait Implementations§
impl<M> Freeze for SegmentTree<M>
impl<M> RefUnwindSafe for SegmentTree<M>
impl<M> Send for SegmentTree<M>
impl<M> Sync for SegmentTree<M>
impl<M> Unpin for SegmentTree<M>
impl<M> UnwindSafe for SegmentTree<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