回溯
回溯
Wonz
技术很菜,但一直在学习。
微信公众号:Wonz
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode | 0090. Subsets II子集II【Python】
LeetCode 0090. Subsets II子集II【Medium】【Python】【回溯】原创 2020-11-27 22:08:35 · 488 阅读 · 0 评论 -
LeetCode | 0078. Subsets子集【Python】
> LeetCode 0078. Subsets子集【Medium】【Python】【回溯】原创 2020-10-24 18:04:21 · 522 阅读 · 0 评论 -
LeetCode | 0051. N-Queens N 皇后【Python】
LeetCode 0051. N-Queens N 皇后【Hard】【Python】【回溯】原创 2020-09-10 22:56:50 · 612 阅读 · 0 评论 -
LeetCode | 0040. Combination Sum II组合总和 II【Python】
LeetCode 0040. Combination Sum II组合总和 II【Medium】【Python】【回溯】原创 2020-09-10 10:27:53 · 429 阅读 · 0 评论 -
LeetCode | 0113. Path Sum II路径总和 II【Python】
LeetCode 0113. Path Sum II路径总和 II【Medium】【Python】【回溯】原创 2020-03-23 23:36:32 · 443 阅读 · 0 评论 -
LeetCode | 面试题34. 二叉树中和为某一值的路径【剑指Offer】【Python】
LeetCode 面试题34. 二叉树中和为某一值的路径【剑指Offer】【Medium】【Python】【回溯】原创 2020-03-23 23:22:02 · 550 阅读 · 0 评论 -
LeetCode | 0039. Combination Sum组合总和【Python】
LeetCode 0039. Combination Sum组合总和【Medium】【Python】【回溯】ProblemLeetCodeGiven a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations ...原创 2020-03-07 13:28:19 · 393 阅读 · 0 评论 -
LeetCode | 0077. Combinations组合【Python】
LeetCode 0077. Combinations组合【Medium】【Python】【回溯】ProblemLeetCodeGiven two integers n and k, return all possible combinations of k numbers out of 1 … n.Example:Input: n = 4, k = 2Output:[ [2...原创 2020-03-05 22:13:29 · 407 阅读 · 0 评论 -
LeetCode | 0047. Permutations II全排列 II【Python】
LeetCode 0047. Permutations II全排列 II【Medium】【Python】【回溯】ProblemLeetCodeGiven a collection of numbers that might contain duplicates, return all possible unique permutations.Example:Input: [1,1,2...原创 2020-03-05 21:12:34 · 584 阅读 · 0 评论 -
LeetCode | 0046. Permutations全排列【Python】
LeetCode 0046. Permutations全排列【Medium】【Python】【回溯】【DFS】ProblemGiven a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [...原创 2020-03-04 23:09:08 · 634 阅读 · 0 评论 -
LeetCode | 0079. Word Search单词搜索【Python】
LeetCode 0079. Word Search单词搜索【Medium】【Python】【DFS】ProblemLeetCodeGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjace...原创 2020-03-04 21:51:40 · 403 阅读 · 0 评论 -
LeetCode | 0017. Letter Combinations of a Phone Number电话号码的字母组合【Python】
LeetCode 0017. Letter Combinations of a Phone Number电话号码的字母组合【Medium】【Python】【回溯】【DFS】【暴力】ProblemLeetCodeGiven a string containing digits from 2-9 inclusive, return all possible letter combinatio...原创 2020-03-04 21:12:52 · 555 阅读 · 0 评论 -
LeetCode | 0093. Restore IP Addresses复原IP地址【Python】
LeetCode 0093. Restore IP Addresses复原IP地址【Medium】【Python】【回溯】【DFS】【暴力】ProblemLeetCodeGiven a string containing only digits, restore it by returning all possible valid IP address combinations.Exa...原创 2020-03-04 20:48:29 · 608 阅读 · 0 评论 -
LeetCode | 0257. Binary Tree Paths二叉树的所有路径【Python】
LeetCode 0257. Binary Tree Paths二叉树的所有路径【Easy】【Python】【DFS】ProblemLeetCodeGiven a binary tree, return all root-to-leaf paths.Note: A leaf is a node with no children.Example:Input: 1 / \...原创 2020-03-02 23:06:26 · 446 阅读 · 0 评论 -
LeetCode | 0241. Different Ways to Add Parentheses为运算表达式设计优先级【Python】
LeetCode 0241. Different Ways to Add Parentheses为运算表达式设计优先级【Medium】【Python】【分治】ProblemLeetCodeGiven a string of numbers and operators, return all possible results from computing all the different...原创 2020-02-25 14:18:12 · 412 阅读 · 0 评论 -
洛谷 | P1605 迷宫
搜索 专题题目链接:洛谷 P1605 迷宫题目描述输入输出格式时空限制时间:1000ms空间:128MB思路因为数据比较弱,所以可以先初始化迷宫都为没有障碍,即都可以走路,然后随着输入实时更新迷宫障碍。同时,把每次可以移动的 x 、y 用数据记录,这样每次只要加上相应的 walkx 和 walky 就行。最后,用 深度优先搜索 ,就能得出答案了。代码#includ...原创 2019-03-26 00:03:34 · 1524 阅读 · 1 评论 -
洛谷 | P1219 八皇后
搜索 专题题目链接:洛谷 P1219 八皇后题目描述输入输出格式时空限制时间:1000ms空间:128MB思路八皇后问题关键是不能同行、同列、两条斜线上有其他皇后。于是得到以下判断皇后条件:if(!b[j] && !c[count+j] && !d[count-j+n])代码#include <iostream>u...原创 2019-03-26 00:02:23 · 461 阅读 · 0 评论
分享