Why it matters

Range updates common. Lazy propagation is standard technique.

Advertisement

The architecture

Lazy value at internal node.

Push down on child access.

Lazy propagationRange updatemark lazy at boundaryPush downon child accessQueryconsistent viewMultiple lazy types (add, set) need careful composition rules
Lazy propagation.
Advertisement

How it works end to end

Push down rule: apply lazy to children before recurse.

Compose lazy: careful when multiple update types.

Common: range add + point query, range set + range max.