mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Binary Indexed Tree / Fenwick Tree
A simple data structure that supports fast range queries in an array. However, it is usually only valid for reversible operations, like addition and subtraction
This implementation uses the basic range sum query and point update. All the indexes are 1-based