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