Hash Functions perform two separate functions:
The best strategy is to keep the two functions separate so that there is only one part to change if the size of the table changes.
int hash(char * key) { int val = 0; while(* key != '\0' { val = (val << 4) + (*key); key++; } return val; } int compress (int index, int size) { return abs(index % size); }
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak:
Read More
Follow Us