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

[pull] master from youngyangyang04:master #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 7 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jan 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: 70 爬楼梯删去复杂度的内联公式符
仅有单对的‘$’,与其他文档同步,故删去
  • Loading branch information
Poivre-hxx committed Nov 28, 2024
commit 455520bde6ba29d01eb9b43d3aba88b8f7d2dead
9 changes: 5 additions & 4 deletions problems/0070.爬楼梯.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public:
};
```

* 时间复杂度:$O(n)$
* 空间复杂度:$O(n)$
* 时间复杂度:O(n)
* 空间复杂度:O(n)

当然依然也可以,优化一下空间复杂度,代码如下:

Expand All @@ -154,8 +154,8 @@ public:
};
```

* 时间复杂度:$O(n)$
* 空间复杂度:$O(1)$
* 时间复杂度:O(n)
* 空间复杂度:O(1)

后面将讲解的很多动规的题目其实都是当前状态依赖前两个,或者前三个状态,都可以做空间上的优化,**但我个人认为面试中能写出版本一就够了哈,清晰明了,如果面试官要求进一步优化空间的话,我们再去优化**。

Expand Down Expand Up @@ -524,3 +524,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

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