🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Rooted Trees and Huffman Coding: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. In a rooted tree, what is a leaf?
  2. Q2. A full binary tree has 20 internal vertices. How many leaves does it have?
  3. Q3. A full ternary tree has 10 internal vertices. How many vertices does it have in total?
  4. Q4. A knockout chess tournament has 32 players. How many games are played (no draws)?
  5. Q5. What is the minimum height of a binary tree with 100 leaves?
  6. Q6. Which of these codes is a prefix code?
  7. Q7. What does this print? (code)
  8. Q8. In Huffman's algorithm, which two trees are merged at each step?
  9. Q9. Frequencies are p:4, q:2, r:1, s:1. What is the total number of bits in the Huffman encoding?
  10. Q10. What does this print? (code)