public TreeNode FindDataRecursive(int value) { if (root != null) { return(root.FindDataRecursive(value)); } else { return(null); } }
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); } }