Segment Trees

Algorithms

Querying Range Sums (2D)

Design a matrix-like data structure that allows you to update elements and query submatrix sums efficiently.

Read
Algorithms

Querying Range Sums

Design an array-like data structure that allows you to update elements and query subarray sums efficiently.

Read