This commit is contained in:
krahets
2023-08-17 05:12:16 +08:00
parent 2014338a92
commit 5884de5246
70 changed files with 1890 additions and 1219 deletions

View File

@ -3432,7 +3432,7 @@
<li><strong>合并阶段</strong>:当子数组长度为 1 时终止划分,开始合并,持续地将左右两个较短的有序数组合并为一个较长的有序数组,直至结束。</li>
</ol>
<p><img alt="归并排序的划分与合并阶段" src="../merge_sort.assets/merge_sort_overview.png" /></p>
<p align="center"> Fig. 归并排序的划分与合并阶段 </p>
<p align="center"> 图:归并排序的划分与合并阶段 </p>
<h2 id="1161">11.6.1. &nbsp; 算法流程<a class="headerlink" href="#1161" title="Permanent link">&para;</a></h2>
<p>“划分阶段”从顶至底递归地将数组从中点切为两个子数组:</p>
@ -3475,6 +3475,8 @@
</div>
</div>
</div>
<p align="center"> 图:归并排序步骤 </p>
<p>观察发现,归并排序的递归顺序与二叉树的后序遍历相同,具体来看:</p>
<ul>
<li><strong>后序遍历</strong>:先递归左子树,再递归右子树,最后处理根节点。</li>