[2,6]
Active Range
-
Current Result
1
Tree Node
0
Lazy Tag
Ready
Status
Current node / update path
Query segments being combined
Lazy tag present
Fully covered segment
Step Log
How It Works
A segment tree stores interval aggregates in a binary tree. Range queries combine only the nodes that intersect the query interval. Point updates modify a leaf and then recompute values up to the root. Lazy propagation stores postponed range updates in internal nodes until a future operation needs them.
- Query mode highlights which segments contribute to the final sum.
- Point update mode shows the path from leaf to root.
- Range add mode shows lazy tags being attached and later pushed downward.