exercises/ex07/hash.c
Value *list_lookup(Node *list, Hashable *key)
{
    // If first element is null, return null
    if (list == NULL) return NULL;

    // If first element matches key, return its value.
    if (key->equal(list->key, key)) return list->value;

    // Otherwise, continue to iterate along list recursively.
    return list_lookup(list->next, key);

}
/* Looks up a key and returns the corresponding value, or NULL */
Looks up a key and returns the corresponding value, or NULL
Looks up a key and returns the corresponding value or NULL
Value *list_lookup(Node *list, Hashable *key)
{
    if (list == NULL) return NULL;
    if (key->equal(list->key, key)) return list->value;
    return list_lookup(list->next, key);
}
Value * list_lookup ( Node * list , Hashable * key ) { if ( list == NULL ) return NULL ; if ( key -> equal ( list -> key , key ) ) return list -> value ; return list_lookup ( list -> next , key ) ; }
Looks up a key and returns the corresponding value, or NULL
Looks up a key and returns the corresponding value or NULL
// If first element is null, return null // If first element matches key, return its value. // Otherwise, continue to iterate along list recursively.