How could I encode a string of 1s and 0s for transport?

后端 未结 5 1812
后悔当初
后悔当初 2020-12-21 12:02

For a genetic algorithm application, I\'m using a whole load of binary strings. Most of the time they literally take the form of 01001010110, so that they can b

5条回答
  •  情书的邮戳
    2020-12-21 12:28

    Or implement Run length encoding or Huffman coding. Both are fairly easy to implement. RLE is by far the easiest, but will in most cases have worse compression ratio. If your data typically has many consecutive characters of the same value, it could still provide a substantial improvement.

提交回复
热议问题