NAME:

PRECEPT:

LOGIN:

COS 226 Exercises on Data Compression


1. Draw the Huffman tree for the following string, and give the codewords for each of the 5 symbols {e, h, r, t, w}.
wewereherewewerethere



















2. Give the LZW encoding for the following string using the method in the online lecture notes. (See page 637 of the King book for an ASCII table.)

wewereherewewerethere







3. Decode the LZW message

256 119 101 114 101 258 104 259 261 264 258 116 263 260 257