Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A simple string hashtable implementation using external chaining to handle collision.

License

Notifications You must be signed in to change notification settings

lncrespo/hashtable-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple string hashmap implementation using external chaining to handle collision.

Functions

hash_table_t *hash_table_init(int map_size);

Initialize a new hashmap with a given size and return a pointer to the newly allocated hashmap. Make sure to call hash_table_destroy on the hashmap to free the memory.

bool hash_table_insert(hash_table_t *hash_table, char *key, char *value);

Insert a value into a hashmap using a string as key and a string as value.

void hash_table_delete(hash_table_t *hash_table, char *key);

Delete a key from a hashmap.

char *hash_table_get(hash_table_t *hash_table, char *key);

Get a value from a hashmap using the key.

void hash_table_destroy(hash_table_t *hash_table);

Destroy a hashmap, freeing all buckets and the hashmap itself.

About

A simple string hashtable implementation using external chaining to handle collision.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published