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

Sign in to watch this lesson
Advanced - Data Structures and Range Queries · 4:51
Range-minimum structures sit on a map of update cost against query cost: sparse tables and the Cartesian-tree method answer in O(1) but never change, Arpa's trick is nearly constant but offline, segment and Fenwick trees are logarithmic on both sides, and square-root blocks and the sqrt tree trade one side for the other. Five questions in order (does the array change, are queries offline, is the operation idempotent or invertible, are updates ranges, what are the sizes and budgets) pick the structure, and a measurement settles speed against memory.