CS65: Assignment 1Mulitmedia CommunicationDue Date : May 13 to 15
Huffman coding is a scheme that assigns variable-length bit-codes to characters, such thatthe lengths of the codes depend on the frequencies of the characters in a typical message.As a result, encoded messages take less space (as compared to fixed-length encoding)since the letters that appear more frequently are assigned shorter codes. This is performedby first building a Huffman coding tree based on a given set of frequencies. From the tree,bit-codes for each character are determined and then used to encode a message. The treeis also used to decode an encoded message as it provides a way to determine which bitsequences translate back to a character.
Refer to the text for a more detailed discussion on Huffman coding trees.
Assignment:For this assignment, you will write three programs:
Given a file that contains the frequency distribution for all 26 letters of thealphabet plus four special characters (space, period, new-line, and end-of-message),buildtree will generate two files: a huffman coding tree file and a file containing bit-codeassignments.
Given the bit-code file generated by buildtree, and a text file containing amessage, encode will produce a binary _le that contains the encoded message.
Given the huffman coding tree file generated by buildtree, and an encodedmessage generated by encode, decode will reproduce the original message and output thatmessage to a text file.