Each structure has one data and update contract. Check what ranks preserve, how frequencies affect selection, why offline order changes, and how rectangle corners combine.
Lessons
- Coordinate compression: preserve order with dense integer ranks
- Fenwick frequency index: select the kth stored key
- Mo ordering: count distinct scan codes across an offline query batch
- Two-dimensional prefixes: constant-time static rectangle sums
