🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Rooted Trees and Huffman Coding: all 10 questions

Quiz: Rooted Trees and Huffman Coding · Question 9 of 10

Frequencies are p:4, q:2, r:1, s:1. What is the total number of bits in the Huffman encoding?

Frequencies are p:4, q:2, r:1, s:1. What is the total number of bits in the Huffman encoding?

  1. A.8
  2. B.14
  3. C.16
  4. D.12
Answer & explanation

Correct answer: 14

Merges: 1+1 = 2, 2+2 = 4, 4+4 = 8. Total = sum of internal weights = 2 + 4 + 8 = 14.

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 →