A fish called Fenwick tree

You may wonder, “Fenwick what? Which tree???”. Don’t be afraid of the spooky term the idea is pretty innocent. Remember: fear is the path to the dark side. First of all, let’s start with a simple problem: Imagine you have an array a of integers of length n. For the sake of simplicity let’s assume it is a one-dimensional array. You are given 2 values start and finish and your goal is to find a sum of all elements in this array between start and finish....

January 19, 2022 · 13 min · 2686 words · Me