JAVA FASTEST CODE🔥🔥🔥|| EXPLAINED DEEPLY
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(log N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(H) H is height of tree\n![Screenshot_20230205_171246.png](https://assets.leetcode.com/users/images/eca22e69-4359-4468-ab13-98584e3b6435_1681551356.0869029.png)\n\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public TreeNode searchBST(TreeNode root, int val) {\n        \n        // Check if the root node is null or if the root value matches the input value\n        if(root == null || root.val == val) {\n            // If so, return the root node (which may be null)\n            return root;\n        }\n    \n        // If the input value is less than the root value, search the left subtree recursively\n        if(val < root.val) {\n            return searchBST(root.left, val);\n        }\n        // Otherwise, search the right subtree recursively\n        else {\n            return searchBST(root.right, val);\n        }\n    }\n}\n```
['Java']