✅ Beats most ||  O(log n)  || Recursion || Explanation in Python
A simple, recursive approach!\n\n## Explanation and Complexity\nCompares the target value with the root node.\nIf the target is greater, the search continues in
##### A simple, recursive approach!\n\n## Explanation and Complexity\nCompares the target value with the root node.\nIf the target is **greater**, the search continues in the right subtree; \nIf **smaller**, in the left subtree. **Otherwise**, the node is found and returned.\n\n##### Time & Space Complexity of O(log n)\n- **Average case:** O(log n)\n- **Worst case:** O(n)\n# Code\n```\nclass Solution:\n    def searchBST(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]:\n        if not root: return\n        \n        if val > root.val:\n            return self.searchBST(root.right, val)\n        elif val < root.val:\n            return self.searchBST(root.left, val)\n        else:\n            return root\n```\n![upvote.jpeg](https://assets.leetcode.com/users/images/2e1a7c3d-ba55-4493-9ce4-786bd580cfe3_1732716527.1463037.jpeg)\n
['Binary Search Tree', 'Recursion', 'Binary Tree', 'Python', 'Python3']