c++ solution
\nSince element to left are small than root and elements to right are greater than root in BST we use same property to traverse element and return requiered ele
\nSince element to left are small than root and elements to right are greater than root in BST we use same property to traverse element and return requiered element.\nIf root is null or we reached end and element is not found we return NULL\n``` \nclass Solution {\npublic:\n    TreeNode* searchBST(TreeNode* root, int val) {\n        if(root==NULL)\n            return NULL;\n        if(root->val==val)\n            return root;\n        if(root->val<val)\n            return searchBST(root->right,val);\n        else\n            return searchBST(root->left,val);\n    }\n};\n```
['C', 'C++']