From e23c72d59605de49b6090483c633788be8300ac3 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Mon, 27 Jun 2016 14:20:11 +0200 Subject: More changes in fenwick implementation. --- datastructures/fenwickTree.cpp | 3 ++- tcr.pdf | Bin 269295 -> 269327 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/datastructures/fenwickTree.cpp b/datastructures/fenwickTree.cpp index bb3f72d..3b54fc9 100644 --- a/datastructures/fenwickTree.cpp +++ b/datastructures/fenwickTree.cpp @@ -1,8 +1,9 @@ vector FT; //Fenwick-Tree +int n; //Build an Fenwick-Tree over an array a. Time Complexity: O(n*log(n)) void buildFenwickTree(vector& a) { - int n = a.size(); + 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 801fc14..1453dca 100644 Binary files a/tcr.pdf and b/tcr.pdf differ -- cgit v1.2.3