SICP Exercise 2.71 powers of 2 as weights

Exercise 2.71.  Suppose we have a Huffman tree for an alphabet of n symbols, and that the relative frequencies of the symbols are 1, 2, 4, ..., 2n-1. Sketch the tree for n=5; for n=10. In such a tree (for general n) how many bits are required to encode the most frequent symbol? the least frequent symbol?



Comments

Popular posts from this blog

SICP Exercise 1.22 search-for-primes

SICP Exercise 3.45 deadlock

SICP Exercise 4.18 a alternative strategy for interpreting internal definitions