示例#1
0
 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;
     }
 }
示例#2
0
 private TrieNode Contains(char c, TrieNode node)
 {
     if (node.Contains(c))
     {
         return node.GetChild(c);
     }
     else
     {
         return null;
     }
 }