This commit is contained in:
krahets 2023-06-12 23:05:10 +08:00
parent fc1707df0b
commit 6eabe4597f
91 changed files with 3965 additions and 249 deletions

View file

@ -1184,6 +1184,8 @@
@ -1227,7 +1229,21 @@
<li class="md-nav__item">
<a href="/chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="/chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1241,7 +1257,7 @@
<li class="md-nav__item">
<a href="/chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1259,6 +1259,8 @@
@ -1302,7 +1304,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1316,7 +1332,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1259,6 +1259,8 @@
@ -1302,7 +1304,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1316,7 +1332,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1245,6 +1245,8 @@
@ -1288,7 +1290,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1302,7 +1318,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1238,6 +1238,8 @@
@ -1281,7 +1283,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1295,7 +1311,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1272,6 +1272,8 @@
@ -1315,7 +1317,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1329,7 +1345,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1300,6 +1300,8 @@
@ -1343,7 +1345,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1357,7 +1373,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1238,6 +1238,8 @@
@ -1281,7 +1283,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1295,7 +1311,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1348,6 +1348,8 @@
@ -1391,7 +1393,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1405,7 +1421,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1266,6 +1266,8 @@
@ -1309,7 +1311,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1323,7 +1339,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1245,6 +1245,8 @@
@ -1288,7 +1290,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1302,7 +1318,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1245,6 +1245,8 @@
@ -1288,7 +1290,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1302,7 +1318,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -2166,7 +2182,7 @@
<div class="arithmatex">\[
\text { val } = (-1)^0 \times 2^{124 - 127} \times (1 + 0.375) = 0.171875
\]</div>
<p>现在我们可以回答最初的问题:<strong><code>float</code> 的表示方式包含指数位,导致其取值范围远大于 <code>int</code></strong> <code>。根据以上计算,float</code> 可表示的最大正数为 <span class="arithmatex">\(2^{254 - 127} \times (2 - 2^{-23}) \approx 3.4 \times 10^{38}\)</span> ,切换符号位便可得到最小负数。</p>
<p>现在我们可以回答最初的问题:<strong><code>float</code> 的表示方式包含指数位,导致其取值范围远大于 <code>int</code></strong> 。根据以上计算,<code>float</code> 可表示的最大正数为 <span class="arithmatex">\(2^{254 - 127} \times (2 - 2^{-23}) \approx 3.4 \times 10^{38}\)</span> ,切换符号位便可得到最小负数。</p>
<p><strong>尽管浮点数 <code>float</code> 扩展了取值范围,但其副作用是牺牲了精度</strong>。整数类型 <code>int</code> 将全部 32 位用于表示数字,数字是均匀分布的;而由于指数位的存在,浮点数 <code>float</code> 的数值越大,相邻两个数字之间的差值就会趋向越大。</p>
<p>进一步地,指数位 <span class="arithmatex">\(E = 0\)</span><span class="arithmatex">\(E = 255\)</span> 具有特殊含义,<strong>用于表示零、无穷大、<span class="arithmatex">\(\mathrm{NaN}\)</span></strong></p>
<div class="center-table">

View file

@ -1238,6 +1238,8 @@
@ -1281,7 +1283,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1295,7 +1311,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -2079,7 +2095,7 @@
<nav class="md-footer__inner md-grid" aria-label="页脚" >
<a href="../chapter_heap/summary/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 8.3. &amp;nbsp; 小结" rel="prev">
<a href="../chapter_heap/summary/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 8.4. &amp;nbsp; 小结" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</div>
@ -2088,7 +2104,7 @@
上一页
</span>
<div class="md-ellipsis">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</div>
</div>
</a>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1272,6 +1272,8 @@
@ -1315,7 +1317,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1329,7 +1345,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1252,6 +1252,8 @@
@ -1295,7 +1297,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1309,7 +1325,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -18,14 +18,14 @@
<link rel="prev" href="../heap/">
<link rel="next" href="../summary/">
<link rel="next" href="../top_k/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.1.11">
<title>8.2.   建堆操作 * - Hello 算法</title>
<title>8.2.   建堆操作 - Hello 算法</title>
@ -113,7 +113,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</span>
</div>
@ -1197,6 +1197,8 @@
@ -1249,12 +1251,12 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
@ -1307,9 +1309,23 @@
<li class="md-nav__item">
<a href="../top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
<li class="md-nav__item">
<a href="../summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -2082,7 +2098,7 @@
<h1 id="82">8.2. &nbsp; 建堆操作 *<a class="headerlink" href="#82" title="Permanent link">&para;</a></h1>
<h1 id="82">8.2. &nbsp; 建堆操作<a class="headerlink" href="#82" title="Permanent link">&para;</a></h1>
<p>如果我们想要根据输入列表生成一个堆,这个过程被称为「建堆」。</p>
<h2 id="821">8.2.1. &nbsp; 借助入堆方法实现<a class="headerlink" href="#821" title="Permanent link">&para;</a></h2>
<p>最直接的方法是借助“元素入堆操作”实现,首先创建一个空堆,然后将列表元素依次添加到堆中。</p>
@ -2117,7 +2133,7 @@
</div>
<div class="tabbed-block">
<div class="highlight"><span class="filename">my_heap.py</span><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">nums</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">int</span><span class="p">]):</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;构造方法&quot;&quot;&quot;</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;构造方法,根据输入列表建堆&quot;&quot;&quot;</span>
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a> <span class="c1"># 将列表元素原封不动添加进堆</span>
<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a> <span class="bp">self</span><span class="o">.</span><span class="n">max_heap</span> <span class="o">=</span> <span class="n">nums</span>
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a> <span class="c1"># 堆化除叶节点以外的其他所有节点</span>
@ -2359,13 +2375,13 @@ T(h) &amp; = 2 \frac{1 - 2^h}{1 - 2} - h \newline
<a href="../summary/" class="md-footer__link md-footer__link--next" aria-label="下一页: 8.3. &amp;nbsp; 小结" rel="next">
<a href="../top_k/" class="md-footer__link md-footer__link--next" aria-label="下一页: 8.3. &amp;nbsp; Top-K 问题" rel="next">
<div class="md-footer__title">
<span class="md-footer__direction">
下一页
</span>
<div class="md-ellipsis">
8.3. &nbsp; 小结
8.3. &nbsp; Top-K 问题
</div>
</div>
<div class="md-footer__button md-icon">

View file

@ -1197,6 +1197,8 @@
@ -1329,7 +1331,21 @@
<li class="md-nav__item">
<a href="../build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1343,7 +1359,7 @@
<li class="md-nav__item">
<a href="../summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -3589,13 +3605,13 @@
<a href="../build_heap/" class="md-footer__link md-footer__link--next" aria-label="下一页: 8.2. &amp;nbsp; 建堆操作 *" rel="next">
<a href="../build_heap/" class="md-footer__link md-footer__link--next" aria-label="下一页: 8.2. &amp;nbsp; 建堆操作" rel="next">
<div class="md-footer__title">
<span class="md-footer__direction">
下一页
</span>
<div class="md-ellipsis">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</div>
</div>
<div class="md-footer__button md-icon">

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -15,7 +15,7 @@
<link rel="canonical" href="https://www.hello-algo.com/chapter_heap/summary/">
<link rel="prev" href="../build_heap/">
<link rel="prev" href="../top_k/">
<link rel="next" href="../../chapter_graph/">
@ -25,7 +25,7 @@
<title>8.3.   小结 - Hello 算法</title>
<title>8.4.   小结 - Hello 算法</title>
@ -79,7 +79,7 @@
<div data-md-component="skip">
<a href="#83" class="md-skip">
<a href="#84" class="md-skip">
跳转至
</a>
@ -113,7 +113,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</span>
</div>
@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1263,7 +1279,7 @@
<a href="./" class="md-nav__link md-nav__link--active">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -2008,7 +2024,7 @@
<h1 id="83">8.3. &nbsp; 小结<a class="headerlink" href="#83" title="Permanent link">&para;</a></h1>
<h1 id="84">8.4. &nbsp; 小结<a class="headerlink" href="#84" title="Permanent link">&para;</a></h1>
<ul>
<li>堆是一棵完全二叉树,根据成立条件可分为大顶堆和小顶堆。大(小)顶堆的堆顶元素是最大(小)的。</li>
<li>优先队列的定义是具有出队优先级的队列,通常使用堆来实现。</li>
@ -2094,7 +2110,7 @@
<nav class="md-footer__inner md-grid" aria-label="页脚" >
<a href="../build_heap/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 8.2. &amp;nbsp; 建堆操作 *" rel="prev">
<a href="../top_k/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 8.3. &amp;nbsp; Top-K 问题" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</div>
@ -2103,7 +2119,7 @@
上一页
</span>
<div class="md-ellipsis">
8.2. &nbsp; 建堆操作 *
8.3. &nbsp; Top-K 问题
</div>
</div>
</a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

File diff suppressed because it is too large Load diff

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1252,6 +1252,8 @@
@ -1295,7 +1297,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1309,7 +1325,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1252,6 +1252,8 @@
@ -1295,7 +1297,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1309,7 +1325,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1266,6 +1266,8 @@
@ -1309,7 +1311,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1323,7 +1339,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1193,6 +1193,8 @@
@ -1236,7 +1238,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1250,7 +1266,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1195,6 +1195,8 @@
@ -1238,7 +1240,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1252,7 +1268,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1272,6 +1272,8 @@
@ -1315,7 +1317,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1329,7 +1345,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1272,6 +1272,8 @@
@ -1315,7 +1317,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1329,7 +1345,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1306,6 +1306,8 @@
@ -1349,7 +1351,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1363,7 +1379,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -917,10 +917,41 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
5.4. &nbsp; 小结
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
5.4. &nbsp; 小结
</a>
<nav class="md-nav md-nav--secondary" aria-label="目录">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
目录
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#541-q-a" class="md-nav__link">
5.4.1. &nbsp; Q &amp; A
</a>
</li>
</ul>
</nav>
</li>
@ -1207,6 +1238,8 @@
@ -1250,7 +1283,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1311,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -1987,6 +2034,21 @@
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
目录
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#541-q-a" class="md-nav__link">
5.4.1. &nbsp; Q &amp; A
</a>
</li>
</ul>
</nav>
</div>
</div>
@ -2016,6 +2078,19 @@
<li>队列是一种遵循先入先出原则的数据结构,同样可以通过数组或链表来实现。在时间效率和空间效率的对比上,队列的结论与前述栈的结论相似。</li>
<li>双向队列是一种具有更高自由度的队列,它允许在两端进行元素的添加和删除操作。</li>
</ul>
<h2 id="541-q-a">5.4.1. &nbsp; Q &amp; A<a class="headerlink" href="#541-q-a" title="Permanent link">&para;</a></h2>
<div class="admonition question">
<p class="admonition-title">浏览器的前进后退是否是双向链表实现?</p>
<p>浏览器的前进后退功能本质上是“栈”的体现。当用户访问一个新页面时,该页面会被添加到栈顶;当用户点击后退按钮时,该页面会从栈顶弹出。使用双向队列可以方便实现一些额外操作,这个在双向队列章节有提到。</p>
</div>
<div class="admonition question">
<p class="admonition-title">在出栈后,是否需要释放出栈节点的内存?</p>
<p>如果后续仍需要使用弹出节点,则不需要释放内存。若之后不需要用到,<code>Java</code><code>Python</code> 等语言拥有自动垃圾回收机制,因此不需要手动释放内存;在 <code>C</code><code>C++</code> 中需要手动释放内存。</p>
</div>
<div class="admonition question">
<p class="admonition-title">双向队列像是两个栈拼接在了一起,它的用途是什么?</p>
<p>双向队列就像是栈和队列的组合,或者是两个栈拼在了一起。它表现的是栈 + 队列的逻辑,因此可以实现栈与队列的所有应用,并且更加灵活。</p>
</div>

View file

@ -1252,6 +1252,8 @@
@ -1295,7 +1297,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1309,7 +1325,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1347,6 +1347,8 @@
@ -1390,7 +1392,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1404,7 +1420,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1286,6 +1286,8 @@
@ -1329,7 +1331,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1343,7 +1359,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1293,6 +1293,8 @@
@ -1336,7 +1338,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1350,7 +1366,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1285,6 +1285,8 @@
@ -1328,7 +1330,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1342,7 +1358,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1197,6 +1197,8 @@
@ -1240,7 +1242,21 @@
<li class="md-nav__item">
<a href="../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1254,7 +1270,7 @@
<li class="md-nav__item">
<a href="../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1207,6 +1207,8 @@
@ -1250,7 +1252,21 @@
<li class="md-nav__item">
<a href="../../chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1264,7 +1280,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>

View file

@ -1188,6 +1188,8 @@
@ -1231,7 +1233,21 @@
<li class="md-nav__item">
<a href="chapter_heap/build_heap/" class="md-nav__link">
8.2. &nbsp; 建堆操作 *
8.2. &nbsp; 建堆操作
</a>
</li>
<li class="md-nav__item">
<a href="chapter_heap/top_k/" class="md-nav__link">
8.3. &nbsp; Top-K 问题
</a>
</li>
@ -1245,7 +1261,7 @@
<li class="md-nav__item">
<a href="chapter_heap/summary/" class="md-nav__link">
8.3. &nbsp; 小结
8.4. &nbsp; 小结
</a>
</li>
@ -2054,7 +2070,7 @@
<p>如果你也面临类似的困扰,那么很幸运这本书找到了你。本书是我对此问题的给出的答案,虽然不一定正确,但至少是一次积极的尝试。这本书虽然不足以让你直接拿到 Offer ,但会引导你探索数据结构与算法的“知识地图”,带你了解不同“地雷”的形状大小和分布位置,让你掌握各种“排雷方法”。有了这些本领,相信你可以更加自如地应对刷题和阅读文献,逐步构建起完整的知识体系。</p>
<h3 align="left"> 作者简介 </h3>
<p>靳宇栋 (Krahets)大厂高级算法工程师上海交通大学硕士。力扣LeetCode全网阅读量最高博主其 LeetBook《图解算法数据结构》已被订阅 22 万本。</p>
<p>靳宇栋 (Krahets)大厂高级算法工程师上海交通大学硕士。力扣LeetCode全网阅读量最高博主其 LeetBook《图解算法数据结构》已被订阅 24 万本。</p>
<hr />
<h2 align="center"> 致谢 </h2>

File diff suppressed because one or more lines are too long

View file

@ -2,377 +2,382 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.hello-algo.com/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_appendix/contribution/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_appendix/installation/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/array/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/linked_list/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/list/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_backtracking/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_backtracking/backtracking_algorithm/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_backtracking/n_queens_problem/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_backtracking/permutations_problem/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_computational_complexity/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_computational_complexity/performance_evaluation/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_computational_complexity/space_complexity/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_computational_complexity/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_computational_complexity/time_complexity/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/basic_data_types/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/character_encoding/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/classification_of_data_structure/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/number_encoding/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_data_structure/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_graph/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_graph/graph/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_graph/graph_operations/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_graph/graph_traversal/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_graph/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_hashing/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_hashing/hash_collision/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_hashing/hash_map/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_hashing/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_heap/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_heap/build_heap/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_heap/heap/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_heap/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_heap/top_k/</loc>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_introduction/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_introduction/algorithms_are_everywhere/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_introduction/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_introduction/what_is_dsa/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_preface/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_preface/about_the_book/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_preface/suggestions/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_preface/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_reference/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/binary_search/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/binary_search_edge/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/replace_linear_by_hashing/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/searching_algorithm_revisited/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_searching/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/bubble_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/bucket_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/counting_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/heap_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/insertion_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/merge_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/quick_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/radix_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/selection_sort/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/sorting_algorithm/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_sorting/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_stack_and_queue/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_stack_and_queue/deque/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_stack_and_queue/queue/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_stack_and_queue/stack/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_stack_and_queue/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/array_representation_of_tree/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/avl_tree/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/binary_search_tree/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/binary_tree/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/binary_tree_traversal/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.hello-algo.com/chapter_tree/summary/</loc>
<lastmod>2023-06-05</lastmod>
<lastmod>2023-06-12</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.