Skip to content

Commit 18e0dde

Browse files
isidroascclauss
andauthored
Update data_structures/hashing/bloom_filter.py
Co-authored-by: Christian Clauss <[email protected]>
1 parent 313c80c commit 18e0dde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: data_structures/hashing/bloom_filter.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
Compared to Python's built-in set() it is more space-efficient.
66
In the following example, only 8 bits of memory will be used:
77
>>> bloom = Bloom(size=8)
8-
>>> "Titanic" in bloom
9-
False
108
11-
Initially the filter contains all zeros:
9+
Initially, the filter contains all zeros:
1210
>>> bloom.bitstring
1311
'00000000'
1412
1513
When an element is added, two bits are set to 1
1614
since there are 2 hash functions in this implementation:
15+
>>> "Titanic" in bloom
16+
False
1717
>>> bloom.add("Titanic")
1818
>>> bloom.bitstring
1919
'01100000'

0 commit comments

Comments
 (0)