What is a bit array?

Options

  • A. An array in which most of the elements have the same value
  • B. Array in which elements are not present in continuous locations
  • C. Data structure for representing arrays of records
  • D. Data structure that compactly stores bits

Correct Answer (Detailed Explanation is Below)

D. Data structure that compactly stores bits

Detailed Explanation

A bit array (bitset) is a data structure that:

  • Stores bits (0 or 1) instead of full integers

  • Uses very less memory

  • Is commonly used for:

    • Flags

    • Boolean arrays

    • Bloom filters

    • Efficient storage of binary data

OOps! You are currently offline.