C++ Iterative and Recursive Solution
\n // Recursive Solution\n    TreeNode* searchBST(TreeNode* root, int val) {\n        if (root == nullptr || val == root->val)\n            return root;\n      
```\n // Recursive Solution\n    TreeNode* searchBST(TreeNode* root, int val) {\n        if (root == nullptr || val == root->val)\n            return root;\n        if (val < root->val)\n            return searchBST(root->left, val);\n        return searchBST(root->right, val);\n    }\n    \n    // Iterative Solution\n    TreeNode* searchBST(TreeNode* root, int val) {\n        while (root && root->val != val)\n            root = (val < root->val)?root->left:root->right;\n        return root;\n    }\n```
[]