From 18e0dde13bb2c258d90a33c441965ac323bd0cfd Mon Sep 17 00:00:00 2001 From: isidroas Date: Sat, 8 Apr 2023 16:48:15 +0200 Subject: [PATCH] Update data_structures/hashing/bloom_filter.py Co-authored-by: Christian Clauss --- data_structures/hashing/bloom_filter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data_structures/hashing/bloom_filter.py b/data_structures/hashing/bloom_filter.py index 150461a96..526833c01 100644 --- a/data_structures/hashing/bloom_filter.py +++ b/data_structures/hashing/bloom_filter.py @@ -5,15 +5,15 @@ The use of this data structure is to test membership in a set. Compared to Python's built-in set() it is more space-efficient. In the following example, only 8 bits of memory will be used: >>> bloom = Bloom(size=8) ->>> "Titanic" in bloom -False -Initially the filter contains all zeros: +Initially, the filter contains all zeros: >>> bloom.bitstring '00000000' When an element is added, two bits are set to 1 since there are 2 hash functions in this implementation: +>>> "Titanic" in bloom +False >>> bloom.add("Titanic") >>> bloom.bitstring '01100000'