Implementation of Bloom Filter in Java
- Bloom filter is a probabilistic data structure which is used to find association of a member in a set.
- Bloom filter is space optimized because it uses bits(after hasing key) to store a key in a set.
- If Bloom filter return FALSE for association of a member in a set,that means member is not part of that set. True positive rate of bloom filter is 1.
- If Bloom filter return TRUE for association of a member in a set, that means member might be or might not be part of that set. False positive rate of bloom filter is greater than 0.
- The false positive rate depends on multiple factors like type of hash function, number of hash function, no of insertions etc..
- Guava library provides implementation of Bloom Filter in Java. Check this
![image](https://private-user-images.githubusercontent.com/26311536/248563075-2ba17e96-b4cc-4b1c-967e-23fdbd93bf0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMjIyMjIsIm5iZiI6MTcyNTMyMTkyMiwicGF0aCI6Ii8yNjMxMTUzNi8yNDg1NjMwNzUtMmJhMTdlOTYtYjRjYy00YjFjLTk2N2UtMjNmZGJkOTNiZjBmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAzVDAwMDUyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4NWM5NmFjNGQ2NWU1MjhkMzJmNDkzOTdhZjI3YmI4YzA5ZTQ3OWEyYTRkMWRiMGM4Nzc3ZTgzNGM0YjQ4MTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7B2nADyZ-FSTYvUxYOPNGLtTT_ud0OHFP9GORCjFvUk)
![image](https://private-user-images.githubusercontent.com/26311536/248563167-66807470-06aa-4fa8-ab8c-4d5011a679df.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMjIyMjIsIm5iZiI6MTcyNTMyMTkyMiwicGF0aCI6Ii8yNjMxMTUzNi8yNDg1NjMxNjctNjY4MDc0NzAtMDZhYS00ZmE4LWFiOGMtNGQ1MDExYTY3OWRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAzVDAwMDUyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1YTg2ZWU2ZTE5Yjk5YzE3MmEzZWNjYWU0MGVjN2U5NDFkZWI0ZmJmYTUzMzMwMmNhNWIzMGEyNWVmMTM4MDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VEPl89tKkbQebLPEK2B2K8mId-gtZjqasPqFUsE6I9w)
![image](https://private-user-images.githubusercontent.com/26311536/249862113-09a394af-87f8-496f-a27b-0a5118e2a4ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMjIyMjIsIm5iZiI6MTcyNTMyMTkyMiwicGF0aCI6Ii8yNjMxMTUzNi8yNDk4NjIxMTMtMDlhMzk0YWYtODdmOC00OTZmLWEyN2ItMGE1MTE4ZTJhNGZmLn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