Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int getHash(const char* x) {
- int res = 0;
- for (int i = 0; i < MAX_STR_LEN; i++) {
- if (x[i] == '\0') break;
- res = 31 * res + x[i];
- }
- return abs(res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement