Best Compression algorithm for a sequence of integers

前端 未结 15 1628
离开以前
离开以前 2020-11-29 16:41

I have a large array with a range of integers that are mostly continuous, eg 1-100, 110-160, etc. All integers are positive. What would be the best algorithm to compress thi

15条回答
  •  时光说笑
    2020-11-29 17:33

    If you have series of repeated values RLE is the easiest to implement and could give you a good result. Nontheless other more advanced algorithms that take into account the entrophy such as LZW, which is now patent-free, can usually achive a much better compression.

    You can take a look at these and other lossless algorithms here.

提交回复
热议问题