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

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:

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 Boss (39.9k points) | 172 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


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

35,458 questions
42,705 answers
42,105 users