From 5de0f0041f3367f7f7c5c8c6b8d57c39e7552617 Mon Sep 17 00:00:00 2001 From: youngyangyang04 <826123027@qq.com> Date: Wed, 29 Sep 2021 11:28:47 +0800 Subject: [PATCH] Update --- README.md | 1 + problems/0001.两数之和.md | 2 +- problems/0078.子集.md | 32 ++++++++++++++++---------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d1076aba..6a64da9f 100644 --- a/README.md +++ b/README.md @@ -458,6 +458,7 @@ * [724.寻找数组的中心索引](./problems/0724.寻找数组的中心索引.md) * [34.在排序数组中查找元素的第一个和最后一个位置](./problems/0034.在排序数组中查找元素的第一个和最后一个位置.md) (二分法) * [922.按奇偶排序数组II](./problems/0922.按奇偶排序数组II.md) +* [35.搜索插入位置](./problems/0035.搜索插入位置.md) ## 链表 diff --git a/problems/0001.两数之和.md b/problems/0001.两数之和.md index 0ef73c6a..949e52a7 100644 --- a/problems/0001.两数之和.md +++ b/problems/0001.两数之和.md @@ -253,4 +253,4 @@ class Solution { * 作者微信:[程序员Carl](https://mp.weixin.qq.com/s/b66DFkOp8OOxdZC_xLZxfw) * B站视频:[代码随想录](https://space.bilibili.com/525438321) * 知识星球:[代码随想录](https://mp.weixin.qq.com/s/QVF6upVMSbgvZy8lHZS3CQ) -
+
diff --git a/problems/0078.子集.md b/problems/0078.子集.md index 39f6ed5d..59f291d0 100644 --- a/problems/0078.子集.md +++ b/problems/0078.子集.md @@ -7,7 +7,7 @@

欢迎大家参与本项目,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!

-## 第78题. 子集 +# 78.子集 [力扣题目链接](https://leetcode-cn.com/problems/subsets/) @@ -29,7 +29,7 @@   [] ] -## 思路 +# 思路 求子集问题和[77.组合](https://programmercarl.com/0077.组合.html)和[131.分割回文串](https://programmercarl.com/0131.分割回文串.html)又不一样了。 @@ -153,19 +153,19 @@ public: 并不会,因为每次递归的下一层就是从i+1开始的。 -## 总结 +# 总结 相信大家经过了 * 组合问题: - * [回溯算法:求组合问题](https://programmercarl.com/0077.组合.html) + * [77.组合](https://programmercarl.com/0077.组合.html) * [回溯算法:组合问题再剪剪枝](https://programmercarl.com/0077.组合优化.html) - * [回溯算法:求组合总和!](https://programmercarl.com/0216.组合总和III.html) - * [回溯算法:电话号码的字母组合](https://programmercarl.com/0017.电话号码的字母组合.html) - * [回溯算法:求组合总和(二)](https://programmercarl.com/0039.组合总和.html) - * [回溯算法:求组合总和(三)](https://programmercarl.com/0040.组合总和II.html) + * [216.组合总和III](https://programmercarl.com/0216.组合总和III.html) + * [17.电话号码的字母组合](https://programmercarl.com/0017.电话号码的字母组合.html) + * [39.组合总和](https://programmercarl.com/0039.组合总和.html) + * [40.组合总和II](https://programmercarl.com/0040.组合总和II.html) * 分割问题: - * [回溯算法:分割回文串](https://programmercarl.com/0131.分割回文串.html) - * [回溯算法:复原IP地址](https://programmercarl.com/0093.复原IP地址.html) + * [131.分割回文串](https://programmercarl.com/0131.分割回文串.html) + * [93.复原IP地址](https://programmercarl.com/0093.复原IP地址.html) 洗礼之后,发现子集问题还真的有点简单了,其实这就是一道标准的模板题。 @@ -173,10 +173,10 @@ public: **而组合问题、分割问题是收集树形结构中叶子节点的结果**。 -## 其他语言版本 +# 其他语言版本 -Java: +## Java ```java class Solution { List> result = new ArrayList<>();// 存放符合条件结果的集合 @@ -204,7 +204,7 @@ class Solution { } ``` -Python: +## Python ```python3 class Solution: def subsets(self, nums: List[int]) -> List[List[int]]: @@ -220,7 +220,7 @@ class Solution: return res ``` -Go: +## Go ```Go var res [][]int func subset(nums []int) [][]int { @@ -244,7 +244,7 @@ func Dfs(temp, nums []int, start int){ } ``` -Javascript: +## Javascript: ```Javascript var subsets = function(nums) { @@ -263,7 +263,7 @@ var subsets = function(nums) { }; ``` -C: +## C ```c int* path; int pathTop;