Loading algorithms…
Loading visualizer…
Range queries and point updates in O(log n) via a binary decomposition of the array. Watch queries split, recurse, and merge.
Build a sum segment tree over [5, 3, 8, 1, 9, 2, 7, 4] (8 leaves). Node 1 covers the whole array.
Build → query → update run back to back · Green nodes contributed to the query result
Range queries and point updates in O(log n) via a binary decomposition of the array. Watch queries split, recurse, and merge.