src/components/Trie/index.js
// If not then it's not in the trie;
If not then it's not in the trie.
If not then it ' s not in the trie .
search ( str ) {
        var cur = this.root;
        var len = str.length;
        var message = String();
        for ( let i = 0; i < len; i++ ) {
            if ( cur.children[ str[i] ] ) {
                cur = cur.children[ str[i] ];
            }
            else {
                message = "not found";
                return { cur, message };
            }
        }
        message = "found";
        return { cur, message };
    }
search ( str ) { var cur = this . root ; var len = str . length ; var message = String ( ) ; for ( let i = 0 ; i < len ; i ++ ) { if ( cur . children [ str [ i ] ] ) { cur = cur . children [ str [ i ] ] ; } else { message = "not found" ; return { cur , message } ; } } message = "found" ; return { cur , message } ; }
If not then it's not in the trie;
If not then it ' s not in the trie ;