6.19 Coordinate Compression
6.19 Coordinate Compression Coordinate compression replaces large or sparse keys with small dense ranks. It preserves order while reducing the value range. This makes range-based algorithms, counting arrays, Fenwick trees, segment trees, and bucketed structures practical on data with large numeric keys. Problem You have values such as: [1000000000, -7, 42, 1000000000, 500000] The values are too large or too sparse to use directly as array indices. You want to...