+1-617-874-1011 (US)

  +44-117-230-1145 (UK)

Hash Functions Homework Help

Hash Functions perform two separate functions:

  • Convert the string to a key.
  • Constrain the key to a positive value less than the size of the table.

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.

Hash Functions - Example

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);
}

hash function example
Hash Functions Homework Help

Following are some of the topics in Hash Tables in which we provide homework and assignment help:

Open Hashing

Hash Functions

Hashing Problem