public boolean search(String word) {
		Queue<TrieNode> queue = new LinkedList<TrieNode>();
		TrieNode node = root;
		queue.add(node);
		int index = 0;
		while (!queue.isEmpty()) {
			if (index == word.length())
				return true;
			TrieNode curr = queue.poll();
			if (index == word.length() - 1)
				return curr.flag;
			if (word.charAt(index) == '.') {
				for (int i = 0; i < 26; i++) {
					if (curr.children[i] != null)
						queue.add(curr.children[i]);
				}
			} else {
				if (curr != null && curr.children[word.charAt(index) - 'a'] == null)
					break;
				else
					queue.add(curr.children[word.charAt(index) - 'a']);
			}
			index++;

		}
		return false;
	}