diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-06-27 12:27:26 +0200 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-06-27 12:27:26 +0200 |
| commit | df13ed5e437b3d75394ba704e9d3eb2c29d037b2 (patch) | |
| tree | fb29e5b4b7eabe4f473929dae8c340510026bf3c | |
| parent | 9e625b89bac7e8daaf583e215f3a0df3dc250bb2 (diff) | |
Fixes small errors in fenwick tree implementation.
| -rw-r--r-- | datastructures/fenwickTree.cpp | 4 | ||||
| -rw-r--r-- | tcr.pdf | bin | 269295 -> 269295 bytes |
2 files changed, 2 insertions, 2 deletions
diff --git a/datastructures/fenwickTree.cpp b/datastructures/fenwickTree.cpp index 02be7d4..bb3f72d 100644 --- a/datastructures/fenwickTree.cpp +++ b/datastructures/fenwickTree.cpp @@ -1,8 +1,8 @@ vector<int> FT; //Fenwick-Tree //Build an Fenwick-Tree over an array a. Time Complexity: O(n*log(n)) -buildFenwickTree(vector<int>& a) { - n = a.size(); +void buildFenwickTree(vector<int>& a) { + int n = a.size(); FT.assign(n+1,0); for(int i = 0; i < n; i++) updateFT(i,a[i]); } Binary files differ |
