mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-10 11:00:59 +00:00
deploy
This commit is contained in:
@@ -559,7 +559,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 2h12v6l-4 4 4 4v6H6v-6l4-4-4-4V2m10 14.5-4-4-4 4V20h8v-3.5m-4-5 4-4V4H8v3.5l4 4M10 6h4v.75l-2 2-2-2V6Z"/></svg>
|
||||
|
||||
<span class="md-ellipsis">
|
||||
第 2 章 时空复杂度
|
||||
第 2 章 复杂度分析
|
||||
</span>
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_3">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
第 2 章 时空复杂度
|
||||
第 2 章 复杂度分析
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
@@ -3416,7 +3416,7 @@
|
||||
<p align="center"> 图 1-2 扑克排序步骤 </p>
|
||||
|
||||
<p>上述整理扑克牌的方法本质上是“插入排序”算法,它在处理小型数据集时非常高效。许多编程语言的排序库函数中都存在插入排序的身影。</p>
|
||||
<p><strong>例三:货币找零</strong>。假设我们在超市购买了 <span class="arithmatex">\(69\)</span> 元的商品,给收银员付了 <span class="arithmatex">\(100\)</span> 元,则收银员需要找我们 <span class="arithmatex">\(31\)</span> 元。他会很自然地完成图 1-3 所示的思考。</p>
|
||||
<p><strong>例三:货币找零</strong>。假设我们在超市购买了 <span class="arithmatex">\(69\)</span> 元的商品,给了收银员 <span class="arithmatex">\(100\)</span> 元,则收银员需要找我们 <span class="arithmatex">\(31\)</span> 元。他会很自然地完成如图 1-3 所示的思考。</p>
|
||||
<ol>
|
||||
<li>可选项是比 <span class="arithmatex">\(31\)</span> 元面值更小的货币,包括 <span class="arithmatex">\(1\)</span> 元、<span class="arithmatex">\(5\)</span> 元、<span class="arithmatex">\(10\)</span> 元、<span class="arithmatex">\(20\)</span> 元。</li>
|
||||
<li>从可选项中拿出最大的 <span class="arithmatex">\(20\)</span> 元,剩余 <span class="arithmatex">\(31 - 20 = 11\)</span> 元。</li>
|
||||
@@ -3431,7 +3431,7 @@
|
||||
<p>小到烹饪一道菜,大到星际航行,几乎所有问题的解决都离不开算法。计算机的出现使我们能够通过编程将数据结构存储在内存中,同时编写代码调用 CPU 和 GPU 执行算法。这样一来,我们就能把生活中的问题转移到计算机上,以更高效的方式解决各种复杂问题。</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>如果你对数据结构、算法、数组和二分查找等概念仍感到一知半解,请不要担心,继续往下阅读,这本书将引导你迈入数据结构与算法的知识殿堂。</p>
|
||||
<p>如果你对数据结构、算法、数组和二分查找等概念仍感到一知半解,请继续往下阅读,这本书将引导你迈入数据结构与算法的知识殿堂。</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user