Huffman Coding Algorithm

However, although optimal among methods encode symbols separately, Huffman coding is not always optimal among all compression methods-it is replaced with arithmetical coding or asymmetrical numeral systems if better compression ratio is need. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is normally used for lossless data compression. In making so, Huffman outdid Fano, who had worked with information theory inventor Claude Shannon to develop a like code. The professor, Robert M. Fano, assigned a term paper on the problem of finding the most efficient binary code. In 1951, David A. Huffman and his MIT information theory classmates were given the choice of a term paper or a final exam.

Huffman Coding source code, pseudocode and analysis