flâneur

CS106B Huffman tree warmup

web.stanford.edu · 2,128 words · saved by 1 readers

In these exercises, you will practice with Huffman trees to establish a solid understanding of the Huffman algorithm before you start implementing the program. Huffman coding was introduced in Lecture 23. We have posted a writeup in the lecture notes that repeats that info in case reading works better for you than lecture. Be sure you have watched/read this content first! The assignment writeup assumes familiarity with this content and does not repeat it. First, practice decoding a bit sequence using an encoding tree The diagram below is an encoding tree for the characters O N M and S. Each leaf node corresponds to a character. The path from root to a leaf node traces the sequence of bits that encode the node's character. In the diagram, we marked interior nodes with * for visualization purposes; an interior node does not store a character and the path from root to an interior node is only a partial encoding path. We label the leftward branch zero and rightward one. The path from the r

"Debugging is hard, take breaks!" by Julia Evans In these exercises, you will practice with Huffman trees to establish a solid understanding of the Huffman algorithm before you start implementing the program. Huffman coding was introduced in Lecture 23. We have posted a writeup in the lecture notes that repeats that info in case reading works better for you than lecture. Be sure you have absorbed that content first! The assignment writeup assumes familiarity with this content and does not repeat it. Encoding and decoding using an encoding tree First, practice decoding a bit sequence…

related reading