# YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

## Data Structure Questions and Answers-Bit Array

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What is a bit array?

Data structure for representing arrays of records | |

Data structure that compactly stores bits | |

An array in which most of the elements have the same value | |

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?

OR | |

AND | |

XOR | |

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?

OR | |

AND | |

XOR | |

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?

OR | |

AND | |

XOR | |

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?

Exploit bit level parallelism | |

Maximal use of data cache | |

Can be stored and manipulated in the register set for long periods of time | |

All of the mentioned |

Question 5 Explanation:

Because bit arrays are compact, they outperform many other data structures.

There are 5 questions to complete.