The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
131 views

A language uses an alphabet of six letters, {a, b, c, d, e, f}. The relative frequency of use of each letter of the alphabet in the language is as given below:

LETTER RELATIVE FREQUENCY OF USE
a 0.19
b 0.05
c 0.17
d 0.08
e 0.40
f 0.11

Design a prefix binary code for the language which would minimize the average length of the encoded words of the language.

asked in Digital Logic by Veteran (43.3k points) | 131 views

Huffman coding is to find prefix of letters,is to compress the message size over ASCII code.

To find length of encoded message find Huffman tree and sum of all internal nodes gives the message length.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

First find minimum tress in the forest and remove it add to huffman tree.Add two minimum trees and add in the forest.

Repeat this procedure until forest become single tree.

Length of message=1+0.60+0.24+0.36+0.13

                            =2.33

Please log in or register to answer this question.



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,961 questions
37,632 answers
96,400 comments
35,286 users