Lingo

Fenwick Tree Explorer

Query a prefix and watch the lowbit walk visit each block.

Values

Each node stores the sum of a lowbit-sized block ending at that index.

3
2
5
1
6
4
7
0
3
5
5
11
6
10
7

Add block at index 0; step to 0. Running total 21.

21Prefix sum
2Blocks read
O(log n)Update
O(log n)Query