BitSet
A bitset is a data structure that compactly stores a sequence of bits, typically used to represent a set of boolean flags or membership in a fixed universe. Each bit position corresponds to an element, and the bit value indicates presence or state. Bitsets are usually implemented as an array of unsigned integers, with individual bits packed into the words for memory efficiency and fast bitwise operations.
Common operations include setting a bit to one, clearing a bit to zero, toggling a bit, and
Bitsets can be fixed-size or dynamic. Fixed-size bitsets allocate space for a predefined number of bits, with
Common language implementations include: C++ has std::bitset for fixed-size sets and Boost dynamic_bitset for runtime size;
Performance characteristics are favorable for bitwise operations, which run on machine words and are typically O(number