From 3818de4610acd3a1a3e1a9794f3e6caa4320a9e9 Mon Sep 17 00:00:00 2001 From: jianghongcheng <35664721+jianghongcheng@users.noreply.github.com> Date: Tue, 9 May 2023 18:50:14 -0500 Subject: [PATCH] =?UTF-8?q?Update=200700.=E4=BA=8C=E5=8F=89=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A0=91=E4=B8=AD=E7=9A=84=E6=90=9C=E7=B4=A2.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0700.二叉搜索树中的搜索.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/0700.二叉搜索树中的搜索.md b/problems/0700.二叉搜索树中的搜索.md index 40724f48..13064f97 100644 --- a/problems/0700.二叉搜索树中的搜索.md +++ b/problems/0700.二叉搜索树中的搜索.md @@ -230,7 +230,7 @@ class Solution { ### Python -递归法: +(方法一) 递归 ```python class Solution: @@ -250,12 +250,12 @@ class Solution: ``` -迭代法: +(方法二)迭代 ```python class Solution: def searchBST(self, root: TreeNode, val: int) -> TreeNode: - while root is not None: + while root: if val < root.val: root = root.left elif val > root.val: root = root.right else: return root