3 ms·
This is quite nice There are many flavours of bitsets. Sometimes it's not the largest element that's a limit but the cardinality. You should also take note of
by toolslive 12y ago
This is quite nice
There are many flavours of bitsets. Sometimes it's not the largest element that's a limit but the cardinality. You should also take note of the cost of clearing a bitset: This cost is almost never included in performance considerations. For instance, when you're making small random subsets (of size k) of a set (size n) you might be tempted to use a bitset and recycle it between subsets.
you typically end up with a performance of k.O(1) for set but O(n) for a clear.
pick your poison ;)