Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bloom filters #162

Merged
merged 7 commits into from
Apr 26, 2020
Merged

Bloom filters #162

merged 7 commits into from
Apr 26, 2020

Conversation

ashokdey
Copy link
Member

@ashokdey ashokdey commented Dec 7, 2019

💮 What's Inside?

  • Bloom Filters
  • APIs are:
    • add(element)
    • containts(element)

For more details: Bloom Filters on Wikipedia

🎉

@ashokdey ashokdey requested a review from TheSTL December 7, 2019 11:48
@ashokdey ashokdey self-assigned this Dec 7, 2019
@@ -36,12 +36,14 @@ class HashTable {
for (let i = 0; i < loopTill; i += 1) {
const char = stringKey[i];
const value = char.charCodeAt(0) - 96;
index = (index * PRIME_MULTIPLIER + value) % this.bucket.length;
// eslint-disable-next-line no-bitwise
index &= index;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why to use bitwise AND operation ??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merely an operation can be skipped

@ashokdey ashokdey merged commit ec470dc into master Apr 26, 2020
@ashokdey ashokdey deleted the bloom-filters branch April 26, 2020 14:23
@ashokdey ashokdey restored the bloom-filters branch September 6, 2020 15:52
@ashokdey ashokdey deleted the bloom-filters branch September 6, 2020 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants