Merge branch 'master' into master

This commit is contained in:
程序员Carl
2023-07-25 10:01:13 +08:00
committed by GitHub
116 changed files with 2937 additions and 1556 deletions

View File

@@ -5,10 +5,6 @@
</a>
<p align="center"><strong><a href="https://mp.weixin.qq.com/s/tqCxrMEU-ajQumL1i8im9A">参与本项目</a>,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!</strong></p>
# 第77题. 组合
[力扣题目链接](https://leetcode.cn/problems/combinations/ )
@@ -27,13 +23,12 @@
[1,4],
]
# 算法公开课
## 算法公开课
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[带你学透回溯算法-组合问题对应力扣题目77.组合)](https://www.bilibili.com/video/BV1ti4y1L7cv)[组合问题的剪枝操作](https://www.bilibili.com/video/BV1wi4y157er),相信结合视频在看本篇题解,更有助于大家对本题的理解**。
**《代码随想录》算法视频公开课:[带你学透回溯算法-组合问题对应力扣题目77.组合)](https://www.bilibili.com/video/BV1ti4y1L7cv)[组合问题的剪枝操作](https://www.bilibili.com/video/BV1wi4y157er),相信结合视频在看本篇题解,更有助于大家对本题的理解**。
# 思路
## 思路
本题是回溯法的经典题目。
@@ -108,7 +103,7 @@ for (int i = 1; i <= n; i++) {
在[关于回溯算法,你该了解这些!](https://programmercarl.com/回溯算法理论基础.html)中我们提到了回溯法三部曲,那么我们按照回溯法三部曲开始正式讲解代码了。
## 回溯法三部曲
### 回溯法三部曲
* 递归函数的返回值以及参数
@@ -345,11 +340,10 @@ public:
## 其他语言版本
### Java
未剪枝优化
```java
@@ -474,7 +468,7 @@ func dfs(n int, k int, start int) {
}
```
### javascript
### Javascript
剪枝:
@@ -774,3 +768,4 @@ object Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>