constructor(length) {
    this._elements = new Array(length + 1);
    for (let i = 0; i < this._elements.length; i++) {
      this._elements[i] = 0;
    }
  }
Fenwick Tree (Binary Indexed Tree)

The fenwick tree is a tree in the sense it represents a structure where
the leafs are the original array values and each parent has the sum of its
two children. E.g., for an array [1, 2, 3, 4], we have:

   10
 3    7
1 2  3 4

But some nodes aren't really important. In fact every right child isn't
needed to compute the prefix sum (as its value is just the parent's value
minus the left child), so we can store the tree in a compact array structure
like this:

1 3 3 10

Here we assume all the operations will be on a 1-based array for two
reasons: (1) the bit operations become rather easy and (2) it's better to
reason about the range sum (prefix(b) - prefix(a-1)) on a 1-based array.