← Quiz: Rooted Trees and Huffman Coding: all 10 questions
Quiz: Rooted Trees and Huffman Coding · Question 8 of 10
In Huffman's algorithm, which two trees are merged at each step?
In Huffman's algorithm, which two trees are merged at each step?
- A.The two largest
- B.The first two in alphabetical order
- C.The two with the smallest weights
- D.One small and one large, to keep the tree balanced
Answer & explanation
Correct answer: The two with the smallest weights
Merging the lightest pair pushes the rarest characters deepest, giving them the longest codes.
Can you get the rest right without peeking?
Take the timed Quiz: Rooted Trees and Huffman Coding quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →