pset5/speller/dictionary_trie/dictionaryTRIE.c
bool check(const char *word)
{
    // char buffer
    uint8_t c;
    
    // pointer buffer
    node *tmp = root;

    // itterate through the whole word
    while (( c = tolower(*word++) ))
    {
        c  = shift(c);
        if (tmp -> children[c] == NULL)
            return false;
        tmp = tmp -> children[c];
    }
    
    // all chars found - now check the boolean
    if (tmp -> is_word)
        return true;
    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)
{
    uint8_t c;
    node *tmp = root;
    while (( c = tolower(*word++) ))
    {
        c  = shift(c);
        if (tmp -> children[c] == NULL)
            return false;
        tmp = tmp -> children[c];
    }
    if (tmp -> is_word)
        return true;
    return false;
}
bool check ( const char * word ) { uint8_t c ; node * tmp = root ; while ( ( c = tolower ( * word ++ ) ) ) { c = shift ( c ) ; if ( tmp -> children [ c ] == NULL ) return false ; tmp = tmp -> children [ c ] ; } if ( tmp -> is_word ) return true ; return false ; }
Returns true if word is in dictionary else false.
Returns true if word is in dictionary else false .
// char buffer // pointer buffer // itterate through the whole word // all chars found - now check the boolean