Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 40s1 days 16 hours 1 minutes 40 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 40s1 days 16 hours 1 minutes 40 seconds.

Sign in to watch this lesson
Advanced - Data Structures and Range Queries · 5:24
A range update stops at the O(log n) nodes that cover the range and leaves a note there; a note is handed to both children (a push) only when an update or query has to go below that node, and every parent recomputes its aggregate after its children return. Range add with point reads needs no push at all, range assignment does, and range add with range max or sum combines both, with sums scaling the note by the segment length. Mixed assignment and addition need one composition rule: an assignment wipes a pending addition, and an addition lands on a pending assignment.