Fenwick Tree (Binary Indexed Tree) — watch prefix-sum queries hop DOWN by lowbit and point-updates ripple UP by lowbit in O(log n).

Fenwick Tree · Binary Indexed Tree · n=8 array cell tree cell current hop accumulated updated
Ready

Default array loaded: a = [3,2,5,1,4,6,2,7]. The BIT is built from it. Enter k and press Query to see how prefix sum hops down via i -= lowbit(i); enter idx + delta and press Update to watch the ripple go up via i += lowbit(i).

prefix[1.. ]
a[ ] +=
Speed
Demos
n
8
result
hops
0
lowbit(k)