Huffman coding
Optimal prefix-free code construction assigning shorter codes to frequent symbols. Huffman coding minimizes average code length. Foundation for many compression algorithms.
Formula
Code length ∝ 1 / symbol frequency
Real World
PKZIP and DEFLATE (used inside PNG images and gzip web compression) build a Huffman tree from byte frequencies so that common bytes like space or 'e' get 3–4 bit codes while rare bytes get 15+ bits, shrinking files by 50–70%.
Exam Focus
Always show the frequency table, tree-building steps, and final binary codes — marks are awarded for the process, not just the result.
How well did you know this?