Question: Using Huffman code, we can compress the bits used for saving the characters in a file: Total bits used for saving the character in table

Using Huffman code, we can compress the bits used for saving the characters in a file:

Using Huffman code, we can compress the bits used for saving the

Total bits used for saving the character in table 1 is 264 bits using standard ASCII 8 bits for 1 character. Using Huffman code encoding in Table 2, the total bits used is 126 bits. The problem:

- Input: list of characters such as table 1

- Output: total bits using Huffman code encoding (table 2)

- Task: Design an algorithm in pseudocode/code to print the total bits using Huffman code encoding and write down the Algorithm analysis. The complexity of the algorithm must be in O(n) and proof it!

- PS: you dont need to sort the input since the input is already sorted!

12 N 4 Table. 1. Characters count. Character Frequency E 1 F 1 H 1 M 1 R 1 T 1 Y 1 D G 2 L 2 0 2 1 3 N 3 Space 4 A 4 S 4 NN Table 2. Character bit using Huffman code Character Bits Frequency Total Bits Space 3 4 12 A 3 4 12 S 3 4 D 4 8 G 4 2 8 1 4 3 12 L 4 2 8 N 4 3 12 O 4 2 8 Y 4 1 4 E 5 1 5 F 5 1 5 H 5 1 5 M 5 1 5 R 5 1 T 5 1 5 Total: 126 4 E |||||

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!