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

Step: 3

blur-text-image

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

1. Define the nature of interviews

Answered: 1 week ago

Question

2. Outline the different types of interviews

Answered: 1 week ago