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