示例#1
0
 // Adds term to the tree
 public void add(T term)
 {
     if (root != null)
     {
         root.add(term);
     }
     else
     {
         root = new BKNode <T>(term);
     }
 }
示例#2
0
            public void add(T term)
            {
                int score = Distance.calculate(term, this.term);

                BKNode child = null;

                children.TryGetValue(score, out child);
                if (child != null)
                {
                    child.add(term);
                }
                else
                {
                    children.Add(score, new BKNode(term));
                }
            }