We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 313c80c commit 18e0ddeCopy full SHA for 18e0dde
data_structures/hashing/bloom_filter.py
@@ -5,15 +5,15 @@
5
Compared to Python's built-in set() it is more space-efficient.
6
In the following example, only 8 bits of memory will be used:
7
>>> bloom = Bloom(size=8)
8
->>> "Titanic" in bloom
9
-False
10
11
-Initially the filter contains all zeros:
+Initially, the filter contains all zeros:
12
>>> bloom.bitstring
13
'00000000'
14
15
When an element is added, two bits are set to 1
16
since there are 2 hash functions in this implementation:
+>>> "Titanic" in bloom
+False
17
>>> bloom.add("Titanic")
18
19
'01100000'
0 commit comments