Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
         }
 }