hash.chash.c is a C hash table with quadratic probing. | |
Download |
hash.c Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- David Crawshaw
- Publisher web site:
- http://www.zentus.com/c/hash.html
hash.c Tags
hash.c Description
hash.c is a C hash table with quadratic probing. hash.c is a C hash table with quadratic probing. hash.c is very small and easy to use.Compile: gcc -c hash.cThis hashtable uses C-strings for keys and quadratic probing instead of linked-list chains. It depends only on ANSI C and so should work anywhere.APIhash * hash_new ( unsigned int size ) Create new hashtable.void hash_destroy ( hash *h ) Free hashtable.int hash_add ( hash *h , const char *key , void *value ) Add key/value pair.void * hash_get ( hash *h , const char *key ) Return value matching given key.void * hash_remove ( hash *h , const char *key ) Remove key from table, returing value.unsigned int hash_size ( hash *h ) Returns total number of keys.What's New in This Release:· This release uses exponentiation instead of xor in hashing.· It adds a hash_destroy function.
hash.c Related Software