Why it matters
Offline processing often gives asymptotic gains. Important optimization technique.
Advertisement
The architecture
Sort queries in beneficial order.
Process in batches.
Advertisement
How it works end to end
Mo's algorithm: sort by (block of L, R).
Sweeping techniques.
Segment tree + sorted queries.