Bloom filter

A bloom filter is a form of hash table that is used to store the existence of an object within a given set.

Structure
A bloom filter is a large array, with all entries initially set to zero. It can be a bit array, or use larger counters if there is a need for deletion.

To store an entry in a bloom filter, produce a set number of hash entries, and increment the element associated with each hash result by one. To search for an entry, perform the same hashing algorithm, and confirm that all associated elements are non-zero.

Efficiency
O(1) in storing or retrieving information. O(1) is possible for deletion, but only if the bloom filter uses counters rather than bits.

It is not possible to iterate through a bloom filter.

There are no false negatives, but false positives can appear as the table fills.

It is not efficient to split the table in half (or more pieces) and have the hashes point to individual sections within the table; this increases the false positive rate. Likewise, adding a new independent table for some of the hashes may be better handled by increasing the size of the table instead.

Applications

 * Spell check