<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>递归 on Chen Kai Blog</title><link>https://www.chenk.top/zh/tags/%E9%80%92%E5%BD%92/</link><description>Recent content in 递归 on Chen Kai Blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 14 Aug 2022 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/zh/tags/%E9%80%92%E5%BD%92/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode（八）：回溯算法</title><link>https://www.chenk.top/zh/leetcode/08-%E5%9B%9E%E6%BA%AF%E7%AE%97%E6%B3%95/</link><pubDate>Sun, 14 Aug 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/zh/leetcode/08-%E5%9B%9E%E6%BA%AF%E7%AE%97%E6%B3%95/</guid><description>&lt;p>当你遇到需要“枚举所有可能”的问题时，回溯算法几乎是不二之选——无论是全排列、子集、合法棋盘布局，还是网格中的路径搜索，它都能派上用场。简单来说，回溯是一种“带脑子的暴力搜索”：它一步步构建候选解，一旦发现当前路径违反约束、无法通向合法答案，就立刻放弃，并撤销上一步的选择，恢复到干净的状态，再尝试其他分支。整个过程可以浓缩为三个动作：&lt;strong>选择 → 递归 → 撤销&lt;/strong>。&lt;/p></description></item><item><title>LeetCode（六）：二叉树遍历与构造</title><link>https://www.chenk.top/zh/leetcode/06-%E4%BA%8C%E5%8F%89%E6%A0%91%E9%81%8D%E5%8E%86%E4%B8%8E%E6%9E%84%E9%80%A0/</link><pubDate>Fri, 15 Jul 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/zh/leetcode/06-%E4%BA%8C%E5%8F%89%E6%A0%91%E9%81%8D%E5%8E%86%E4%B8%8E%E6%9E%84%E9%80%A0/</guid><description>&lt;p>二叉树的题目，核心其实不在“树”本身，而在于两点：&lt;strong>访问节点的顺序&lt;/strong>，以及&lt;strong>在处理父节点之前，从子节点那里得到了什么信息&lt;/strong>。只要厘清这两点，前序、中序、后序、层序遍历的区别，递归与迭代的实现方式，乃至由两种遍历序列重建二叉树，甚至求最大深度、验证 BST 等经典题目，都能纳入同一套方法论框架。这篇文章的目的，就是带你彻底掌握这套方法。&lt;/p></description></item></channel></rss>