Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implementation of Huffman Coding in C++. Given functions cannot be removed or be changed, nor can be added external functions. Program must be compiled and

 Implementation of Huffman Coding in C++. Given functions cannot be removed or be changed, nor can be added external functions. Program must be compiled and must accept file inputs. Example of inputs are :

Input data

a

d

e

h

i

g

o

s

t

c

m

v

b

40

3

20

1

10

1

5

2

5

1

1

1

10

Following are the given Classes and functions.

classHtreeNode{

public:

string chStr;

intprob;

string code;

HtreeNode *left;

HtreeNode *right;

HtreeNode *next;

/*------------------ HtreeNODE Constructor -------------------------*/

HtreeNode(){

this-> left =NULL;

this-> right =NULL;

this-> next =NULL;

}

voidprintNode(){}

};

//************************* HuffmanBinaryTree CLASS *******************************/

classHuffmanBinaryTree {

public:

HtreeNode *listHead;

HtreeNode *root;

/*------------------ HuffmanBinaryTree Constructor -------------------------*/

HuffmanBinaryTree(){

this-> listHead =NULL;

this-> root =NULL;

}

/*------------------ Find a spot -------------------------*/

HtreeNode *findSpot(HtreeNode *spot){

returnspot;

}

/*------------------ Insert function -------------------------*/

voidlistInsert(HtreeNode *listHead, HtreeNode *newNode ){ }

/*------------------ Construt Huffman list -------------------------*/

HtreeNode *constructHuffmanLList(){}

/*------------------ Construct Huffman Binary Tree -------------------------*/

HtreeNode *constructHuffmanBinTree(){}

/*------------------ PreOrder Traversal-------------------------*/

voidpreOrderTraversal(){}

/*------------------ inOrder Traversal-------------------------*/

voidinOrderTraversal(){}

/*------------------ PostOrder Traversal-------------------------*/

voidpostOrderTraversal(){}

/*------------------ Construct Char Code-------------------------*/

voidconstructCharCode(){ }

/*------------------ Check leaf-------------------------*/

boolisLeaf(){}

/*------------------ Print list-------------------------*/

voidprintList(){}

};

//************************* Main function *******************************/

intmain(intargc,constchar* argv[]) {

cout

return0;





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

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Programming questions

Question

e. What are the programs research and clinical focus areas?

Answered: 1 week ago