题库chevron_right分类chevron_right回溯
undo

回溯

88 道题目
简单: 3中等: 58困难: 27

回溯 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

题库

回溯 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 88 道题目

每次续载 24 题
#题目难度
17

电话号码的字母组合

Generate all letter combinations a digit string can represent using backtracking with pruning, leveraging hash table map…

中等
22

括号生成

Generate Parentheses requires generating all valid combinations of parentheses with given pairs using backtracking and s…

中等
37

解数独

Solve the Sudoku puzzle by filling empty cells while respecting Sudoku's rules using array scanning and backtracking.

困难
39

组合总和

Find all unique combinations of numbers from a distinct array that sum to a target using controlled backtracking search.

中等
40

组合总和 II

Find all unique combinations of numbers that sum to a target using backtracking with careful pruning to avoid duplicates…

中等
46

全排列

Generate all possible orderings of a distinct integer array using backtracking search with careful pruning to avoid dupl…

中等
47

全排列 II

Generate all unique permutations of an array containing duplicates using backtracking and pruning to avoid repeated sequ…

中等
51

N 皇后

Solve the N-Queens problem using backtracking with pruning, exploring all valid board placements while avoiding conflict…

困难
52

N 皇后 II

Solve the N-Queens II problem using backtracking with pruning to efficiently count all valid placements for n queens on …

困难
77

组合

Generate all combinations of k numbers from the range [1, n] using backtracking and pruning.

中等
78

子集

Generate all subsets of a set of unique integers using backtracking with pruning to avoid duplicates.

中等
79

单词搜索

Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.

中等
89

格雷编码

Generate an n-bit Gray Code sequence using backtracking with pruning and bit manipulation techniques.

中等
90

子集 II

Subsets II problem asks to generate unique subsets from an array with possible duplicates using backtracking search with…

中等
93

复原 IP 地址

Restore all valid IP addresses from a string using backtracking with pruning, avoiding invalid segments or leading zeros…

中等
95

不同的二叉搜索树 II

Generate all structurally unique BSTs with values 1 to n using backtracking and recursive tree construction techniques.

中等
113

路径总和 II

Find all root-to-leaf paths in a binary tree where the sum of node values equals a given target using DFS backtracking.

中等
126

单词接龙 II

Find all shortest transformation sequences from beginWord to endWord using a dictionary, leveraging backtracking search …

困难
131

分割回文串

Find all possible palindrome partitioning of a string using backtracking and dynamic programming.

中等
140

单词拆分 II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

困难
212

单词搜索 II

Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.

困难
216

组合总和 III

Find all unique combinations of k numbers adding to n using efficient backtracking with pruning in arrays.

中等
257

二叉树的所有路径

Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…

简单
282

给表达式添加运算符

Expression Add Operators is solved with backtracking that builds multi-digit operands and tracks multiplication preceden…

困难

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 回溯题型题解:88题训练路线