Huffman Coding Checkpoint

Worked scenarios: trace state, diagnose mistakes, and apply the module contract.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. For symbol IDs 0,1,2 with weights 2,1,1, the first merge joins 1 and 2 at weight 2. Which root child goes left?

Select one answer.

2. Canonical lengths are [1,3,3]. Give symbol 2's code as a three-bit string.
3. A decoder receives lengths [1,1,2]. Which result is required?

Select one answer.

4. A Huffman merge trace has weights 3,5,9. What is the total weighted leaf-depth cost?
5. Tree codes and canonical codes have identical per-symbol lengths but different bits. Which is guaranteed?

Select one answer.

6. Only symbol 4 has positive frequency. How many bits does this pack assign to one occurrence?
Join Discord