Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 linear probing for collision resolution. max width of the key is 6

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

American Public School Finance

Authors: William A. Owings, Leslie S. Kaplan

1st Edition

0495807834, 9780495807834

Students also viewed these Databases questions

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago