Data Structures/Trie.cpp
// Add char s[idx] as a child of the curr node
Add char s[idx] as a child of the curr node
Add char s [ idx ] as a child of the curr node
void insertStr(trieNode* curr, char* s, int idx, int len)
{
    if(idx == len)
    {
        curr -> leaf = true;
        return;
    }
    if(curr -> adj[ s[idx] ] == NULL)
        curr -> adj[ s[idx] ] = new trieNode();
    insertStr(curr -> adj[ s[idx] ], s, idx+1, len);
}
void insertStr ( trieNode * curr , char * s , int idx , int len ) { if ( idx == len ) { curr -> leaf = true ; return ; } if ( curr -> adj [ s [ idx ] ] == NULL ) curr -> adj [ s [ idx ] ] = new trieNode ( ) ; insertStr ( curr -> adj [ s [ idx ] ] , s , idx + 1 , len ) ; }
Add char s[idx] as a child of the curr node
Add char s [ idx ] as a child of the curr node
// End of the string // Create a missing child // Recurse