[C++]Easy Recursion with explanation for beginners
\nclass Solution {\npublic:\n    TreeNode* searchBST(TreeNode* root, int val) {\n        //if root is null return null\n        if(!root) return root;\n        
```\nclass Solution {\npublic:\n    TreeNode* searchBST(TreeNode* root, int val) {\n        //if root is null return null\n        if(!root) return root;\n        //create node to return \n        TreeNode *node=new TreeNode(); \n        // if root->val != val,search in left and right\n        //otherwise this would be required node and we would return it\n        if(val<root->val){\n            //search in left \n            node=searchBST(root->left,val);\n        } else if(val>root->val){\n            //search in right\n            node=searchBST(root->right,val);\n        } else {\n            //required node\n            node=root;\n        }\n        return node;\n    }\n};\n```\nPlease Like.\nThank you:)\n
['C']