Created
May 20, 2019 19:04
-
-
Save viveksyngh/9ef259b9da2e2a9848f6bbfda23fdaa9 to your computer and use it in GitHub Desktop.
Bloom Filter Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test(item): | |
results = [] | |
for hash_function in hash_functions: | |
index = hash_function(item) % m | |
if bit_array[index]: | |
results.append(True) | |
else: | |
results.append(False) | |
return reduce(lambda a, b : a & b, results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment