Lingo

Segment Tree Explorer

Query a range and watch which disjoint nodes get combined.

Values

Each node stores the sum of a disjoint segment; a range query combines O(log n) of them.

3
2
5
1
6
4
7
28
11
17
5
6
10
7
3
2
5
1
6
4
7

Right bound is even: take node 6. Running total 18.

18Range sum
3Nodes read
16Tree size
O(log n)Update