Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dff9cbf

Browse files
update content
1 parent a28709a commit dff9cbf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎算法思维系列/回溯算法详解修订版.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434

3535
回溯算法是什么?解决回溯算法相关的问题有什么技巧?如何学习回溯算法?回溯算法代码是否有规律可循?
3636

37-
其实回溯算法和我们常说的 DFS 算法非常类似,本质上就是一种暴力穷举算法。回溯算法和 DFS 算法的细微差别是:**回溯算法是在遍历「树枝」,DFS 算法是在遍历「节点」**,本文就是简单提一下,你有个印象就行了。等你看了 [手把手刷二叉树(纲领篇)](https://labuladong.github.io/article/fname.html?fname=二叉树总结)[图论算法基础](https://labuladong.github.io/article/fname.html?fname=图) 之后就能深刻理解这句话的含义了。
37+
其实回溯算法和我们常说的 DFS 算法非常类似,本质上就是一种暴力穷举算法。回溯算法和 DFS 算法的细微差别是:回溯算法是在遍历「树枝」,DFS 算法是在遍历「节点」,本文就是简单提一下,你有个印象就行了。等你看了 [手把手刷二叉树(纲领篇)](https://labuladong.github.io/article/fname.html?fname=二叉树总结)[图论算法基础](https://labuladong.github.io/article/fname.html?fname=图) 之后就能深刻理解这句话的含义了。
3838

39-
废话不多说,直接上回溯算法框架,解决一个回溯问题,实际上就是一个决策树的遍历过程,站在回溯树的一个节点上,你只需要思考 3 个问题:
39+
**抽象地说,解决一个回溯问题,实际上就是遍历一棵决策树的过程,树的每个叶子节点存放着一个合法答案。你把整棵树遍历一遍,把叶子节点上的答案都收集起来,就能得到所有的合法答案**
40+
41+
站在回溯树的一个节点上,你只需要思考 3 个问题:
4042

4143
1、路径:也就是已经做出的选择。
4244

‎算法思维系列/学习数据结构和算法的高效方法.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ N 叉树的遍历框架,找出来了吧?你说,树这种结构重不重要
373373
- [本站简介](https://labuladong.github.io/article/fname.html?fname=home)
374374
- [环检测及拓扑排序算法](https://labuladong.github.io/article/fname.html?fname=拓扑排序)
375375
- [目标和:背包问题的变体](https://labuladong.github.io/article/fname.html?fname=targetSum)
376+
- [算法可视化功能简介(必读)](https://labuladong.github.io/article/fname.html?fname=可视化简介)
376377
- [算法学习和心流体验](https://labuladong.github.io/article/fname.html?fname=心流)
377378
- [算法时空复杂度分析实用指南](https://labuladong.github.io/article/fname.html?fname=时间复杂度)
378379
- [题目不让我干什么,我偏要干什么](https://labuladong.github.io/article/fname.html?fname=nestInteger)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /