Huffman
Huffman coding is a lossless data compression algorithm named after American computer scientist David A. Huffman, who introduced it in 1952. It assigns variable-length codes to symbols based on their frequencies of occurrence, with more frequent symbols given shorter codes. The set of codes forms a prefix code, meaning no code is a prefix of any other, enabling unambiguous decoding.
The method works by building a binary tree: each leaf represents a symbol, and the path to
Huffman coding is optimal among all prefix codes for a given set of symbol probabilities, minimizing the
Applications are widespread in lossless compression, notably as the entropy coding step in the Deflate algorithm
Limitations include the need to know or estimate symbol probabilities; when statistics change, the code may