Question: In C + + , we will be implementing a hash table that stores strings. I need help with creating the hash function: int hash

In C++, we will be implementing a hash table that stores strings. I need help with creating the hash function: int hash(string s) that converts strings into indexes. This function must COMPLETELY follow these principles: 1) Determinism (same input must map to the same index),2) Speed (method MUST run in O(1) time),3) Spread (related but different inputs should map to unrelated indexes, and all indexes must be used). Table must have exactly 31 indexes.

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 Programming Questions!