예제 #1
0
 public TreeNode FindDataRecursive(int value)
 {
     if (root != null)
     {
         return(root.FindDataRecursive(value));
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
 public TreeNode FindDataRecursive(int value)
 {
     if (value == data)
     {
         return(this);
     }
     else if (value < Data && LeftNode != null)
     {
         return(LeftNode.FindDataRecursive(value));
     }
     else if (value > data && RightNode != null)
     {
         return(RightNode.FindDataRecursive(value));
     }
     else
     {
         return(null);
     }
 }