String hashing is important as a lot of data online can be represented as text. However, we want our hashing of text to be fast and evenly distribute the values. In this assignment, we will investigate hashing behavior on strings.

Home Blog String hashing is important as a lot of data online can be represented as text. However, we want our hashing of text to be fast and evenly distribute the values. In this assignment, we will investigate hashing behavior on strings.

String hashing is important as a lot of data online can be represented as text. However, we want our hashing of text to be fast and evenly distribute the values. In this assignment, we will investigate hashing behavior on strings.

I need help with a Computer Science question. All explanations and answers will be used to help me learn.

You are provided a driver file and a hashing header file. 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.

https://en.wikipedia.org/wiki/ASCII

Add comment

Academic Research Pro