Huffman Code: Compression algorithm...and it is really good under certain circumstances. If you know the exact frequency of characters in the original message, Huffman code is the best. You can't beat the Huffman code! Building the Huffman tree (taking the two lowest-frequency trees present and and connecting them with a 0-1 branch until the entire tree is built) generates a bit-encoding for the individual letters in the message such that the number of bits needed to encode the original message is minimized.