TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
A data structure to quickly do operations on ranges: the Segment Tree algorithm implementation. More...
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
Go to the source code of this file.
Classes | |
class | data_structures::SegmentTree< T > |
class representation of the segment tree More... | |
Namespaces | |
namespace | data_structures |
for IO operations | |
Functions | |
static void | test () |
Self-test implementations. | |
int | main () |
Main function. | |
A data structure to quickly do operations on ranges: the Segment Tree algorithm implementation.
Implementation of the segment tree data structre
Can do point updates (updates the value of some position) and range queries, where it gives the value of some associative opperation done on a range
Both of these operations take O(log N) time
Definition in file segment_tree.cpp.
int main | ( | void | ) |
Main function.
Definition at line 130 of file segment_tree.cpp.
|
static |
Self-test implementations.
Definition at line 112 of file segment_tree.cpp.