Merge pull request #1913 from roylx/master

修正了501python版本的空间复杂度的描述
This commit is contained in:
程序员Carl 2023-02-28 09:21:56 +08:00 committed by GitHub
commit b5c65c6c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -476,6 +476,7 @@ class Solution {
## Python
> 递归法
> 常量空间,递归产生的栈不算
```python
# Definition for a binary tree node.
@ -521,7 +522,9 @@ class Solution:
```
> 迭代法-中序遍历-不使用额外空间,利用二叉搜索树特性
> 迭代法-中序遍历
> 利用二叉搜索树特性,在历遍过程中更新结果,一次历遍
> 但需要使用额外空间存储历遍的节点
```python
class Solution:
def findMode(self, root: TreeNode) -> List[int]: