Fraction of bits currently set (0-1); rises with false-positive rate as the filter fills.
StaticoptimalDerives the optimal size and numHashes for a given expected workload.
Tests whether value may be in the filter.
false is definitive (never in the set);true is probabilistic (may be a false positive).Clears the filter by resetting the underlying bit array.
Probabilistic set membership structure. Trades exactness for space:
addis O(k),hasis O(k) with no false negatives but a tunable false-positive rate, and storage is a fixed-size bit array regardless of how many elements are added.Uses the Kirsch-Mitzenmacher double-hashing technique to derive all
numHashesindices from a single two-part hash, avoiding the need for k independent hash functions.Example
See
https://en.wikipedia.org/wiki/Bloom_filter