The template contains an array of letter/frequency pairs to be used as input to the Huffman minimum redundancy code algorithm discussed in class. The template also contains a full min-heap implementation that you can use for the priority queue needed by the Huffman algorithm.
Follow the comments in the execute() method to build out five functions that implement the algorithm and display the result. An estimated line length for each function is given in comments. The HNode contains all the member variables and accessors needed for both the Huffman and Binary Tree algorithms (plus others that may not be needed). You will also need to fill out the two binary tree methods btInsert() and btFind(). The functions are:
Your program output should look like this:
letter code:1101letter a code:010letter c code:0011letter e code:101letter i code:011letter n code:1111letter p code:11001letter r code:000letter s code:100letter t code:1110letter u code:0010letter v code:110000letter y code:110001p:11001 a:010 c:0011 e:101 :1101 u:0010 n:1111 i:011 v:110000 e:101 r:000 s:100 i:011 t:1110 y:110001
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here