in Algorithms retagged by
863 views
11 votes
11 votes

Consider the two statements regarding the Huffman's algorithm -

  • $\text{S1:}$ The character with the highest probability (all probabilities are unique) is guaranteed to be one of the leaves that is closest to the root (i.e it has the least depth among all leaves).
  • $\text{S2: }$if all characters occur with probability less than $1 / 3$, then there is guaranteed to be no codeword of length $1.$

Which of the following is CORRECT?

  1. $\mathrm{S} 1$ is correct but $\mathrm{S} 2$ is false
  2. $\mathrm{S} 1$ is false but $\mathrm{S} 2$ is correct
  3. Both are correct statements
  4. Both are incorrect statements
in Algorithms retagged by
863 views

1 Answer

5 votes
5 votes

In Huffman’s algorithm, the character with the highest probability (all probabilities are unique) is guaranteed to be one of the leaves that is closest to the root (i.e it has the least depth among all leaves).

True
https://hkn.eecs.berkeley.edu/examfiles/cs170_fa07_mt2_sol.pdf

if all characters occur with a probability less than $1/3,$ then there is guaranteed to be no codeword of length $1.$

True
https://inst.eecs.berkeley.edu/~cs170/fa18/assets/dis/dis05-sol.pdf

edited by

2 Comments

@Sachin Mittal 1 @GO Classes For s2 if there are only 3 characters then one of them is guaranteed to have a codeword of length 1. How is it true then??

2
2
clearly said prob < 1/3 which means at least 4 chars are there...
6
6
Answer:

Related questions