MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / checkWord

Method checkWord

contents/data-structure/code/Trie/TrieExample.java:39–50  ·  view source on GitHub ↗
(String word)

Source from the content-addressed store, hash-verified

37 }
38
39 boolean checkWord(String word) {
40 TrieNode current = root;
41 for (int i = 0; i < word.length(); i++) {
42 char c = word.charAt(i);
43 if (current.hasChild(c)) {
44 current = current.getChild(c);
45 } else {
46 return false;
47 }
48 }
49 return current.isEnd;
50 }
51}
52
53class TrieNode {

Callers 1

mainMethod · 0.95

Calls 2

hasChildMethod · 0.95
getChildMethod · 0.95

Tested by

no test coverage detected