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

Sign in to watch this lesson
Advanced - Data Structures and Range Queries · 3:44
Cut the array into blocks of about √n and keep one summary per block: a range query becomes two partial blocks plus at most n/s summaries, O(√n), and a point update touches one value and one summary. Range updates put a lazy tag on every full block, and the summary can be a sorted copy (counting values ≥ x) or a jump table (chains of jumps), with the block size kept as a tunable constant.