@@ -0,0 +1,876 @@
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class _0208ImplementTrie_PrefixTree %7B%0A  Map%3CString, Boolean%3E prefixs = new HashMap%3C%3E();%0A%0A  /** Initialize your data structure here. */%0A  public _0208ImplementTrie_PrefixTree() %7B%0A%0A  %7D%0A  %0A  /** Inserts a word into the trie. */%0A  public void insert(String word) %7B%0A    for (int i = 0; i %3C word.length(); i++) %7B%0A      prefixs.put(word, true);%0A      String subString = word.substring(0, i + 1);%0A      if (!prefixs.containsKey(subString)) %7B%0A        prefixs.put(subString, false);%0A      %7D%0A    %7D%0A  %7D%0A  %0A  /** Returns if the word is in the trie. */%0A  public boolean search(String word) %7B%0A    return prefixs.containsKey(word) && prefixs.get(word);%0A  %7D%0A  %0A  /** Returns if there is any word in the trie that starts with the given prefix. */%0A  public boolean startsWith(String prefix) %7B%0A    return prefixs.containsKey(prefix);%0A  %7D%0A%7D%0A

Add _0208ImplementTrie_PrefixTree