Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

How long can a monopoly earn economic profits?

Answered: 1 week ago