Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 76d84f8

Browse files
authored
Merge pull request #1 from roylx/roylx-501
修正了python版本的空间复杂度的描述
2 parents 95f200b + 94d4af7 commit 76d84f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎problems/0501.二叉搜索树中的众数.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ class Solution {
476476
## Python
477477

478478
> 递归法
479+
> 常量空间,递归产生的栈不算
479480
480481
```python
481482
# Definition for a binary tree node.
@@ -521,7 +522,9 @@ class Solution:
521522
```
522523

523524

524-
> 迭代法-中序遍历-不使用额外空间,利用二叉搜索树特性
525+
> 迭代法-中序遍历
526+
> 利用二叉搜索树特性,在历遍过程中更新结果,一次历遍
527+
> 但需要使用额外空间存储历遍的节点
525528
```python
526529
class Solution:
527530
def findMode(self, root: TreeNode) -> List[int]:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /