Struct cp_library_rs::data_structure::segment_tree::SegmentTree
source · 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>
source§impl<M> SegmentTree<M>where
M: OrderedMonoid,
M::Val: Debug,
impl<M> SegmentTree<M>where M: OrderedMonoid, M::Val: Debug,
Trait Implementations§
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>where
M: Monoid,
M::Val: Debug,
impl<M> ShowBinaryTree<usize> for SegmentTree<M>where M: Monoid, M::Val: Debug,
source§fn print_node(&mut self, i: &usize) -> String
fn print_node(&mut self, i: &usize) -> String
<required> ノードの値を表示する
source§fn print_inner(
&mut self,
ptr: P,
fill: &mut Vec<&'static str>,
last: &'static str
)
fn print_inner( &mut self, ptr: P, fill: &mut Vec<&'static str>, last: &'static str )
再帰的にprintを行う
source§fn print_as_binary_tree(&mut self)
fn print_as_binary_tree(&mut self)
2分木としてフォーマットする