示例#1
0
 public void AddString(string str)
 {
     if (str == "")
     {
         children.Add(new SearchTreeNode('\0'));
     }
     else
     {
         var child = children.FirstOrDefault(x => x.Character == str[0]);
         if (child == null)
         {
             child = new SearchTreeNode(str[0]);
             children.Add(child);
         }
         child.AddString(str.Substring(1));
     }
 }
示例#2
0
 public void AddChild(SearchTreeNode child)
 {
     children.Add(child);
 }