• edited by
9,283 views
9 9 votes

Huffman tree is constructed for the following data :$\{A,B,C,D,E\}$ with frequency $\{0.17,0.11,0.24,0.33\ \text{and} \ 0.15 \}$ respectively. $100\ 00\ 01101$ is decoded as

  1. $BACE$
  2. $CADE$
  3. $BAD$
  4. $CADD$

4 Answers

8 8 votes

There's a typo in the huffman code. It should be 100 00 01 101.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

100 - B
00 - A
01 - C
101 - E

BACE

Option A 

1 1 vote

100 00 01101 is decoded as BACE

0 0 votes

This can be a lengthy question if solved manually because you have to check for multiple combinations.
A better way to get the answer: the final codeword must contain B and E, because both have codewords of length 3 (their combined frequency is the lowest). The rest (A, C, D) have codewords of length 2.

given options have 4 letters only. So, to make the total codeword length (100 00 01101) = 10, we must choose B, E, and two of A, C, D.
Therefore, option a is the right answer.
in option c there are three letters so its not possible using length of   {b,e}=3 , {a,c,d} = 2.

• edited by
Answer:
Position:
Show:

Related questions

5 5 votes
4 4 answers
5.9k
5.9k views
Satbir asked Jan 13, 2020
5,923 views
Consider product of three matrices $M_1,M_2$ and $M_3$ having $w$ rows and $x$ columns, $x$ rows and $y$ columns, and $y$ rows and $z$ columns. Under what condition will ...
14 14 votes
7 7 answers
19.8k
19.8k views
Satbir asked Jan 13, 2020
19,797 views
What is the complexity of the following code?sum=0; for(i=1;i<=n;i*=2) for(j=1;j<=n;j++) sum++;Which of the following is not a valid string?$O(n^2)$$O(n\log\ n)$$O(n)$$O(...
9 9 votes
5 5 answers
13.9k
13.9k views
Satbir asked Jan 13, 2020
13,859 views
If an array $A$ contains the items $10,4,7,23,67,12$ and $5$ in that order, what will be the resultant array $A$ after third pass of insertion sort?$67,12,10,5,4,7,23$$4,...
11 11 votes
3 3 answers
6.8k
6.8k views
Satbir asked Jan 13, 2020
6,806 views
In linear hashing, if blocking factor $bfr$, loading factor $i$ and file buckets $N$ are known, the number of records will be$cr= i+bfr+N$$r=i-bfr-N$$r=i+bfr-N$$r=i ^{\as...