🎙 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 6 of 10

Which of these codes is a prefix code?

Which of these codes is a prefix code?

  1. A.a = 0, b = 01, c = 11
  2. B.a = 0, b = 10, c = 11
  3. C.a = 1, b = 10, c = 0
  4. D.a = 00, b = 0, c = 1
Answer & explanation

Correct answer: a = 0, b = 10, c = 11

In the other three, one code word is the beginning of another (0 of 01, 1 of 10, 0 of 00).

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 →