SICP — Scheme/JS Structure and Interpretation of Computer Programs — Comparison Edition

[1] See Hamming 1980 for a discussion of the mathematical properties of Huffman codes.
2.3.4   Example: Huffman Encoding Trees