exercises/ex07/hash.c
void map_add(Map *map, Hashable *key, Value *value)
{

    // Put new item in a bucket based on its hash
    int hash_idx = key->hash(key) % map->n;

    // Make a new node pointing to the value in map it's being inserted before
    Node* new_node = make_node(key, value, map->lists[hash_idx]);

    // Replace map value with the new node
    map->lists[hash_idx] = new_node;

}
/* Adds a key-value pair to a map. */
Adds a key-value pair to a map.
Adds a key - value pair to a map .
void map_add(Map *map, Hashable *key, Value *value)
{
    int hash_idx = key->hash(key) % map->n;
    Node* new_node = make_node(key, value, map->lists[hash_idx]);
    map->lists[hash_idx] = new_node;
}
void map_add ( Map * map , Hashable * key , Value * value ) { int hash_idx = key -> hash ( key ) % map -> n ; Node * new_node = make_node ( key , value , map -> lists [ hash_idx ] ) ; map -> lists [ hash_idx ] = new_node ; }
Adds a key-value pair to a map.
Adds a key - value pair to a map .
// Put new item in a bucket based on its hash // Make a new node pointing to the value in map it's being inserted before // Replace map value with the new node