Ejemplo n.º 1
0
 public void Add(char[] w)
 {
     if (w.Length < 1) 
         return;
     TreeNode p = head;
     for (int i = 0; i < w.Length; i++)
     {
         TreeNode n = p.SubNode(w[i]);
         if (n == null)
         {
             n = new TreeNode(w[i]);
             p.Born(w[i], n);
         }
         p = n;
     }
     p.IsAlsoLeaf = true;
 }
Ejemplo n.º 2
0
 public void Born(char k, TreeNode sub)
 {
     subNodes[k] =sub;
 }