Develop a cpp program to find how many different hash values can generated for all N-char strings, N < 5. The hash function is given below.
A N-char string has only N a-z and A-Z characters. For instance, the set of N=1 includes all strings from A to z (A, B, C, ... , X, Y, Z, a, b, c, ..., x, y, z); N=2 has AA to zz, N=3, AAA to zzz.
Expected outcome of the your program is the following:
N=1, 52 strings map to ?? different hash values
N=2, ?? strings map to ?? different hash values
N=3, ?? strings map to ?? different hash values
N=4, ?? strings map to ?? different hash values
/--- Hashing Function--- /
int hash(string key)
int hash = 0;
for(int i = 0; i < [login to view URL](); i++)
hash = (hash * 7) + key[i];
6 freelancers estão ofertando em média $22 para esse trabalho
Hello. How are you. I'm software engineer and algorithm expert. I have many experiences in c, c++, c#, java, python, node.js. I can complete your project successfully. Thanks.