Question: You are working on a web crawler application that needs to efficiently check whether a URL has been previously processed to avoid redundant processing. To

You are working on a web crawler application that needs to efficiently check whether a URL has been
previously processed to avoid redundant processing. To optimize this process, you decide to implement a
simple Bloom filter for URL caching. Your task is to create a program that adheres to the following
specifications:
Implement a Bloom filter with a configurable size and number of hash functions for URL caching.
Develop functions to add URLs to the Bloom filter and check whether a URL is likely to be in the filter.
Ensure that the implementation provides a consistent output for the same set of operations across different environments.
Your program should accept input in the following format:
1. For adding a URL: ADD url
2. For checking URL existence: CONTAINS url
Your program should produce output in the following format:
1. For adding a URL: Added: url
2. For checking URL existence: URL Existence Check for url: True/False
Sample Input
Input will be taken from the file(inputPS03.txt).
ADD https://example.com/page1
CONTAINS https://example.com/page1
ADD https://example.com/page2
CONTAINS https://example.com/page2
CONTAINS https://example.com/page3
Note that the input/output data shown here is only for understanding and testing, the actual file used
for evaluation will be different.
Sample Output
Display the output in outputPS03.txt.
Added: https://example.com/page1
URL Existence Check for https://example.com/page1: True
Added: https://example.com/page2
URL Existence Check for https://example.com/page2: True
URL Existence Check for https://example.com/page3: False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!