Skip to content

Latest commit

聽

History

History

fenwick-tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
聽
聽
聽
聽
聽
聽

README.md

Fenwick Tree / Binary Indexed 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

Binary Indexed Tree is represented as an array. Each node of Binary Indexed Tree stores sum of some elements of given array. Size of Binary Indexed Tree is equal to n where n is size of input array. In current implementation we have used size as n+1 for ease of implementation. All the indexes are 1-based.

Binary Indexed Tree

References