Consider the following symbols with their corresponding frequencies:
A : 1, B : 1, C : 2, D : 3, E : 5, F : 8, G : 13, H : 21
Problem 2.a. (3 points)
• Construct the Huffman coding of these symbols along with its optimal coding tree.
Problem 2.b. (3 points)
• Use your coding tree to decode 0001001000010000000001001

Respuesta :

Answer:this question's part a is solved by huffman coding

Ver imagen zoialaraib

Answer:

a) The huffman diagram is attached as image and pdf

b) The code of 0001001000010000000001001 is hhhghghhhghhhhhhhhghg

Explanation:

a) Image is attached

b) From the attached image, we have the following code and character:

a = 1111110

b = 1111111

c = 111110

d = 11110

e = 1110

f = 110

g = 10

h = 0

0|0|0|10|0|10|0|0|0|10|0|0|0|0|0|0|0|0|10|0|1

h|h|h|g|h|g|h|h|h|g|h|h|h|h|h|h|h|h|g|h|g

The last bit is padded with 0 and represented as 'g'

The code of 0001001000010000000001001 is hhhghghhhghhhhhhhhghg

Ver imagen ibnahmadbello