Create a hash table class/struct. Define an array that holds 27 elements. Define a function called Hash(int) -This function returns the modulo of that int
Create a hash table class/struct.
Define an array that holds 27 elements.
Define a function called Hash(int)
-This function returns the modulo of that int by the size of the table (array).
Define an add function that takes an integer.
-This function takes the integer, determines the hash of that number by calling the above hash function, then adds it to the table using linear probing for collision resolution.
Define a function that looks up a value, it takes an integer, return -1 if the value is not in the table.
Create a main that allows the user to add and lookup items in the table.
Please write in C++. Thumbs up if everything is correct. Thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To create a hash table class in C and meet all the specified requirements lets go step by step Step 1 Define the Hash Table Class Well start by defini...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