예제 #1
0
 public TrieNode(char character, TrieNode parent_node)
 {
     this.character = character;
     this.parent_node = parent_node;
     this.word_count = 0;
     this.edges = new Dictionary<char,TrieNode>();
 }
예제 #2
0
 public TrieNode add(char character)
 {
     TrieNode edge;
     if (edges.ContainsKey(character))
     {
         edge = edges[character];
     }
     else
     {
         TrieNode new_edge = new TrieNode(character, this);
         edges.Add(character, new_edge);
         edge = new_edge;
     }
     return edge;
 }
예제 #3
0
 public Trie()
 {
     this.root_node = new TrieNode(' ', null);
 }