Prefix Sum Array
Precompute cumulative sums to answer range sum queries in constant time.
5 notes
Precompute cumulative sums to answer range sum queries in constant time.
Augmented and self-balancing trees, range query structures, Fenwick and segment tree variants, union-find, tries, and order statistic structures.
Sparse tables, sqrt decomposition, Mo's algorithm, wavelet trees, merge sort trees, 2D range trees, and offline range query techniques.
Search for all intervals that overlap a query interval using a balanced interval tree.
Find the range of indices containing all occurrences of a value in a sorted array.