Question: HASH TABLE (THE CODE MUST BE DONE IN C++ . YOU MUST FOLLOW ALL THE INSTRUCTIONS AND SOLVE THE PROBLEM ACCORDING TO THE QUESTION .)
HASH TABLE
(THE CODE MUST BE DONE IN C++ . YOU MUST FOLLOW ALL THE INSTRUCTIONS AND SOLVE THE PROBLEM ACCORDING TO THE QUESTION .)
- .The hash table array has capacity of 10. Capacity is the number of slots present in the array that is used to build the hashtable. The hash table uses quadratic probing to resolve collisions.
a. The hash function returns the absolute value of the key mod the capacity of the hash table
b. Write a function void insert(int hashtable[], int statusArray[], int capacity, int key) function to add a key in the hash table with quadratic probing. The statusArray[] holds the status of the slots. statusArray[i] = 0 means ith slot is empty,1 means ith slot is deleted, and 3 means it is occupied
c. Write the int find (int hashtable[], int capacity, int statusArray[], int key) function to find index of the key in the hash table. If not found, return -1.
d. Write the void delete (int hashtable[], int capacity, int statusArray[], int key) function to delete the key from the hash table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
