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