Fenwick Tree: Lowbit Walks, Prefix Sums and Update Paths
A table of amber blocks carries a Fenwick tree as teal rails stacked above it: rail i covers the lowbit(i) cells ending at i. A machine performs point updates and range-sum queries one after another while a red pointer walks the nodes. Updates climb by adding the lowest set bit, queries descend by clearing it, and both stay within floor(log2 n) + 1 nodes. Change the array length, the number of operations, the share of queries and the build method, compare the cost with a plain array and a prefix-sum array, and verify seven independent numerical checks against brute force and closed forms.
A table of amber blocks carries a Fenwick tree as teal rails stacked above it: rail i covers the lowbit(i) cells ending at i. A machine performs point updates and range-sum queries one after another while a red pointer walks the nodes. Updates climb by adding the lowest set bit, queries descend by clearing it, and both stay within floor(log2 n) + 1 nodes. Change the array length, the number of operations, the share of queries and the build method, compare the cost with a plain array and a prefix-sum array, and verify seven independent numerical checks against brute force and closed forms.
A table of amber blocks carries a Fenwick tree as teal rails stacked above it: rail i covers the lowbit(i) cells ending at i. A machine performs point updates and range-sum queries one after another while a red pointer walks the nodes. Updates climb by adding the lowest set bit, queries descend by clearing it, and both stay within floor(log2 n) + 1 nodes. Change the array length, the number of operations, the share of queries and the build method, compare the cost with a plain array and a prefix-sum array, and verify seven independent numerical checks against brute force and closed forms.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install