Concepts2
⚙️AlgorithmAdvanced
Sqrt Decomposition on Queries
Sqrt decomposition on queries (time blocking) processes Q operations in blocks of size about \(\sqrt{Q}\) to balance per-query overhead and rebuild cost.
#sqrt decomposition#time blocking#query blocking+12
⚙️AlgorithmAdvanced
Rectangle Union Area
The union area of many axis-aligned rectangles can be computed efficiently using a sweep line over x and a segment tree tracking covered y-length.
#rectangle union area#line sweep#segment tree+12