例题细节讲过(二叉搜索树的基础操作-CSDN博客),下面给出递归实现
public TreeNode searchBST(TreeNode node, int val) {if(node == null) {return null;}if(val < node.val) {return searchBST(node.left, val);} else if(node.val < val) {return searchBST(node.right, val);} else {return node;}
}