Hi to all!
I want to make a hash table using a hash function.
I do:
Code:
#include<stdio.h>
#include<stdlib.h>
#define array_size 100
struct hello {
char *name;
struct hello *next;
};
int number = 0;
int hash_function(char *name,int number)
{
int x = number % array_size;
number++;
return x;
}
int main() {
int l = hash_function("Good morning",number);
printf("%d\n",l);
}
Has anyone to suggest me another hash funtion using the char *name as a key and not an integer like number, in order an index of the hash table to be produced?
Because the one i have made it's not a hash funtion