
Backtracking
萤火虫啊飞呀飞
这个作者很懒,什么都没留下…
展开
-
回溯LeetCode 79 Word Search
Leetcode 79Word SearchProblem Description: 给出一个字符矩阵和一个字符串,遍历该字符矩阵看是否能匹配该字符串。 具体的题目信息: https://leetcode.com/problems/word-search/description/Example: Solution: 解题思路:用队列存储每个人的直接朋友,然后访问队列中每个...原创 2018-06-23 20:48:26 · 212 阅读 · 0 评论 -
回溯Leetcode 17 Letter Combinations of a Phone Number
Leetcode 17Letter Combinations of a Phone NumberProblem Description: 电话上每个数字都有对应的字母,如下图所示,数字0和数字1没有对应的字母,数字2对应的字母包括“abc”,现输入一串数字要求输出所有可能的字母组合。 具体的题目信息: https://leetcode.com/problems/letter-com...原创 2018-06-23 20:55:13 · 169 阅读 · 0 评论 -
回溯Leetcode 46 Permutations
Leetcode 46PermutationsProblem Description: 经典回溯问题:无重复数字的全排列 具体的题目信息: https://leetcode.com/problems/permutations/description/Example: Solution: class Solution {public: vector<vec...原创 2018-06-23 21:44:15 · 200 阅读 · 0 评论 -
回溯Leetcode 47 Permutations II
Leetcode 47Permutations IIProblem Description: 经典回溯问题:重复数字的全排列 具体的题目信息: https://leetcode.com/problems/permutations-ii/description/Example: Solution: class Solution {public: vector&l...原创 2018-06-23 22:46:55 · 203 阅读 · 0 评论 -
回溯Leetcode 77 Combinations
Leetcode 77CombinationsProblem Description: 经典回溯问题:给出n个数字,要求返回其中k个数的组合情况。 具体的题目信息: https://leetcode.com/problems/combinations/description/Example: Solution: class Solution {public: ...原创 2018-06-24 17:04:42 · 213 阅读 · 0 评论 -
回溯Leetcode 39 Combination Sum
Leetcode 39Combination SumProblem Description: 经典回溯问题:给出一个集合,选取集合中的元素相加使得和等于给定的target值,返回所有满足情况的组合(对于同个元素可重复相加) 具体的题目信息: https://leetcode.com/problems/combination-sum/description/Example: S...原创 2018-06-24 17:28:13 · 195 阅读 · 0 评论 -
回溯Leetcode 40 Combination Sum II
Leetcode 40Combination Sum IIProblem Description: 经典回溯问题:给出一个集合,选取集合中的元素相加使得和等于给定的target值,返回所有满足情况的组合(对于同个元素最多可重复使用1次) 具体的题目信息: https://leetcode.com/problems/combination-sum-ii/description/Ex...原创 2018-06-24 19:17:51 · 168 阅读 · 0 评论