Huffman Coding
  • 1. Who introduced Huffman Coding?
A) Robert Johnson
B) John Smith
C) David A. Huffman
D) Alice Jones
  • 2. Which type of encoding does Huffman Coding use?
A) Variable-length encoding
B) Binary encoding
C) ASCII encoding
D) Fixed-length encoding
  • 3. In Huffman Coding, what type of symbols have shorter codes?
A) Symbols starting with A
B) Frequent symbols
C) Rare symbols
D) Symbols at odd indices
  • 4. What is a prefix code in Huffman Coding?
A) A code where no codeword is a prefix of another
B) A code with equal-length codewords
C) A code that uses only 0s and 1s
D) A code that starts with the same symbol
  • 5. What is a Huffman tree also known as?
A) Complete tree
B) Optimal binary tree
C) Balanced tree
D) Perfect tree
  • 6. How is the efficiency of Huffman Coding usually measured?
A) Compression ratio
B) Encoding speed
C) Memory consumption
D) Number of symbols
  • 7. What's the worst-case time complexity of building a Huffman tree?
A) O(n)
B) O(n2)
C) O(n log n)
D) O(log n)
  • 8. Which step comes after building the Huffman tree in the encoding process?
A) Assigning binary codes to symbols
B) Building a linked list
C) Calculating symbol frequencies
D) Compressing the data
  • 9. In Huffman Coding, what symbol is typically assigned the shortest code?
A) Least frequent symbol
B) Symbol with the longest name
C) Symbol with a prime number
D) Most frequent symbol
  • 10. Which data structure is commonly used to implement a priority queue in Huffman Coding?
A) Binary heap
B) Linked list
C) Stack
D) Queue
  • 11. What kind of codes does Huffman Coding produce?
A) Infix codes
B) Suffix codes
C) Postfix codes
D) Prefix codes
Created with That Quiz — the math test generation site with resources for other subject areas.