private void PrefixedWordsAux(string word, Node node, List<string> prefixedWords) { if (node.IsWordTerminator) prefixedWords.Add(word); foreach (var child in node.AssignedChildren) { PrefixedWordsAux(word + child.Value, child.Key, prefixedWords); } }
public Node GetOrCreate(char c) { Node child = this[c]; if (child == null) child = this[c] = new Node(); return child; }