Huffman Coding MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

1. Which type of compression ensures that all of the data is kept?

Lossless
Lossy
2. Lossy compression removes data that isn't needed...
True
False
3. Compression makes file sizes...
Bigger
Smaller
Keeps them the same
4. An advantage of lossless compression is...
All data is lost
The file size stays the same
All of the important data is kept
5. A disadvantage of lossless compression is...
There is a big reduction in file size
There is only a slight reduction in file size
There is no reduction in quality
Cannot be used on text or software files
6. The correct encoding of the letter C in this tree is...

11
10
01
00
7. Huffman trees use the _______________ of each character to work out their
encoding.
Frequency
Order in ASCII
Number value
8. How do you move through a Huffman tree?
0 = right 1= left
1 = left 2 = right
0 = left 1 = right
0 = middle 1 = back
9. How do you calculate the number of bits of a body of text in ASCII?
Number of characters * 7
Number of characters (including spaces) *7
bits in Huffman * 7
bits in Huffman / 7
10. Which formula shows how to work out the percentage a file has been
compressed by?
bits in (Huffman *7) /100
bits in ASCii - bits in Huffman
difference in bits / bits in ASCII * 100
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

How many printable characters does the ASCII character set consists of?
a) 120
b) 128
c) 100
d) 98
Which bit is reserved as a parity bit in an ASCII set?
a) first
b) seventh
c) eighth
d) tenth

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
2
d) X

The code length does not depend on the frequency of occurrence of characters.
a) true
b) false
In Huffman coding, data in a tree always occur?
a) roots
b) leaves
c) left sub trees
d) right sub trees
From the following given tree, what is the code word for the character ‘a’?

 SHOW ANSWER
a) 011
b) 010
c) 100
d) 101

From the following given tree, what is the computed codeword for ‘c’?

a) 111
b) 101
c) 110
d) 011

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

An optimal code will always be present in a full tree.


a) true
b) false
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

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)

What is the running time of the Huffman algorithm, if its implementation of the priority queue
is done using linked lists?
a) O(C)
b) O(log C)
c) O(C log C)
d) O(C2)

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. 1.9 bit

B.    8.0 bit

C.   2.1 bit

D.   2.0 bit

A Huffman encoder takes a set of characters with fixed length and produces a set of characters of

A.   fixed length

B.   variable length

C.   random length

D.   constant length

Huffman coding is an encoding algorithm used for

A.     lossy data compression

B.    broadband systems

C.    files greater than 1 Mbit

D.    lossless data compression


The basic idea behind Huffman coding is to

A.       compress data by using more bits to encode more frequently occuring characters

B.       compress data by using fewer bits to encode fewer frequently occuring characters

C.       compress data by using fewer bits to encode more frequently occuring characters

D.       expand data by using fewer bits to encode more frequently occuring characters

Applications of Huffman Coding


(A) Text compression
(B) Audio compression
(C) Lossless image compression
(D) All of the above

Huffman coding technique is adopted for constructing the source code with
________ redundancy.

a. Maximum
b. Constant
c. Minimum
d. Unpredictable

In dictionary techniques for data compaction, which approach of building


dictionary is used for the prior knowledge of probability of the frequently
occurring patterns?
a. Static Dictionary
b. Adaptive Dictionary
c. Both a and b
d. None of the above
1. Data compression means to the file size.
A. Increase
B. Decrease
C. Can’t say
D. None of the above Answer
Correct option is B

2. Data compression and encryption both work on binary


A. False
B. True Answer
Correct option is B

3. What is compression?
A. To compress something by pressing it very hardly
B. To minimize the time taken for a file to be downloaded
C. To reduce the size of data to save space
D. To convert one file to another Answer
Correct option is C

4. Data compression usually works by          .


A. Deleting random bits data
B. Finding repeating patterns Answer
Correct option is B

5. Why data compressed?


A. To optimise the data
B. To reduce secondary storage space
C. To reduce packet congestion on networks
D. Both (B) and (C) 
Correct option is D

6. Which is a type of data compression?


A. Resolution
B. Zipping
C. Inputting
D. Caching 
Correct option is B

7. Data compression involves


A. Compression only
B. Reconstruction only
C. Both compression and reconstruction
D. None of the above 
Correct option is C

8. Based on the requirements of reconstruction, data compression schemes can be


divided into  broad classes
A. 3
B. 4
C. 2
D. 5 
Correct option is C
9. compression is the method which eliminates the data which is not noticeable
and         compression does not eliminate the data which is not
A. Lossless, lossy
B. Lossy, lossless
C. None of these 
Correct option is B

10. compression is generally used for applications that cannot tolerate any difference
between the original and reconstructed data.
A. Lossy
B. Lossless
C. Both
D. None of these 
Correct option is B

11. What is compression ratio?


A. The ratio of the number of bits required to represent the data before compression to
the number of bits required to represent the data after
B. The ratio of the number of bits required to represent the data after compression to
the number of bits required to represent the data before
C. The ratio of the number of bits required to represent the data after reconstruction to
the number of bits required to represent the data before
D. The ratio of the number of bits required to represent the data before reconstruction
to the number of bits required to represent the data after
Correct option is A

12. Suppose storing an image made up of a square array of 256×256 pixels requires
65,536 bytes. The image is compressed and the compressed version requires 16,384
bytes. Then the compression ratio is             .
A. 1:4
B. 4:1
C. 1:2
D. 2:1
Correct option is B

13. Lossy techniques are generally used for the compression of data that originate as
analog signals, such as
A. Speech
B. Video
C. Both
D. None of these 
Correct option is C

14. If fidelity or quality of a reconstruction is , then the difference between the
reconstruction and the original is .
A. High, small
B. Small, small
C. High, high
D. None of the above Answer
Correct option is D

15. The development of data compression algorithms for a variety of data can be
divided into  
A. 2
B. 3
C. 4
D. 5 
Correct option is A

16. Which of the following is true of lossy and lossless compression techniques?
A. Lossless compression is only used in situations where lossy compression techniques
can’t be used
B. Lossy compression is best suited for situations where some loss of detail is tolerable,
especially if it will not be detectable by a human
C. Both lossy and lossless compression techniques will result in some information being
lost from the original file
D. Neither lossy nor lossless compression can actually reduce the number of bits
needed to represent a file
Correct option is B

17. Which of the following would not be suitable for Lossy Compression?
A. Speech
B. Video
C. Text
D. Image
Correct option is C

. Lempel-Ziv algorithm is
a) Variable to fixed length algorithm
b) Fixed to variable length algorithm
c) Fixed to fixed length algorithm
d) Variable to variable length algorithm
Entropy of a random variable is

a. 0

b. 1

c. Infinite

d. Cannot be determined

You might also like