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

            _wordList = wordList;
            _tree = _wordList.Build();
        }