(String[] dictionary)
| 25 | // Initializes the data structure using the given array of strings as the dictionary. |
| 26 | // (You can assume each word in the dictionary contains only the uppercase letters A through Z.) |
| 27 | public BoggleSolver(String[] dictionary) { |
| 28 | root = new Node(); |
| 29 | for (String s : dictionary) |
| 30 | put(root, s); |
| 31 | } |
| 32 | |
| 33 | private void put(Node x, String key) { |
| 34 | for (char c : key.toCharArray()) { |