Using Huffman code, we can compress the bits used for saving the characters in a file: (The Table is in Image Attachment) 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 don’t need to sort the input since the input is already sorted!
Using Huffman code, we can compress the bits used for saving the characters in a file:
(The Table is in Image Attachment)
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
encoding and write down the Algorithm analysis. The complexity of the algorithm must be in
O(n) and proof it!
➢ PS: you don’t need to sort the input since the input is already sorted!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images