private void PreTraverse(NodeHashMap node) { Console.WriteLine(node.Value); foreach (var child in node.GetChildren()) { PreTraverse(child); } }
private void FindWords(NodeHashMap node, string prefix, List <string> words) { if (node is null) { return; } if (node.IsEndOfWord) { words.Add(prefix); } foreach (var child in node.GetChildren()) { FindWords(child, prefix + child.Value, words); } }