mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
Update 0700.二叉搜索树中的搜索.md
This commit is contained in:
@ -212,6 +212,12 @@ Python:
|
|||||||
递归法:
|
递归法:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
# Definition for a binary tree node.
|
||||||
|
# class TreeNode:
|
||||||
|
# def __init__(self, val=0, left=None, right=None):
|
||||||
|
# self.val = val
|
||||||
|
# self.left = left
|
||||||
|
# self.right = right
|
||||||
class Solution:
|
class Solution:
|
||||||
def searchBST(self, root: TreeNode, val: int) -> TreeNode:
|
def searchBST(self, root: TreeNode, val: int) -> TreeNode:
|
||||||
# 为什么要有返回值:
|
# 为什么要有返回值:
|
||||||
|
Reference in New Issue
Block a user