From df13ed5e437b3d75394ba704e9d3eb2c29d037b2 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Mon, 27 Jun 2016 12:27:26 +0200 Subject: Fixes small errors in fenwick tree implementation. --- datastructures/fenwickTree.cpp | 4 ++-- 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 FT; //Fenwick-Tree //Build an Fenwick-Tree over an array a. Time Complexity: O(n*log(n)) -buildFenwickTree(vector& a) { - n = a.size(); +void buildFenwickTree(vector& a) { + int n = a.size(); FT.assign(n+1,0); for(int i = 0; i < n; i++) updateFT(i,a[i]); } diff --git a/tcr.pdf b/tcr.pdf index 79cc684..801fc14 100644 Binary files a/tcr.pdf and b/tcr.pdf differ -- cgit v1.2.3