/// <summary> /// Find a word in the tree /// </summary> /// <param name="word">The characters from which to find words</param> /// <returns>Returns a list of results</returns> public IEnumerable<string> FindWords(string word) { var wchars = new WordCharacters(word); var results = new LinkedList<string>(); foreach (var child in children.Values) child.Walk(wchars.Clone(), results); return results; }
/// <summary> /// Constructor /// </summary> /// <param name="wchars">The WordCharacters to clone</param> private WordCharacters(WordCharacters wchars) { availableChars = new List<char>(wchars.availableChars); takenChars = new List<char>(wchars.takenChars); }