Question: : (6 points) Typical hash function for a string key. Fill the missing line of code. Th hash function should compute a polynomial of the
: (6 points) Typical hash function for a string key. Fill the missing line of code. Th hash function should compute a polynomial of the form: s[0] + s[1] * 37 + s[2] * 372 + s[3] * 373 + + s[n-l] * 37", where s[i] is the it character of string s, for i = 0, . . ., n-1. The length of string s is n. si size_t hash(const string &s) 1f const int n- s.length); for (int i = n-1; >= 0; --) { // Insert missing code below. hash value-... return hash value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
