Skip to content

Commit 266c14b

Browse files
authored
Update 96.unique-binary-search-trees.md
1 parent b8d585b commit 266c14b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

problems/96.unique-binary-search-trees.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ class Solution:
8787
self.visited[n] = res
8888
return res
8989
```
90+
**复杂度分析**
91+
- 时间复杂度:一层循环是 N,另外递归深度是 N,因此总的时间复杂度是 $O(N^2)$
92+
- 空间复杂度:递归的栈深度和visited 的大小都是 N,因此总的空间复杂度为 $O(N)$
9093

9194
## 相关题目
9295

93-
- [95.unique-binary-search-trees-ii](./95.unique-binary-search-trees-ii.md)
96+
- [95.unique-binary-search-trees-ii](https://github.com/azl397985856/leetcode/blob/master/problems/95.unique-binary-search-trees-ii.md)
97+
98+
更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经30K star啦。
99+
100+
关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。

0 commit comments

Comments
 (0)