

MCQOPTIONS
Saved Bookmarks
This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which one of the following operations returns the first occurrence of bit 1 in bit arrays? |
A. | Find First Zero |
B. | Find First One |
C. | Counting lead Zeroes |
D. | Counting lead One |
Answer» C. Counting lead Zeroes | |
2. |
Bit fields and Bit arrays are same. |
A. | True |
B. | False |
Answer» C. | |
3. |
What does Hamming weight/population count mean in Bit arrays? |
A. | Finding the number of 1 bit in a bit array |
B. | Finding the number of 0 bit in a bit array |
C. | Finding the sum of bits in a bit array |
D. | Finding the average number of 1’s and 0’s in bit arrays |
Answer» B. Finding the number of 0 bit in a bit array | |
4. |
Run-Length encoding is used to compress data in bit arrays. |
A. | True |
B. | False |
Answer» B. False | |
5. |
Which of the following bitwise operator will you use to invert all the bits in a bit array? |
A. | OR |
B. | NOT |
C. | XOR |
D. | NAND |
Answer» C. XOR | |
6. |
Which of the following is/are not applications of bit arrays? |
A. | Used by the Linux kernel |
B. | For the allocation of memory pages |
C. | Bloom filter |
D. | Implementation of Vectors and Matrices |
Answer» E. | |
7. |
Which of the following is not a disadvantage of bit array? |
A. | Without compression, they might become sparse |
B. | Accessing individual bits is expensive |
C. | Compressing bit array to byte/word array, the machine also has to support byte/word addressing |
D. | Storing and Manipulating in the register set for long periods of time |
Answer» E. | |
8. |
Which of the following is not 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. | Accessing Individual Elements is easy |
Answer» E. | |
9. |
Which of the following bitwise operations will you use to set a particular bit to 0? |
A. | OR |
B. | AND |
C. | XOR |
D. | NAND |
Answer» C. XOR | |
10. |
Which class in Java can be used to represent bit array? |
A. | BitSet |
B. | BitVector |
C. | BitArray |
D. | BitStream |
Answer» B. BitVector | |
11. |
What are some of the applications of bit arrays? |
A. | Used by the Linux kernel |
B. | For the allocation of memory pages |
C. | Bloom filter |
D. | All of the mentioned |
Answer» E. | |
12. |
Identify the disadvantages of bit array. |
A. | Without compression, they might become sparse |
B. | Accessing individual bits is expensive |
C. | Compressing bit array to byte/word array, the machine also has to support byte/word addressing |
D. | All of the mentioned |
Answer» E. | |
13. |
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 |
Answer» E. | |
14. |
Which of the following bitwise operations will you use to toggle a particular bit? |
A. | OR |
B. | AND |
C. | XOR |
D. | NOT |
Answer» D. NOT | |
15. |
Which of the following bitwise operations will you use to set a particular bit to 1? |
A. | OR |
B. | AND |
C. | XOR |
D. | NOR |
Answer» B. AND | |
16. |
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 |
Answer» C. An array in which most of the elements have the same value | |