7 #define LOADFACTOR 0.75
10 typedef struct chashlistnode {
12 void *val; //this can be cast to another type or used to point to a larger structure
13 struct chashlistnode *next;
16 typedef struct chashtable {
17 chashlistnode_t *table; // points to beginning of hash table
19 unsigned int numelements;
23 /* Prototypes for hash*/
24 chashtable_t *chashCreate(unsigned int size, float loadfactor);
25 unsigned int chashFunction(chashtable_t *table, unsigned int key);
26 unsigned int chashInsert(chashtable_t *table, unsigned int key, void *val);
27 void *chashSearch(chashtable_t *table, unsigned int key); //returns val, NULL if not found
28 unsigned int chashRemove(chashtable_t *table, unsigned int key); //returns -1 if not found
29 unsigned int chashResize(chashtable_t *table, unsigned int newsize);
30 void chashDelete(chashtable_t *table);