I need help with a Computer Science question. All explanations and answers will be used to help me learn.
You are providedand a . You will not need to modify the driver for this assignment, only the hashing header. That header has three functions:
- size_t simpleHash( const string& word, size_t tableSize) Implements the simple hashing scheme from class: It adds the ASCII character value (Links to an external site.) of each letter and returns the sum modulus the table size.
- size_t stdHash( const string& word, size_t tableSize) Uses the string hashing function from the standard library std::hash<string>(). Returns the value modulus the table size.
- size_t userHash( const string& word, size_t tableSize) To be implemented by the student. Create a hash function or find one on the Internet (properly cited, of course) for strings. Remember to return the hash value modulus the table size.
You will execute the hashing test on several table sizes, listed in the Deliverables. For each, report the percentage of collisions for each table size and each algorithm; a graph would also be helpful. Then, answer the following analysis questions in the relevant section of the report listed in the Deliverables section.