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.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started