Example #1
0
 public void InsertString(string s, int index)
 {
     indexes.Add(index);
     if (s != null && s.Length != 0)
     {
         value = s[0];
         SuffixTreeNode child = null;
         if (children.ContainsKey(value))
         {
             child = children[value];
         }
         else
         {
             child = new SuffixTreeNode();
             children.Add(value, child);
         }
         string remainder = s.Substring(1);
         child.InsertString(remainder, index);
     }
 }
Example #2
0
 public void InsertString(string s, int index)
 {
     indexes.Add(index);
         if (s != null && s.Length != 0)
         {
             value = s[0];
             SuffixTreeNode child = null;
             if (children.ContainsKey(value))
             {
                 child = children[value];
             }
             else
             {
                 child = new SuffixTreeNode();
                 children.Add(value, child);
             }
             string remainder = s.Substring(1);
             child.InsertString(remainder, index);
         }
 }