← Back to Index

🌳 Segment Tree

Range Sum · Query / Point Update / Lazy Propagation
[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.