3 ms·
(EDIT: using "mail" because I was using "letter" too much in my description) The way I think of a bloom filter is like at an office mailroom or at post office
by valbaca 4y ago
(EDIT: using "mail" because I was using "letter" too much in my description)
The way I think of a bloom filter is like at an office mailroom or at post office mailbox where mail is grouped by the letters of people's name.
Given someone's name, you can glance and see "Uptrenda? No letters for 'U'" very quickly. This is when a bloom filter returns FALSE. But if they glance and see mail in the "U" box, then they return MAYBE. After a MAYBE, to see if you actually have any mail, they need to actually go through the box (i.e. a bloom filter miss).
Mine are a couple that are present in the Java Collections but I'm always disappointed that other language's don't include them:
- TreeMap/Set: A RedBlack tree. It keeps keys ordered, either naturally or by using the provided Comparator, but has log(n) time on basic ops.
- https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html
- LinkedHashMap/Set: keeps keys ordered by insert order via a linkedlist but can be configured to use access-order making it easy to use as a LRU cache. It keeps O(1) time but is less efficient than HashMap:
- https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html
- dskloet 4y ago> other language's don't include them stl::map and stl::set in C++ are actually a tree map and tree set.