You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solution/0700-0799/0700.Search in a Binary Search Tree/README_EN.md
+49-16
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,13 @@ tags:
53
53
54
54
<!-- solution:start -->
55
55
56
-
### Solution 1
56
+
### Solution 1: Recursion
57
+
58
+
We check if the current node is null or if the current node's value equals the target value. If so, we return the current node.
59
+
60
+
Otherwise, if the current node's value is greater than the target value, we recursively search the left subtree; otherwise, we recursively search the right subtree.
61
+
62
+
The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is the number of nodes in the binary tree.
0 commit comments