{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


huffman-handout1 - Human Coding Lign 17 A Kehler This...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Huffman Coding Lign 17, A. Kehler This handout provides another example of how the Huffman Coding algorithm works. It also describes certain rules that, while arbitrary, are necessary for you to follow when preparing Assignment 4. The central idea behind the Huffman Coding algorithm is to build a tree representation from the bottom-up, starting with the least frequent symbols. At each stage the two lowest- numbered ‘nodes’ are combined into a larger tree, where ‘node’ means a symbol or a tree that includes several symbols within it. The two additional rules you need to follow are: Rule 1: When combining two nodes, always put the node with the higher count to the left. Rule 2: When combining two nodes that have equal counts, always put the nodes in alphabetical order, going by the leftmost symbol in each tree being combined (or if a single letter is being combined, use that letter). Let us make the foregoing clear by stepping through an example. Suppose we have a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}