2006week8_2 - Week 8 Huffman Encoding Write a program that...

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Week 8 Huffman Encoding Write a program that reads in a file (argv[1]) and, based on the characters it contains, computes the Huffman tree. The output, for an example input file, should look something like: 010 : 00101 ( 5 * 125) ‘ ’ : 110 ( 3 * 792) ‘"’ : 111001010 ( 9 * 12) ‘’’ : 00100000 ( 8 * 15) ‘(’ : 01100000100 ( 11 * 2) ‘)’ : 01100001101 ( 11 * 2) ‘,’ : 1001001 ( 7 * 39) ‘-’ : 0010010 ( 7 * 31) ‘.’ : 1001100 ( 7 * 40) ‘/’ : 00100110000 ( 11 * 1) ‘0’ : 11100110010 ( 11 * 3) ‘1’ : 00100010 ( 8 * 15) ‘3’ : 01100000101 ( 11 * 2) ‘4’ : 01100001001 ( 11 * 2) ‘5’ : 11100110011 ( 11 * 3) ‘6’ : 01100001000 ( 11 * 2) ‘7’ : 01100001100 ( 11 * 2) ‘8’ : 001001101 ( 9 * 8) ‘9’ : 10010000 ( 8 * 18) ‘:’ : 01100001011 ( 11 * 2) ‘A’ : 00100111 ( 8 * 16) ‘B’ : 111001101 ( 9 * 13) ‘C’ : 10011011 ( 8 * 22) ‘D’ : 111001110 ( 9 * 13) ‘E’ : 10011010 ( 8 * 19) ‘F’ : 111001000 ( 9 * 11) ‘G’ : 0110000000 (...
View Full Document

Ask a homework question - tutors are online