Table of Contents

## 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: **Finding the number of 1 bit in a bit array

**Which of the following is not an advantage of bit array?**

Accessing Individual Elements is easy

**Which of the following bitwise operations will you use to toggle a particular bit?**

XOR

**Which of the following bitwise operations will you use to set a particular bit to 0?**

AND

**Which of the following bitwise operations will you use to set a particular bit to 1?**

OR

**What is a bit array?**

Data structure that compactly stores bits

**Which class in Java can be used to represent bit array?**

BitSet

**Which of the following bitwise operator will you use to invert all the bits in a bit array?**

NOT

**What does Hamming weight/population count mean in Bit arrays?**

**What does Hamming weight/population count mean in Bit arrays?**

Finding the number of 1 bit in a bit array

**Which one of the following operations returns the first occurrence of bit 1 in bit arrays?**

Find First One