Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hash table with open addressing. In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double

Hash table with open addressing.

In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double hashing. Create an empty hash table of size m = 13. Each integer of the input will be a key that you should insert into the hash table. Use the double hashing function h(k, i) = (h1(k) + ih2(k)) mod 13 where h1(k) = k mod 13 and h2(k) = 1 + (k mod 11). The input terminates when the key 1 is read (such a key must not be inserted in the hash table). At that point, print the content of the hash table to the screen (see sample input/output below for the printing format). Then, read integers from the input until the number 2 is found (do not process that number). For each number inputted, print the index of the element in the hash table. If the number is not inside the hash table, print NOT FOUND. Finally, read integers from the input until the number 3 is found (do not process that number). For each number inputted, delete it from the hash table (note that the integer might not be in the table). Once the integer 3 is found, print the hash table.

CODE IN C++ PLEASE

image text in transcribed

PLEASE CODE IN C++

Hash table with open addressing In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double hashing. Create an empty hash table of size m = 13, Each integer of the input will be a key that you should insert into the hash table. Use the double hashing function h(k, i) = (h1(k) + iha(k)) mod 13 where hi(k) = k mod 13 and h2(k) = 1 + (k mod 11). The input terminates when the key-1 is read (such a key must not be inserted in the hash table). At that point, print the content of the hash table to the screen (see sample input/output below for the printing format). Then, read integers from the input until the number -2 is found (do not process that number). For each number inputted, print the index of the element in the hash table. If the number is not inside the hash table, print NOT_FOUND. Finally, read integers from the input until the number -3 is found (do not process that number). For each number inputted, delete it from the hash table (note that the integer might not be in the table). Once the integer -3 is found, print the hash table

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

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

1. What is Fog ?

Answered: 1 week ago

Question

How water vapour forms ?

Answered: 1 week ago

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago