mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-25 12:36:07 +00:00
deploy
This commit is contained in:
@@ -3414,9 +3414,9 @@
|
||||
<h1 id="117">11.7 堆排序<a class="headerlink" href="#117" title="Permanent link">¶</a></h1>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>阅读本节前,请确保已学完「堆」章节。</p>
|
||||
<p>阅读本节前,请确保已学完“堆“章节。</p>
|
||||
</div>
|
||||
<p>「堆排序 Heap Sort」是一种基于堆数据结构实现的高效排序算法。我们可以利用已经学过的“建堆操作”和“元素出堆操作”实现堆排序:</p>
|
||||
<p>「堆排序 heap sort」是一种基于堆数据结构实现的高效排序算法。我们可以利用已经学过的“建堆操作”和“元素出堆操作”实现堆排序:</p>
|
||||
<ol>
|
||||
<li>输入数组并建立小顶堆,此时最小元素位于堆顶。</li>
|
||||
<li>不断执行出堆操作,依次记录出堆元素,即可得到从小到大排序的序列。</li>
|
||||
|
||||
Reference in New Issue
Block a user