Question: Build a data compression system using the Huffmans algorithm. In other words, you are given a sequence of alphabet characters and you are asked to

Build a data compression system using the Huffmans algorithm. In other words, you are given a sequence of alphabet characters and you are asked to construct the Huffmans code. Your output.txt file should have the bit representation for every character that appears in the file (and should not contain characters that are NOT present in the input file). All characters in the input file will be normal English lower-case letters.

Sample output.txt (any valid Huffman code in this format):

a:0

b:101

c:100

d:111

e:1101

f:1100

Sample input.txt (all characters on a single line with no spaces between):

ffffeeeeeeeeefccccccccccccbbbbbbbbbbbbbddddddddddddddddaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

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!