Question: Programming Assignment 4 Huffman Coding: Programming assignment 4 is about Huffman coding. There is Code Blocks project for starting the assignment (assig4 start). This programming

 Programming Assignment 4 Huffman Coding: Programming assignment 4 is about Huffman

coding. There is Code Blocks project for starting the assignment (assig4 start).

Programming Assignment 4 Huffman Coding: Programming assignment 4 is about Huffman coding. There is Code Blocks project for starting the assignment (assig4 start). This programming assignment is based on material from the textbook chapter 14 and the textbook website www fordtopp.com. Your assignment is to generate the code required for the member functions in the huffman class. The characters and character frequencies for the assignment are stored in characters and charFreq respectively in the Code Blocks project. The first step is to generate the Huffman tree. As discussed in the textbook and in lecture the Huffman tree is stored in a vector of huffNodes called tree. The huffNode is already setup in the Code blocks Project. The buildTree function fills in this vector. Recall from lecture the Huffman algorithm uses a priority queue to generate the tree. You are required to use the priority queue from the standard template library for this function. The priority queue is already set up to use in the starting Code blocks project. Also, there is a Code Blocks project example using the priority queue. Material from the textbook and d hcomph (from the website) may be useful for the build Tree function. Finding a character's location in the tree uses a form of hashing and the vector charLoc that will be discussed in lecture. The characters location is used when compressing text to find the bit codes corresponding to the text characters. The second step is to generate codes for the c haracters. This is done in generateCodes. Ag material from Chapter 14 and the website may be useful The functions listCodes and write Tree are used to output information about the Huffman tree. The required output is shown below. The function Compress is used to generate b code for the given string in the Code Blocks project. Similarly the function Decompress is used to generate text from a given binary code. To make the project easier to implement the binary codes are stored in strings. Your program should generate the following output in the following order. Your table and numbers will different. Huffman Codes a 000010 b 0010 c 00000 d 00110 e 00111 f 0001 g 000011 m 01 y 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!