Hash tables in C?

Permabanned
Joined
19 Dec 2005
Posts
474
Anyone familiar with these?


I'm trying to create a hash table which will store about 20,000 words. I have no idea how to go about this and have not found any useful tutorials, can anybody shed some light on how to do them?

Thanks
 
have a look in hashtable.h for the specs ;)

HashTable * HashTableNew (int size)
Creates a new hash table with the specified number of entries.

void HashTableInsert (HashTable *table, int index, void *element)
Inserts the element into the has table at the appropriate place.

void * HashTableFind (HashTable *table, int index, int(*cmp)(const void *, const int))
Looks up index in the hash table.

void HashTableFree (HashTable *table)
Frees the memory being used by the hash table.

void * HashTableRemove (HashTable *table, int index, int(*cmp)(const void *, const int))
Removes the element from the hash table.

HT
 
Back
Top Bottom