public PrefixTree Build() { PrefixTree tree = new PrefixTree(); foreach(string word in _words) { tree.Insert(word); } return tree; }
public WordSolver(IWordList wordList) { #region Sanity Check if (wordList == null) { throw new ArgumentNullException("wordList", "No word list provided."); } #endregion _wordList = wordList; _tree = _wordList.Build(); }