예제 #1
0
 public override void Insert(T v)
 {
     if (_root == null)
     {
         _root = new SB_BinarySearchTree <T> .Node(v);
     }
     else
     {
         _root = SB_BinarySearchTree <T> .Insert(_root, v);
     }
 }
예제 #2
0
 public virtual void Insert(T v)
 {
     if (_root == null)
     {
         _root = new SB_BinarySearchTree <T> .Node(v);
     }
     else
     {
         if (SB_BinarySearchTree <T> .Find(_root, v) != null)
         {
             return;
         }
         _root = SB_BinarySearchTree <T> .Insert(_root, v);
     }
 }