segment tree(iterative version)
More...
#include <segment_tree_iterative.h>
|
| seg_tree (const std::vector< T > &v) noexcept |
| default constructor
|
|
T | sum (int a, int b) |
| sum query
|
|
void | update (int idx, T x) |
| update query
|
|
|
std::vector< T > | tree |
|
std::vector< T > | data |
|
int | n |
|
template<typename T>
struct seg_tree< T >
segment tree(iterative version)
◆ seg_tree()
default constructor
- Parameters
-
◆ sum()
sum query
- Parameters
-
a | the first index |
b | the second index |
: indexes are allowed to be from [0, n)
- Returns
- : the sum of the range[a, b]
◆ update()
template<typename T>
void seg_tree< T >::update |
( |
int | idx, |
|
|
T | x ) |
|
inline |
update query
- Parameters
-
idx | the passed index |
x | the new value of the index |
The documentation for this struct was generated from the following file: