Question

(a) Create a Huffman code for the following string (whitespace inserted for clarity): AAA BB CCCCC...

(a) Create a Huffman code for the following string (whitespace inserted for clarity):
AAA BB CCCCC CCCCC DD EEE
(b) How many bits does your code use to encode the above string?
(c) Huffman codes are always optimal prefix codes, and there are many different ways
one can build a Huffman code from the same set of character frequencies (e.g.
by swapping the left and right subtrees at any iteration). Give an example of an
optimal prefix code for this text that is not a Huffman code, i.e., that cannot be
generated using the Huffman algorithm (Hint: in any Huffman code, what is the
relationship between the two characters with the lowest frequencies?).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you are still having any doubt then please feel free to ask in the comment section.

Add a comment
Know the answer?
Add Answer to:
(a) Create a Huffman code for the following string (whitespace inserted for clarity): AAA BB CCCCC...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT