Question: Huffman coding We have a huffman coding dictionary for typical English. With help of any programing language, please apply the dictionary to encode the following

Huffman coding

We have a huffman coding dictionary for typical English. With help of any programing language, please apply the dictionary to encode the following poem and calculate the number of bits needed (for simplicity, please ignore punctuation). Please also apply fixed length coding to the same poem and calculate the number of bits needed as well. Show your calculation, if needed.

The Road Not Taken

BY ROBERT FROST

Two roads diverged in a yellow wood,

And sorry I could not travel both

And be one traveler, long I stood

And looked down one as far as I could

To where it bent in the undergrowth;

Then took the other, as just as fair,

And having perhaps the better claim,

Because it was grassy and wanted wear;

Though as for that the passing there

Had worn them really about the same,

And both that morning equally lay

In leaves no step had trodden black.

Oh, I kept the first for another day!

Yet knowing how way leads on to way,

I doubted if I should ever come back.

I shall be telling this with a sigh

Somewhere ages and ages hence:

Two roads diverged in a wood, and I

I took the one less traveled by,

And that has made all the difference.

Number of bits with Huffman Coding

Number of bits with Fixed Length Coding

Please paste the program you have used to come up with the Huffman Coding result.

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!