Question: QUESTION IMPLEMENT THE FOLLOWING MEMBER FUNCTION IN THE HUFFMAN CLASS void createHuffman(char *fileName) void printHuffman() const Destructor B) ****Create a main function which creates a

QUESTION IMPLEMENT THE FOLLOWING MEMBER FUNCTION IN THE HUFFMAN CLASS void createHuffman(char *fileName) void printHuffman() const Destructor B) ****Create a main function which creates a Huffman object, calls the createHuffman function and passes the name of a text file to it. The main function then calls the printHuffman function to print Huffman code of all unique characters. Note: Your program should run on any text file containing ASCII characters. The file can have any number of characters. do display the output of a running program add comments for better understanding of solution important: A valid character is stored only in leaf nodes in a Huffman Tree. In a leaf node, the value in freq variable corresponds to the frequency of the character that the node represents. In a non-leaf node, the value in freq variable is the sum of freq variables stored in its left child and right child. QUESTION IMPLEMENT THE FOLLOWING MEMBER FUNCTION IN THE HUFFMAN CLASS void createHuffman(char

C++ DATA STRUCTURE(HUFFMAN TREE) Implement a class Huffman which contains the root Node of Huffman binary tree. Each node in Huffman is of type HNode. struct HNode { int freq; char character; HNode *left, *right; }

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!