/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
* Right *TreeNode
* }
*/funcsearchBST(root*TreeNode,valint)*TreeNode{ifroot==nil{returnnil}ifroot.Val==val{returnroot}elseifroot.Val>val{returnsearchBST(root.Left,val)}else{returnsearchBST(root.Right,val)}}