Multiple Choice Questions & Answers on Huffman Code

Multiple Choice Questions & Answers on Huffman Code

1. What is the value of redundancy in Huffman Code when the probabilities are negative powers of two?
a) 1
b) 2
c) 3
d) O
Answer: 0

2. How many printable characters does the ASCII character set consists of?
a) 120
b) 128
c) 100
d) 98
Answer: 100

3. A Huffman code: A = 1, B = 000, C = 001, D = 01, P(A) = 0.4, P(B) = 0.1, P(C) = 0.2, P(D) = 0.3 The average number of bits per letter is
a) 8.0 bit
b) 1.9 bit
c) 2.0 bit
d) 2.1 bit
Answer: 1.9 bit

4. An alphabet consist of the letters al, a2, a3, a4 and a5. The probability of occurrence is P(al)=P(a3)=0.2, P(a2)= 0.4, P(C) = 0.2 and P(a4) = P(a5)= 0.1.The Huffman code is
a) al = 1, a2-01, a3= 000, a4 = 0010, a5-0011
b) al 01, a2=1, a3= 000, a4 = 0010, a5-0011 
c) al 0011, a2=1, a3= 000, a4 = 0010, a5-01
d) al 01, a2=1, a3= 000, a4 = 0011, a5-0010
Answer: al 01, a2=1, a3= 000, a4 = 0010, a5-0011

5. Length of Huffman Code is:
a) H(S)<= 1 < (H(S) +1
b) H(S)>= 1 < (H(S) +1
c) H(S)<= 1< (H(S)
d) None of these
Answer: H(S)<= 1 < (H(S) +1

6. How many bits are needed for standard encoding if the size of the character set is X?
a) log X
b) X+1
c) 2X
d) X2
Answer: log X

7. Running time of the Huffman algorithm, if its implementation of the priority queue is done using linked lists
a) O(log(C))
b) O(Clog(C))
c) O(C²)
d) O(C)
Answer: O(C²)

8. What is the running time of the Huffman encoding algorithm?
a) O(C)
b) O(log C)
c) O(C log C)
d) O( N log C)
Answer: O(C log C)

9. What will be the cost of the code if character ci is at depth di and occurs at frequency fi?
a) cifi
b) ∫cifi
c) ∑fidi
d) fidi
Answer: ∑fidi

10. In Huffman coding, data in a tree always occur?
a) roots
b) leaves
c) left sub trees
d) right sub trees
Answer: leaves

11. Which bit is reserved as a parity bit in an ASCII set?
a) first
b) seventh
c) eighth
d) tenth
Answer: eighth

12. The type of encoding where no character code is the prefix of another character code is called?
a) optimal encoding
b) prefix encoding
c) frequency encoding
d) trie encoding
Answer: prefix encoding

13. Which of the following algorithms is the best approach for solving Huffman codes?
a) exhaustive search
b) greedy algorithm
c) brute force algorithm
d) divide and conquer algorithm
Answer: greedy algorithm

14. The difference between the entropy and the average length of the Huffman code is called
a) Rate
b) Redundancy
c) Power
d) None of these
Answer: Redundancy

15. In Huffman coding, data in a tree always occur in
a) Leaves
b) Roots
c) Left sub trees
d) None of these
Answer: Leaves

16. Which of the following is not a part of the channel coding?
a) rectangular code
b) Checksum checking
c) Hamming code
d) Huffman code
Answer: Huffman code
Correct option is D

17. The Huffman Coding Algorithm was Developed by:
a) Edwood Huffman
b) David Huffman
c) Elsevier Huffman
d) None of the Above 
Answer: David Huffman

18. Huffman coding is an encoding algorithm used for
a) lossless data compression
b) broadband systems
c) files greater than 1 Mbit
d) lossy data compression
Answer: lossless data compression

19. A Huffman encoder takes a set of characters with fixed length and produces a set of characters of
a) random length
b) fixed length
c) variable length
d) constant length
Answer: variable length
 
20. An optimal code will always be present in a full tree.
a) true
b) false
Answer: true

21. The code length depends on the frequency of occurrence of characters.
a) true
b) false
Answer: true

22. In an ASCII character set, seven bits are reserved for character representation while the eighth bit is a parity bit
a) true
b) false
Answer: true

Comments