My simple and clean Java code
Using backtrack to check each character of word to search.\n\n    public class WordDictionary {\n        public class TrieNode {\n            public TrieNode[] 
Using backtrack to check each character of word to search.\n\n    public class WordDictionary {\n        public class TrieNode {\n            public TrieNode[] children = new TrieNode[26];\n            public String item = "";\n        }\n        \n        private TrieNode root = new TrieNode();\n    \n        public void addWord(String word) {\n            TrieNode node = root;\n            for (char c : word.toCharArray()) {\n                if (node.children[c - 'a'] == null) {\n                    node.children[c - 'a'] = new TrieNode();\n                }\n                node = node.children[c - 'a'];\n            }\n            node.item = word;\n        }\n    \n        public boolean search(String word) {\n            return match(word.toCharArray(), 0, root);\n        }\n        \n        private boolean match(char[] chs, int k, TrieNode node) {\n            if (k == chs.length) return !node.item.equals("");   \n            if (chs[k] != '.') {\n                return node.children[chs[k] - 'a'] != null && match(chs, k + 1, node.children[chs[k] - 'a']);\n            } else {\n                for (int i = 0; i < node.children.length; i++) {\n                    if (node.children[i] != null) {\n                        if (match(chs, k + 1, node.children[i])) {\n                            return true;\n                        }\n                    }\n                }\n            }\n            return false;\n        }\n    }
['Backtracking', 'Trie']