Overview
Bitmask Subset Enumeration loops over integer masks and interprets each bit as selecting or excluding an element, producing all subsets or all submasks of a set.
Enumerates subsets by treating integers as bit masks.
Compact metadata for implementation and discovery.
Bitmask Subset Enumeration loops over integer masks and interprets each bit as selecting or excluding an element, producing all subsets or all submasks of a set.
Quick facts
Runtime and memory behavior at a glance.
Best
O(2^n) for all subsets
Average
O(2^n) for all subsets; O(3^n) for nested mask/submask enumeration
Worst
O(2^n) for all subsets; O(3^n) for all masks with all submasks
Space
O(1) iterator state plus output storage if materialized
Show bit positions toggling through subset masks and the descending submask iteration pattern.
Bitmask Subset Enumeration covers explicit subset and submask iteration using integer masks; a stronger textbook or paper source would improve the active application package.
What each reference supports for this entry.
Supports the standard submask iteration idiom `(s - 1) & m`, its descending-order behavior, and O(3^n) nested mask/submask iteration.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Bitmask Subset Enumeration uses bit operations to represent membership and advance through subsets or submasks.