Hacker News new | ask | show | jobs
by miguelpais 5723 days ago
Halfway through the article this encoding / data compression algorithm I learned last semester came to my mind:

Huffman coding http://en.wikipedia.org/wiki/Huffman_coding

It was really simple, based on a file with a given number of symbols, it would rewrite those symbols as length-variable unique binary codes, so that the symbol with highest number of occurrences would become the code with the smallest possible bit-length, and so on with the other symbols so that it would spend most bits on the symbols that occurred less times.

1 comments

Huffman coding is very very related to this. If you have a capped block length, huffman coding is optimal.