Data Structures/Trie.cpp
// Does char s[idx] exist as a child of the curr node
Does char s[idx] exist as a child of the curr node
Does char s [ idx ] exist as a child of the curr node
bool findStr(trieNode* curr, char* s, int idx, int len)
{
    if(idx == len)
    {
        return (curr -> leaf);
    }
    if(curr -> adj[ s[idx] ] == NULL)
        return false;
    return findStr(curr -> adj[ s[idx] ], s, idx+1, len);
}
bool findStr ( trieNode * curr , char * s , int idx , int len ) { if ( idx == len ) { return ( curr -> leaf ) ; } if ( curr -> adj [ s [ idx ] ] == NULL ) return false ; return findStr ( curr -> adj [ s [ idx ] ] , s , idx + 1 , len ) ; }
Does char s[idx] exist as a child of the curr node
Does char s [ idx ] exist as a child of the curr node
// End of the string // If there's no child, there's no string // Recurse