

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Teaching assistants Zhiqian Hu ([email protected]) Nobuyasu Fukuhara ([email protected]) Office: CS Majors Lab Office: CS Majors Lab Office hours: T 3:00pm ā 5:00pm Office hours: M 10:00am ā 11:00am, W 2:00pm ā 3:00pm Educational Objectives : Apply the binary tree data structure and the heap data structure to generate Huffman code, which is commonly used in data compression schemes. Assignment: Write a program that takes a text file (in ASCII) and generates the Huffman code for characters used in that file (include white spaces, carriage returns, and so on). Deliverables: Use project6submit.sh to turn in your development log, documentations, and all files that are needed to build your software (including the makefile) on 12/5. In addition, you will need to submit an interface and pseudocode design of your software in class on 11/24. Requirements:
e 00 010 t 0110 h 0111 a 10 s 110 l 111 Note that āaā and āeā have the highest frequency and the shortest code. The second line is odd looking because of the carriage return ā\nā character. Your output does not need to match the code. However, the length of code should be inversely proportional to the frequency of occurrences for the corresponding character. Also, the code for a character should not be the prefix for another code. In this case, 00 is the code for āeā and not a prefix for other characters. On the other hand, if you had 01 for āeā, the code would no longer be legitimate, because 00 is the prefix for 010 , 0110 , and 0111. Bonus (5pts): Use the Huffman code you generated to perform compression and decompression on ASCII text files. You will need to use the bitvector class you built back in assignment 1.