Question: 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

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 Programming Questions!