Using Huffman code,we can compress the bits used for saving the characters in a file : Table.1. Characters count. [Table image below] Table 2. Character bit using Huffman code [Table image below] Total bits used for saving the character in table 1 is264 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:
Using Huffman code,we can compress the bits used for saving the characters in a file :
Table.1. Characters count.
[Table image below]
Table 2. Character bit using Huffman code
[Table image below]
Total bits used for saving the character in table 1 is264 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
➢ 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 4 steps with 1 images