Back to Academy
advanced
Bloom Filter
A Bloom Filter is a space-efficient probabilistic data structure used to test whether an element is a member of a set. It can produce false positives but never false negatives, meaning it may incorrectly say an element exists, but will never miss an element that was actually added. It uses multiple hash functions to set bits in a fixed-size bit array.
Use Cases
- •Web browser safe-browsing URL checks
- •Database query optimization to avoid unnecessary disk reads
- •Spam filtering and duplicate detection in large-scale systems
Complexity Analysis
| Metric | Best | Average | Worst |
|---|---|---|---|
| Time | O(k) | O(k) | O(k) |
| Space | O(m) | ||
Visualization
-
[0]-
[1]-
[2]-
[3]-
[4]-
[5]-
[6]Implementation
Output
Click "Run Code" to see output...