Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago