HashTable * hash_table_create(size_t n_buckets)
Create a new hash table instance.
void hash_table_remove(HashTable *ht, int key)
Remove a specific value associated with a given key.
void hash_table_free(HashTable *ht)
Free memory of hash table and its contents.
bool hash_table_empty(HashTable *ht)
Check if hash table is empty.
int hash_table_get(HashTable *ht, int key, bool *exists)
Get a value in the hash table.
void hash_table_print_items(HashTable *ht)
Print items of the hash table.
void hash_table_put(HashTable *ht, int key, int value)
Put a value associated to a key.
List * hash_table_keys(HashTable *ht)
Build a list with the hash table keys.
void hash_table_print_keys(HashTable *ht)
Print keys of the hash table.
size_t hash_table_size(HashTable *ht)
Get the number of elements in the hash table.
HashTable * hash_table_copy(HashTable *ht)
Create a hash table as copy of another.
void hash_table_print(HashTable *ht)
Print all buckets of the hash table (one list per line)
Iterator * hash_table_iterator_keys(HashTable *ht)
Iterator * hash_table_iterator_data(HashTable *ht)
struct HashTable HashTable
A basic implementation of a hash table.
Definition hash-table.h:28
struct ListNode List
A singly linked list.
Definition list.h:36
A generic iterator struct.
Definition iterator.h:13