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; }
public void Born(char k, TreeNode sub) { subNodes[k] =sub; }