pset5/speller/dictionary.c
bool check(const char *word)
{
    
    // hash buffer
    const uint32_t i = hash_check(word);

    // check if entry even exists
    if (ht[i] == NULL)
        return false;

    // temporary pointer
    node *tmp = ht[i];
    
    // keep searching for match in the linked list
    do
    {
        if ( strcasecmp( (tmp -> c), word) == 0 )
            return true;
        tmp = tmp -> next;
        
    } while (tmp);

    // no match found
    return false;
}
/**
 * Returns true if word is in dictionary else false.
 */
Returns true if word is in dictionary else false.
Returns true if word is in dictionary else false .
bool check(const char *word)
{
    const uint32_t i = hash_check(word);
    if (ht[i] == NULL)
        return false;
    node *tmp = ht[i];
    do
    {
        if ( strcasecmp( (tmp -> c), word) == 0 )
            return true;
        tmp = tmp -> next;
    } while (tmp);
    return false;
}
bool check ( const char * word ) { const uint32_t i = hash_check ( word ) ; if ( ht [ i ] == NULL ) return false ; node * tmp = ht [ i ] ; do { if ( strcasecmp ( ( tmp -> c ) , word ) == 0 ) return true ; tmp = tmp -> next ; } while ( tmp ) ; return false ; }
Returns true if word is in dictionary else false.
Returns true if word is in dictionary else false .
// hash buffer // check if entry even exists // temporary pointer // keep searching for match in the linked list // no match found