Question: c++ code The pseudo code of the hash function is given as follows. int hash(const string &key) { int value = 1; for (int position

c++ code The pseudo code of the hash function is given as follows. int hash(const string &key) { int value = 1; for (int position = 0; position < max_key_length; position++) value *= key[position]; value %= hash_size; if (value < 0) value += hash_size; return value; } a. the hash function b. A constructor that takes an integer parameter specifying the hash table size (hash_size). c. The retrieve() method that takes a string key as the input and returns the location (index) of the key in the hash table. If the hash table does not have the key, retrieve() returns -1. d. The insert() method that takes a string key as the input and inserts it into the hash table. If the key already exists in the table or if the table is full, the insertion will not be completed and -1 is returned. If the key is inserted, the location (index) of the key in the hash table is returned. e. Class Hash_table1 uses "quadratic probing" for collision resolution. max width of the key is 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!