Question: Please write the code to create a Huffman Encoding Tree, as discussed in class. The tree should encode strings of vowels, with the following weights

 Please write the code to create a Huffman Encoding Tree, as

Please write the code to create a Huffman Encoding Tree, as discussed in class. The tree should encode strings of vowels, with the following weights for each vowel A:20, E:15, 1:5, 0:5, U:10 The final tree should end up SIMILAR TO this - the bit strings may differ slightly, though the nodes should end up in the same relative positions 58 A 20 35 E 15 10 20 U 10 10 0 5 1100 101 Your Huffman Tree should be in a tree structure, using nodes and pointers to children nodes. To construct the tree, follow the general algorithm in class: 1. Make a list of nodes out of the provided vowel weight table 2. Sort the list on their weights/probabilities 3. Until the list only has one element a. Pop the two smallest b. Turn them into a subtree with a new node c. Add the new root back into the list d. Sort the list Further, you must implement code to decode and encode strings using your Huffman tree. Please make an encode and a decode method

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