MCPcopy Index your code
hub / github.com/trekhleb/javascript-algorithms / doesWordExist

Method doesWordExist

src/data-structures/trie/Trie.js:86–90  ·  view source on GitHub ↗

* Check if complete word exists in Trie. * * @param {string} word * @return {boolean}

(word)

Source from the content-addressed store, hash-verified

84 * @return {boolean}
85 */
86 doesWordExist(word) {
87 const lastCharacter = this.getLastCharacterNode(word);
88
89 return !!lastCharacter && lastCharacter.isCompleteWord;
90 }
91
92 /**
93 * @param {string} word

Callers 1

Trie.test.jsFile · 0.80

Calls 1

getLastCharacterNodeMethod · 0.95

Tested by

no test coverage detected