In question #2, which of the following represents the word “dead”?
(A) 1011111100101
(B) 0100000011010
(C) Both A and B
(D) None of these
Answer: (C)
Explanation: The Huffman Tree generated is:

character code-word
f 0
c 100
d 101
a 1100
b 1101
e 111
The word dead can be represented as:
101 111 1100 101
However, the alternative codeword can also be found by assigning 1 to the left edge and 0 to the right edge of the tree, i.e. dead can also be represented as:
010 000 0011 010
See here for more details of the algorithm.
Quiz of this Question
Recommended Posts:
- Algorithms Quiz | Greedy Algorithms | Question 8
- Algorithms | Greedy Algorithms | Question 1
- Algorithms | Greedy Algorithms | Question 6
- Algorithms | Greedy Algorithms | Question 5
- Algorithms | Greedy Algorithms | Question 3
- Algorithms | Greedy Algorithms | Question 7
- Algorithms | Greedy Algorithms | Question 3
- Algorithms | Analysis of Algorithms (Recurrences) | Question 4
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 9
- Algorithms | Analysis of Algorithms (Recurrences) | Question 3
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 1
- Algorithms | Analysis of Algorithms (Recurrences) | Question 6
- Algorithms | Analysis of Algorithms (Recurrences) | Question 8
- Algorithms | Analysis of Algorithms (Recurrences) | Question 2
- Algorithms | Analysis of Algorithms (Recurrences) | Question 7
- Algorithms | Analysis of Algorithms | Question 14
- Algorithms Quiz | Bit Algorithms | Question 4

