Conventional computer codes give each letter the same storage space - the common 'E' consumes as much as the rare 'K'.
The Huffman algorithm chooses a smarter way: frequent characters get very short codes, rare a little longer. Thus, the amount of data shrinks without any loss of information.
How to create an elegant Huffman tree from character frequencies step by step, let's look directly at the example word: KAFFEPAUSE.
(more…)