Java Solution |  Using Trie
\nclass MagicDictionary {\n    private static class Node {\n\t\tprivate char data;\n\t\tprivate boolean isEnd;\n\t\tprivate Node[] children;\n\n\t\tpublic Node(
```\nclass MagicDictionary {\n    private static class Node {\n\t\tprivate char data;\n\t\tprivate boolean isEnd;\n\t\tprivate Node[] children;\n\n\t\tpublic Node(char data) {\n\t\t\tthis.data = data;\n\t\t\tthis.isEnd = false;\n\t\t\tthis.children = new Node[26];\n\t\t}\n\t}\n    \n    private Node root;\n    \n    public MagicDictionary() {\n        root = new Node(\'/\');\n    }\n    \n    private void insertWord(String word) {\n\t\tNode curr = root;\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tint childIdx = word.charAt(i) - \'a\';\n\t\t\tif (curr.children[childIdx] == null) {\n\t\t\t\tcurr.children[childIdx] = new Node(word.charAt(i));\n\t\t\t}\n\t\t\tcurr = curr.children[childIdx];\n\t\t}\n\t\tcurr.isEnd = true;\n\t}\n    \n    public void buildDict(String[] dictionary) {\n        for (String word : dictionary) {\n\t\t\tinsertWord(word);\n\t\t}\n    }\n    \n    private boolean searchWord(String word) {\n\t\tNode curr = root;\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tint childIdx = word.charAt(i) - \'a\';\n\t\t\tif (curr.children[childIdx] == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcurr = curr.children[childIdx];\n\t\t}\n\t\treturn curr.isEnd;\n\t}\n    \n    public boolean search(String searchWord) {\n\t\tHashSet<String> set = new HashSet<>();\n        set.add(searchWord);\n        boolean isFound = false;\n        char[] charArr = searchWord.toCharArray();\n        for (int i = 0; i < charArr.length; i++) {\n            char oldChar = charArr[i];\n            for (char ch = \'a\'; ch <= \'z\'; ch++) {\n                charArr[i] = ch;\n                String newString = new String(charArr);\n                if (set.contains(newString)) {\n                    continue;\n                }\n                isFound = searchWord(newString);\n                if (isFound) {\n                    break;\n                }\n            }\n            charArr[i] = oldChar;\n            if (isFound) {\n                break;\n            }\n        }\n        if (!isFound) {\n            return false;\n        }\n\t\treturn true;\n    }\n}\n\n/**\n * Your MagicDictionary object will be instantiated and called as such:\n * MagicDictionary obj = new MagicDictionary();\n * obj.buildDict(dictionary);\n * boolean param_2 = obj.search(searchWord);\n */\n```\nSome Other Problems Using Trie Data Structure \n[1268 : Search Suggestions System](https://leetcode.com/problems/search-suggestions-system/discuss/2638534/java-solution-using-trie-runtime-37-ms-beats-7219)\n[1233 : Remove Sub-Folders from the Filesystem](https://leetcode.com/problems/remove-sub-folders-from-the-filesystem/discuss/2638522/java-solution-using-trie-runtime-43-ms-beats-9605)\n[648\t: Replace Words](https://leetcode.com/problems/replace-words/discuss/2638625/java-solution-using-trie-runtime-14-ms-beats-962219)\n[820\t: Short Encoding of Words](https://leetcode.com/problems/short-encoding-of-words/discuss/2639021/java-solution-using-trie)\n[208\t: Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/discuss/2638657/simple-java-solution)\n[386\t: Lexicographical Numbers](https://leetcode.com/problems/lexicographical-numbers/discuss/2639107/java-solution-using-trie)\n[1023 : Camelcase Matching](https://leetcode.com/problems/camelcase-matching/discuss/2639736/java-solution-using-trie)\n[677\t: Map Sum Pairs](https://leetcode.com/problems/map-sum-pairs/discuss/2639994/java-solution-using-trie-and-hashmap)\n[676\t: Implement Magic Dictionary](https://leetcode.com/problems/implement-magic-dictionary/discuss/2640276/java-solution-using-trie)\n[421\t: Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/discuss/2643276/java-trie-approach-add-number-and-check-its-max-xor-on-fly-tc-on-and-sc-on)\n[792\t: Number of Matching Subsequences](https://leetcode.com/problems/number-of-matching-subsequences/discuss/2643489/java-solutions-two-approach-1-using-trie-2-hashmap)\n[720\t: Longest Word in Dictionary](https://leetcode.com/problems/longest-word-in-dictionary/discuss/2643586/java-solution-using-trie-dfs)\n[2261 : K Divisible Elements Subarrays](https://leetcode.com/problems/k-divisible-elements-subarrays/discuss/2643761/java-solution-sliding-window-trie-runtime-41-ms-faster-than-9846)\n[139\t: Word Break](https://leetcode.com/problems/word-break/discuss/2643915/java-solutions-two-approach-1-using-trie-bfs-2-dp)\n[211\t: Design Add and Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/discuss/2643839/java-solution-using-trie-dfs)\n[1948 : Delete Duplicate Folders in System](https://leetcode.com/problems/delete-duplicate-folders-in-system/discuss/2646138/java-solution-using-trie-with-postorder-and-inorder-dfs-traversal)\n[1032 : Stream of Characters](https://leetcode.com/problems/stream-of-characters/discuss/2646970/java-solution-using-trie)\n[212. Word Search II](https://leetcode.com/problems/word-search-ii/discuss/2779677/Java-Solution-or-Using-Trie)
['Tree', 'Trie', 'Java']