fenwick

1.0.6 • Public • Published

Fenwick

npm package for fenwick tree.

Usage

import Fenwick from "fenwick";

const arr = [1, 2, 3, 4, 5];
const tree = new Fenwick(arr);

tree.sum(arr.length - 1); // 15
tree.update(0, 10);
// tree.sum(arr.length - 1) is now 25

Package Sidebar

Install

npm i fenwick

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

2.85 kB

Total Files

4

Last publish

Collaborators

  • mkessler