This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Huffman code uses different number of bits to represent characters: fewer for frequent characters  more for rare characters. Example: e = 10, z = 1001101 Huffman codes are used for data compression. Huffman Code Huffman Code Huffman Tree is a binary tree where: leafs store characters left edges are associated with zeros right edges are associated with ones. Huffman Tree Huffman Tree To determine Huffman code of a character given a prebuilt Huffman Tree: traverse the tree from root to leaf until you find the character keep the record of left or right turns to make up the code, e.g. a = 000 b = 001 Huffman Codes Huffman Codes For each character in the message: obtain Huffman Code concatenate character codes to form the encoded message (bit string). Example: abe > 000001100 a b e Huffman Encoding Huffman Encoding For each bit in the Huffman Code bit string: recursively traverse the Huffman Tree starting from the root; use the bits value to decide whether to traverse the left subtree or the right subtree...
View Full
Document
 Spring '07
 YOXHEIMER,ERICCH

Click to edit the document details