Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your task is to write member functions of a class that stores numbers using Computed Chaining Insertion. A header file with the class definition inside;
Your task is to write member functions of a class that stores numbers using Computed Chaining
Insertion. A header file with the class definition inside; a source file, and a main file are provided
to you. In the source fileComputedChainingcpp I defined some useful functions beforehand.
You have three functions to implement:
isThisYourHome: The parameter passed to the function represents the
key which is inserted previously into the hash table. It should return a boolean value whether the
key is in the address of its hash function. You should note that this function should return true
when there is no collision. pts
insert: The parameter passed is the value to be inserted into the hash table. Write
the necessary code to insert this value into the hash table using Computed Chaining. You
should utilize from functions given to calculate the index you will insert into.
For the first part, you should consider adding the key to the chain when the
collision occurs. pts
Secondly, you will implement the case when you move the key which is not at its
home address. To simplify the question, some comments are added to
ComputedChaining.cpp You can follow the steps defined there. pts
findnumprobes: This functions job is to find out how many calculations you make to
get the key. Hint: The index of the key in the chain is related to the probe. pts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started