mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-10 08:50:20 +08:00
deploy
This commit is contained in:
@ -5010,6 +5010,7 @@
|
||||
<p>相比基于前序遍历的代码实现,基于回溯算法框架的代码实现虽然显得啰嗦,但通用性更好。实际上,<strong>许多回溯问题都可以在该框架下解决</strong>。我们只需根据具体问题来定义 <code>state</code> 和 <code>choices</code> ,并实现框架中的各个方法即可。</p>
|
||||
<h2 id="1314">13.1.4. 常用术语<a class="headerlink" href="#1314" title="Permanent link">¶</a></h2>
|
||||
<p>为了更清晰地分析算法问题,我们总结一下回溯算法中常用术语的含义,并对照例题三给出对应示例。</p>
|
||||
<div class="center-table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -5051,6 +5052,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>问题、解、状态等概念是通用的,在分治、回溯、动态规划、贪心等算法中都有涉及。</p>
|
||||
|
@ -3508,6 +3508,8 @@
|
||||
<h1 id="132">13.2. 全排列问题<a class="headerlink" href="#132" title="Permanent link">¶</a></h1>
|
||||
<p>全排列问题是回溯算法的一个典型应用。它的定义是在给定一个集合(如一个数组或字符串)的情况下,找出这个集合中元素的所有可能的排列。</p>
|
||||
<p>下表列举了几个示例数据,包括输入数组和对应的所有排列。</p>
|
||||
<p align="center"> 表:数组与链表的效率对比 </p>
|
||||
|
||||
<div class="center-table">
|
||||
<table>
|
||||
<thead>
|
||||
|
Reference in New Issue
Block a user