Data Structure Questions and Answers-Bit Array

YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

CLICK HERE TO DOWNLOAD

Data Structure Questions and Answers-Bit Array

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is a bit array?
A
Data structure for representing arrays of records
B
Data structure that compactly stores bits
C
An array in which most of the elements have the same value
D
None of the mentioned
Question 1 Explanation: 
It compactly stores bits and exploits bit-level parallelism.

Question 2 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following bitwise operations will you use to set a particular bit to 1?
A
OR
B
AND
C
XOR
D
NOR
Question 2 Explanation: 
1 OR 1 = 1, 0 OR 1 = 1, any bit OR'ed with 1 gives 1.

Question 3 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following bitwise operations will you use to set a particular bit to 0?
A
OR
B
AND
C
XOR
D
NAND
Question 3 Explanation: 
1 AND 0 = 0, 0 AND 0 = 0, any bit AND with 0 gives 0.

Question 4 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following bitwise operations will you use to toggle a particular bit?
A
OR
B
AND
C
XOR
D
NOT
Question 4 Explanation: 
1 XOR 1 = 0, 0 XOR 1 = 1, note that NOT inverts all the bits, while XOR toggles only a specified bit.

Question 5 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is an advantage of bit array?
A
Exploit bit level parallelism
B
Maximal use of data cache
C
Can be stored and manipulated in the register set for long periods of time
D
All of the mentioned
Question 5 Explanation: 
Because bit arrays are compact, they outperform many other data structures.

There are 5 questions to complete.