private TrieNode Insert(char c, TrieNode node) { if (node.Contains(c)) return node.GetChild(c); else { int n = Convert.ToByte(c) - TrieNode.ASCIIA; TrieNode t = new TrieNode(); node.nodes[n] = t; return t; } }
private TrieNode Contains(char c, TrieNode node) { if (node.Contains(c)) { return node.GetChild(c); } else { return null; } }