TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Fenwick Tree algorithm implementation More...
#include <cassert>
#include <iostream>
#include <vector>
Go to the source code of this file.
Classes | |
class | range_queries::fenwick_tree |
The class that initializes the Fenwick Tree. More... | |
Namespaces | |
namespace | range_queries |
for std::vector | |
Functions | |
static void | tests () |
Self-test implementations. | |
int | main () |
Main function. | |
Fenwick Tree algorithm implementation
From Wikipedia, the free encyclopedia.
A Fenwick tree or binary indexed tree (BIT) is a clever implementation of a datastructure called bionomal tree. It can update values and solve range queries with operations that is; commulative, associative and has an inverse for this type of element. It can also solve immutable range queries (min/max), when operations only are associative over this type of element. Some of these restrictions can be removed, by storing redunant information; like in max/min range queries.
Definition in file fenwick_tree.cpp.
int main | ( | void | ) |
Main function.
Definition at line 132 of file fenwick_tree.cpp.
|
static |
Self-test implementations.
Definition at line 114 of file fenwick_tree.cpp.