コード例 #1
0
 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();
        }