
回溯
java coder
这个作者很懒,什么都没留下…
展开
-
leetcode 子集II
leetcode 题目链接 1. 题目考点 dfs 回溯 + 剪枝 2. 考点解析 数组重复必定先排序 不重复自身必有start 解集不重复比有used class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> subsetsWithDup(int[] nums) { Stack<原创 2021-02-20 10:02:30 · 93 阅读 · 1 评论 -
leetcode 子集
leetcode 题目链接 1. 题目考点 dfs 回溯 找结束条件 2. 考点解析 结束条件包含在for边界中 class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> subsets(int[] nums) { Stack<Integer> path = new Stack&原创 2021-02-20 09:43:46 · 141 阅读 · 0 评论 -
leetcode 组合总和III
leetcode题目链接 1. 题目考点 dfs 回溯 + 剪枝 画图分析 2. 考点解析 数组无重复 + 无重复数字 + 组合无重复 class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> combinationSum3(int k, int n) { Stack<Integer&原创 2021-02-20 09:10:30 · 132 阅读 · 0 评论 -
leetcode 组合总和II
leetcode题目链接 1. 题目考点 dfs + 剪枝 回溯 1. 考点解析 回溯 + 剪枝 class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> combinationSum(int[] candidates, int target) { Arrays.sort(candidate原创 2021-02-20 08:46:25 · 126 阅读 · 0 评论 -
leetcode 组合
leetcode 题目链接 1. 题目考点 n叉树 dfs 回溯+剪枝 2. 考点解析 回溯 + 两次剪枝 class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> combine(int n, int k) { Stack<Integer> combine = new Stac原创 2021-02-19 10:59:12 · 67 阅读 · 0 评论