Question: 1) Write a C++ code for the following question Consider the implementation of a closed hash table a[0]..a[n-1] to store positive integers, using quadratic probing
1) Write a C++ code for the following question
Consider the implementation of a closed hash table a[0]..a[n-1] to store positive integers, using quadratic probing to resolve collisions. A value of 0 indicates that a hash table location is currently unused. The hash function is h(x) = x % n . Write a function that is given a new entry x to be inserted. The function returns the index of where its placed in the array. Return -1 if no empty slot is found. The average runtime of your routine should be according to the usual hashing standards.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
