Static range query algorithms
Square root decomposition with sorted blocks for range counting queries and point updates in O(sqrt n).
2D prefix sum for O(1) rectangle sum queries on a static grid.
2D difference array for O(1) range updates and O(n*m) final propagation.
Mo's algorithm adapted for tree path queries using Euler tour flattening and LCA via binary lifting.
Offline range query processing with Hilbert curve ordering for optimal cache performance.