Exemplo n.º 1
0
        public static LeetCode700Node SearchBST(LeetCode700Node root, int val)
        {
            if (root == null || root.val == val)
            {
                return(root);
            }

            return(root.val > val?SearchBST(root.left, val) : SearchBST(root.right, val));
        }
Exemplo n.º 2
0
 public LeetCode700Node(int val = 0, LeetCode700Node left = null, LeetCode700Node right = null)
 {
     this.val   = val;
     this.left  = left;
     this.right = right;
 }