# Bit Array MCQ and Answers

## [Solved] Which one of the following operations returns the first occurrence of bit 1 in bit arrays?

Which one of the following operations returns the first occurrence of bit 1 in bit arrays? a) Find First Zerob) Find First Onec) Counting lead Zeroesd) Counting lead One Answer: bExplanation: Find First One operation returns the first occurrence of bit 1 in the bit array. Find First Zero operation returns the first occurrence of …

## [Solved] Bit fields and Bit arrays are same.

Bit fields and Bit arrays are same. a) Trueb) False Answer: bExplanation: Bit field contains the number of adjacent computer locations used to store the sequence of bits to address a bit or groups of bits. Bit array is an array that stores combinations of bit 0 and bit 1. Thus, bit fields and Bit …

## [Solved] What does Hamming weight/population count mean in Bit arrays?

What does Hamming weight/population count mean in Bit arrays? a) Finding the number of 1 bit in a bit arrayb) Finding the number of 0 bit in a bit arrayc) Finding the sum of bits in a bit arrayd) Finding the average number of 1’s and 0’s in bit arrays Answer: aExplanation: Hamming/ population count …

## [Solved] Run-Length encoding is used to compress data in bit arrays.

Run-Length encoding is used to compress data in bit arrays. a) Trueb) False Answer: aExplanation: A bit array stores the combinations of bit 0 and bit 1. Each bit in the bit array is independent. Run Length encoding is a data compression technique in which data are stored as single value and number of times …

## [Solved] Which of the following bitwise operator will you use to invert all the bits in a bit array?

Which of the following bitwise operator will you use to invert all the bits in a bit array? a) ORb) NOTc) XORd) NAND Answer: bExplanation: NOT operation is used to invert all the bits stored in a bit array.Eg: NOT (10110010) = 01001101.

## [Solved] Which class in Java can be used to represent bit array?

Which class in Java can be used to represent bit array? a) BitSetb) BitVectorc) BitArrayd) BitStream Answer: aExplanation: The BitSet class creates a special type of array that can hold bit values.

## [Solved] Which of the following is/are not applications of bit arrays?

Which of the following is/are not applications of bit arrays? a) Used by the Linux kernelb) For the allocation of memory pagesc) Bloom filterd) Implementation of Vectors and Matrices Answer: dExplanation: Normal Arrays are used to implement vectors and matrices. Bit arrays have no prominent role. The remaining all are applications of Bit Arrays.

## [Solved] Which of the following is not a disadvantage of bit array?

Which of the following is not a disadvantage of bit array? a) Without compression, they might become sparseb) Accessing individual bits is expensivec) Compressing bit array to byte/word array, the machine also has to support byte/word addressingd) Storing and Manipulating in the register set for long periods of time Answer: dExplanation: Bit arrays allow small …

## [Solved] Which of the following is not an advantage of bit array?

Which of the following is not an advantage of bit array? a) Exploit bit-level parallelismb) Maximal use of data cachec) Can be stored and manipulated in the register set for long periods of timed) Accessing Individual Elements is easy Answer: dExplanation: Individual Elements are difficult to access and can’t be accessed in some programming languages. …

## [Solved] Which of the following bitwise operations will you use to toggle a particular bit?

Which of the following bitwise operations will you use to toggle a particular bit? a) ORb) ANDc) XORd) NOT Answer: cExplanation: 1 XOR 1 = 0, 0 XOR 1 = 1, note that NOT inverts all the bits, while XOR toggles only a specified bit.