Answered step by step
Verified Expert Solution
Link Copied!

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 file(ComputedChaining.cpp), 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. (10 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. (25 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. (35 pts)
find_num_probes: 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. (30 pts)

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What strategy and techniques is Frank using on Don?

Answered: 1 week ago