publicbooleansearchFrom(String word, int k, TrieNode node) { // All the chars before word.length() are found. // Therefore we need to check at this point, if there is word // that contains all the chars before has been inserted before. if (k == word.length()) return node.isWord; charcurrChar= word.charAt(k); if (word.charAt(k) == '.') { for (TrieNode child : node.map.values()) { if (searchFrom(word, k + 1, child)) returntrue; } } else { return node.map.containsKey(currChar) && searchFrom(word, k + 1, node.map.get(currChar)); } returnfalse; } }