Prefix Sum
Allows range sum queries after preprocessing.2D Prefix Sum
Sum of a rectangle from to .Difference Array
Used for range updates (add to ) in . After all updates, calculate prefix sums to get the final values.Practice
Sheet 7: Static Range Queries
Practice problems for this tutorial.