Expand description
Modules§
Structs§
- Iterative
- Segment tree with range queries and point updates.
It uses
O(n)
space, assuming that each node usesO(1)
space. Note if you need to uselower_bound
, just use theRecursiveSegmentTree
it uses double the memory though and it’s less performant. - Lazy
Persistent - Lazy persistent segment tree, it saves every version of itself, it has range queries and range updates.
It uses
O(n+q*log(n))
space, whereq
is the amount of updates, and assuming that each node usesO(1)
space. - Lazy
Recursive - Lazy segment tree with range queries and range updates.
It uses
O(n)
space, assuming that each node usesO(1)
space. - Persistent
- Persistent segment tree, it saves every version of itself, it has range queries and point updates.
It uses
O(n+q*log(n))
space, whereq
is the amount of updates, and assuming that each node usesO(1)
space. - Recursive
- Segment tree with range queries and point updates.
It uses
O(n)
space, assuming that each node usesO(1)
space. Note if you don’t need to uselower_bound
, just use theSegmentTree
it uses half the memory and it’s more performant.