I would like to write a program In C that reads 12 or so names. I'd like to insert the names according to a hash function. The collisions is solved using the
chaining method as shown below. The hash function should use the name as the key and returns a number between 0 and 2. The hash function should use all the characters of the name in order to produce the hashing index.
Example: producing the index using the first and second character.
....
char name [10];
printf ( “ enter a name \n”);
scanf (“%s”, name );
verdi = name[0] + name[1];
position = verdi % 2;
Can anyone help me get started?
chaining method as shown below. The hash function should use the name as the key and returns a number between 0 and 2. The hash function should use all the characters of the name in order to produce the hashing index.
Example: producing the index using the first and second character.
....
char name [10];
printf ( “ enter a name \n”);
scanf (“%s”, name );
verdi = name[0] + name[1];
position = verdi % 2;
Can anyone help me get started?