algorithm - Compress an ordered sequence of uint32 -
given array of unique uint32 ordered fixed-width'ed sequence , size can vary thousand million, what's options there compress minimal size? start replacing note of first value , array of differences between successive values. easiest thing run general purpose compression algorithm zip on array of differences. if wanted scratch might try encoding differences http://en.wikipedia.org/wiki/elias_omega_coding , using http://en.wikipedia.org/wiki/huffman_coding on result, treated byte stream or perhaps stream of 16-bit values.