⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 19m 18s17 days 22 hours 19 minutes 18 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 19m 18s17 days 22 hours 19 minutes 18 seconds.

Sign in to watch this lesson
Algorithms - Trees and Range Queries · 4:07
Prefix sums answer any range sum with one subtraction, but a single changed value forces the whole tail of the prefix array to be rewritten; a plain array is the mirror image. We place both on a plot of update cost against query cost, cut the array into blocks of about root n to bring the worse side down, and time all three on a Mac: each corner wins its own extreme, while the blocks win a realistic mix by more than ten times, setting up the logarithmic structures that come next.