@sivarajans/fenwick-tree

Fenwick tree

Usage no npm install needed!

<script type="module">
  import sivarajansFenwickTree from 'https://cdn.skypack.dev/@sivarajans/fenwick-tree';
</script>

README

Fenwick Tree

General tree used for range queries. It works with bits for positional sum up and todo range queries.

The highest element responsible can be found using Bits(n) + Least Significant Bits(n)

Same way the lowest element responsible for range query can be found using Bits(n) - Least Significant Bits(n)

npm i @sivarajans/fenwick-tree