test_reference_segtree

Segment Tree Animations

Standard Segment Tree – Query and Update

Build a segment tree from a=[2,5,1,3,7,4]a = [2, 5, 1, 3, 7, 4] with sum aggregation. First we query the range [1,4][1, 4], then perform a point update at index 2.

Step 1 / 12

Sparse Segment Tree – Dynamic Node Allocation

A sparse segment tree over range [0,7][0, 7]. Nodes are allocated on-demand as values are inserted.

Step 1 / 12