38.8 Exercises
Factual
Suppose we build a Shannon Fano or Huffman code for the text of this question including spaces and punctuation characters. Which characters would have the longest code?
What two ways could we represent a Huffman code for characters in Java?
Procedural
Suppose we have a string
abcdefg
which repeats 1000 times. How many bits would be in the compressed bitstream?
Metacognitive
Using the idea of self-extracting bits, come up with an encoding for the sequence
abdefg
repeated 1000 times that uses less than 2000 bits.
Last updated