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