in Algorithms edited by
420 views
4 votes
4 votes

Which of the following frequencies for A,B,C and D can generate the following Huffman tree? (Select all that apply.)

  1. $p_A=0.4, p_B=0.3, p_C=0.2, p_D=0.1$
  2. $p_A=0.35, p_B=0.25, p_C=0.2, p_D=0.2$
  3. $p_A=0.25, p_B=0.25, p_C=0.25, p_D=0.25$
  4. $p_A=0.2, p_B=0.35, p_C=0.2, p_D=0.25$
in Algorithms edited by
420 views

1 comment

I think only C is right option.
0
0

1 Answer

2 votes
2 votes
how can B be  answer if B needs to be pulled out first from priority queue....  other symmetry of A and B would lead to 2 different structure of binary tree and one of them would not match with given structure

2 Comments

I did not get it.

Can you please explain more?

Question Source: https://inst.eecs.berkeley.edu/~ee126/sp23/exam/mt2/sp19_sol.pdf
0
0
Sir option B me A ki value 0.35 hai and B ki I value 0.25 to B left me aayega na A ke sath to given questions se match hi nahi hoyega phir
0
0
Answer:

Related questions