Overview
Bitset operations store Boolean membership in bits rather than separate objects. Logical word operations such as AND, OR, XOR, and shifts then update or compare many elements at once.
Represents dense sets as machine-word bits so membership and set operations run in word-sized chunks.
Compact metadata for implementation and discovery.
Bitset operations store Boolean membership in bits rather than separate objects. Logical word operations such as AND, OR, XOR, and shifts then update or compare many elements at once.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(n / w)
Worst
O(n / w)
Space
O(n / w)
Show representing membership as machine-word bits for parallel logical operations on a small dense set operations example.
Bitsets are fastest when the universe is stable, compact, and small enough to keep masks cache-friendly.
What each reference supports for this entry.
Reference for packed-bit operations, masks, shifts, and word-level set manipulation.
Good next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Foundation
Bitsets trade sparse key flexibility for compact constant-time membership over a fixed universe.
Compare with thisProcedural Generation · Extended
Bitmask Subset Enumeration uses bit operations to represent membership and advance through subsets or submasks.
Compare with thisBitsets trade sparse key flexibility for compact constant-time membership over a fixed universe.
Bloom filters also use bit arrays, but allow probabilistic membership over hashed positions.
Sketch structures commonly use compact arrays and hash-derived positions like bitset-style representations.