Outline For this project you need to hand in a program that

Outline For this project, you need to hand in a program that will produce an optimal character-based prefix code using Huffman\'s algorithm for a given text file in both code-tree form and as a list of characters and their codes. For example, on typing./huftree moveover.txt my program produces (using std::cout) the output shown to the right. You must write your own priority queue implementation, using a heap implemented with a resizeable array or a vector, and code tree implementation. (I have them in separate files.) You may use the heap code from class and labs. Your code tree and code list should look the same as mine but characters with the same frequencies might be interchanged and codes might be different (as long as they have the same length). I should be able to type \"./huftree text. txt\" at a Unix prompt to produce a Huffman code tree for the text in the file text using your program.

Solution

JAVA CODE :---

 Outline For this project, you need to hand in a program that will produce an optimal character-based prefix code using Huffman\'s algorithm for a given text fi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site