This commit is contained in:
krahets 2023-11-26 02:06:45 +08:00
parent 8b60940d5a
commit baa76db4e1
110 changed files with 7129 additions and 254 deletions

View file

@ -871,6 +871,8 @@
@ -979,12 +981,40 @@
<li class="md-nav__item">
<a href="/chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="/chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -895,6 +895,8 @@
@ -1119,12 +1121,40 @@
<li class="md-nav__item">
<a href="../ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3779,7 +3809,7 @@
<div class="highlight"><span class="filename">array.swift</span><pre><span></span><code><a id="__codelineno-29-1" name="__codelineno-29-1" href="#__codelineno-29-1"></a><span class="cm">/* 在数组的索引 index 处插入元素 num */</span>
<a id="__codelineno-29-2" name="__codelineno-29-2" href="#__codelineno-29-2"></a><span class="kd">func</span> <span class="nf">insert</span><span class="p">(</span><span class="n">nums</span><span class="p">:</span> <span class="kr">inout</span> <span class="p">[</span><span class="nb">Int</span><span class="p">],</span> <span class="n">num</span><span class="p">:</span> <span class="nb">Int</span><span class="p">,</span> <span class="n">index</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">{</span>
<a id="__codelineno-29-3" name="__codelineno-29-3" href="#__codelineno-29-3"></a> <span class="c1">// 把索引 index 以及之后的所有元素向后移动一位</span>
<a id="__codelineno-29-4" name="__codelineno-29-4" href="#__codelineno-29-4"></a> <span class="k">for</span> <span class="n">i</span> <span class="k">in</span> <span class="n">sequence</span><span class="p">(</span><span class="bp">first</span><span class="p">:</span> <span class="n">nums</span><span class="p">.</span><span class="bp">count</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">next</span><span class="p">:</span> <span class="p">{</span> <span class="nv">$0</span> <span class="o">&gt;</span> <span class="n">index</span> <span class="o">+</span> <span class="mi">1</span> <span class="p">?</span> <span class="nv">$0</span> <span class="o">-</span> <span class="mi">1</span> <span class="p">:</span> <span class="kc">nil</span> <span class="p">})</span> <span class="p">{</span>
<a id="__codelineno-29-4" name="__codelineno-29-4" href="#__codelineno-29-4"></a> <span class="k">for</span> <span class="n">i</span> <span class="k">in</span> <span class="n">nums</span><span class="p">.</span><span class="bp">indices</span><span class="p">.</span><span class="bp">dropFirst</span><span class="p">(</span><span class="n">index</span><span class="p">).</span><span class="n">reversed</span><span class="p">()</span> <span class="p">{</span>
<a id="__codelineno-29-5" name="__codelineno-29-5" href="#__codelineno-29-5"></a> <span class="n">nums</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">=</span> <span class="n">nums</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
<a id="__codelineno-29-6" name="__codelineno-29-6" href="#__codelineno-29-6"></a> <span class="p">}</span>
<a id="__codelineno-29-7" name="__codelineno-29-7" href="#__codelineno-29-7"></a> <span class="c1">// 将 num 赋给 index 处元素</span>
@ -3921,12 +3951,11 @@
<div class="tabbed-block">
<div class="highlight"><span class="filename">array.swift</span><pre><span></span><code><a id="__codelineno-41-1" name="__codelineno-41-1" href="#__codelineno-41-1"></a><span class="cm">/* 删除索引 index 处元素 */</span>
<a id="__codelineno-41-2" name="__codelineno-41-2" href="#__codelineno-41-2"></a><span class="kd">func</span> <span class="nf">remove</span><span class="p">(</span><span class="n">nums</span><span class="p">:</span> <span class="kr">inout</span> <span class="p">[</span><span class="nb">Int</span><span class="p">],</span> <span class="n">index</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">{</span>
<a id="__codelineno-41-3" name="__codelineno-41-3" href="#__codelineno-41-3"></a> <span class="kd">let</span> <span class="nv">count</span> <span class="p">=</span> <span class="n">nums</span><span class="p">.</span><span class="bp">count</span>
<a id="__codelineno-41-4" name="__codelineno-41-4" href="#__codelineno-41-4"></a> <span class="c1">// 把索引 index 之后的所有元素向前移动一位</span>
<a id="__codelineno-41-5" name="__codelineno-41-5" href="#__codelineno-41-5"></a> <span class="k">for</span> <span class="n">i</span> <span class="k">in</span> <span class="n">sequence</span><span class="p">(</span><span class="bp">first</span><span class="p">:</span> <span class="n">index</span><span class="p">,</span> <span class="n">next</span><span class="p">:</span> <span class="p">{</span> <span class="nv">$0</span> <span class="o">&lt;</span> <span class="bp">count</span> <span class="o">-</span> <span class="mi">1</span> <span class="o">-</span> <span class="mi">1</span> <span class="p">?</span> <span class="nv">$0</span> <span class="o">+</span> <span class="mi">1</span> <span class="p">:</span> <span class="kc">nil</span> <span class="p">})</span> <span class="p">{</span>
<a id="__codelineno-41-6" name="__codelineno-41-6" href="#__codelineno-41-6"></a> <span class="n">nums</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">=</span> <span class="n">nums</span><span class="p">[</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<a id="__codelineno-41-7" name="__codelineno-41-7" href="#__codelineno-41-7"></a> <span class="p">}</span>
<a id="__codelineno-41-8" name="__codelineno-41-8" href="#__codelineno-41-8"></a><span class="p">}</span>
<a id="__codelineno-41-3" name="__codelineno-41-3" href="#__codelineno-41-3"></a> <span class="c1">// 把索引 index 之后的所有元素向前移动一位</span>
<a id="__codelineno-41-4" name="__codelineno-41-4" href="#__codelineno-41-4"></a> <span class="k">for</span> <span class="n">i</span> <span class="k">in</span> <span class="n">nums</span><span class="p">.</span><span class="bp">indices</span><span class="p">.</span><span class="bp">dropFirst</span><span class="p">(</span><span class="n">index</span><span class="p">).</span><span class="bp">dropLast</span><span class="p">()</span> <span class="p">{</span>
<a id="__codelineno-41-5" name="__codelineno-41-5" href="#__codelineno-41-5"></a> <span class="n">nums</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">=</span> <span class="n">nums</span><span class="p">[</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<a id="__codelineno-41-6" name="__codelineno-41-6" href="#__codelineno-41-6"></a> <span class="p">}</span>
<a id="__codelineno-41-7" name="__codelineno-41-7" href="#__codelineno-41-7"></a><span class="p">}</span>
</code></pre></div>
</div>
<div class="tabbed-block">

View file

@ -895,6 +895,8 @@
@ -1003,12 +1005,40 @@
<li class="md-nav__item">
<a href="ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3302,7 +3332,8 @@
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/array/">4.1 &nbsp; 数组</a></li>
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/linked_list/">4.2 &nbsp; 链表</a></li>
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/list/">4.3 &nbsp; 列表</a></li>
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/summary/">4.4 &nbsp; 小结</a></li>
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/ram_and_cache/">4.4 &nbsp; 内存与缓存 *</a></li>
<li><a href="https://www.hello-algo.com/chapter_array_and_linkedlist/summary/">4.5 &nbsp; 小结</a></li>
</ul>
<!-- Source file information -->

View file

@ -895,6 +895,8 @@
@ -1112,12 +1114,40 @@
<li class="md-nav__item">
<a href="../ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -4433,19 +4463,14 @@
<td>分散内存空间</td>
</tr>
<tr>
<td>缓存局部性</td>
<td>友好</td>
<td>不友好</td>
</tr>
<tr>
<td>容量扩展</td>
<td>长度不可变</td>
<td>可灵活扩展</td>
</tr>
<tr>
<td>内存效率</td>
<td>占用内存少、浪费部分空间</td>
<td>占用内存多</td>
<td>元素占用内存少、但可能浪费空间</td>
<td>元素占用内存多</td>
</tr>
<tr>
<td>访问元素</td>

View file

@ -18,7 +18,7 @@
<link rel="prev" href="../linked_list/">
<link rel="next" href="../summary/">
<link rel="next" href="../ram_and_cache/">
<link rel="icon" href="../../assets/images/favicon.png">
@ -895,6 +895,8 @@
@ -1105,12 +1107,40 @@
<li class="md-nav__item">
<a href="../ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3499,7 +3529,7 @@
<div class="tabbed-block">
<div class="highlight"><span class="filename">list_test.go</span><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="cm">/* 初始化列表 */</span>
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="c1">// 无初始值</span>
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="nx">nums1</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="p">[]</span><span class="kt">int</span>
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="nx">nums1</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="p">[]</span><span class="kt">int</span><span class="p">{}</span>
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="c1">// 有初始值</span>
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="nx">nums</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="p">[]</span><span class="kt">int</span><span class="p">{</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w"> </span><span class="mi">4</span><span class="p">}</span>
</code></pre></div>
@ -5449,9 +5479,9 @@ aria-label="页脚"
<a
href="../summary/"
href="../ram_and_cache/"
class="md-footer__link md-footer__link--next"
aria-label="下一页: 4.4 &amp;nbsp; 小结"
aria-label="下一页: 4.4 &amp;nbsp; 内存与缓存 *"
rel="next"
>
<div class="md-footer__title">
@ -5459,7 +5489,7 @@ aria-label="页脚"
下一页
</span>
<div class="md-ellipsis">
4.4 &nbsp; 小结
4.4 &nbsp; 内存与缓存 *
</div>
</div>
<div class="md-footer__button md-icon">
@ -5568,13 +5598,13 @@ aria-label="页脚"
<a href="../summary/" class="md-footer__link md-footer__link--next" aria-label="下一页: 4.4 &amp;nbsp; 小结" rel="next">
<a href="../ram_and_cache/" class="md-footer__link md-footer__link--next" aria-label="下一页: 4.4 &amp;nbsp; 内存与缓存 *" rel="next">
<div class="md-footer__title">
<span class="md-footer__direction">
下一页
</span>
<div class="md-ellipsis">
4.4 &nbsp; 小结
4.4 &nbsp; 内存与缓存 *
</div>
</div>
<div class="md-footer__button md-icon">

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@
<link rel="canonical" href="https://www.hello-algo.com/chapter_array_and_linkedlist/summary/">
<link rel="prev" href="../list/">
<link rel="prev" href="../ram_and_cache/">
<link rel="next" href="../../chapter_stack_and_queue/">
@ -26,7 +26,7 @@
<title>4.4   小结 - Hello 算法</title>
<title>4.5   小结 - Hello 算法</title>
@ -94,7 +94,7 @@
<div data-md-component="skip">
<a href="#44" class="md-skip">
<a href="#45" class="md-skip">
跳转至
</a>
@ -129,7 +129,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
</div>
@ -895,6 +895,8 @@
@ -1002,6 +1004,34 @@
<li class="md-nav__item">
<a href="../ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
@ -1017,7 +1047,7 @@
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -1028,7 +1058,7 @@
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3351,7 +3381,7 @@
<!-- Page content -->
<h1 id="44">4.4 &nbsp; 小结<a class="headerlink" href="#44" title="Permanent link">&para;</a></h1>
<h1 id="45">4.5 &nbsp; 小结<a class="headerlink" href="#45" title="Permanent link">&para;</a></h1>
<h3 id="1">1. &nbsp; 重点回顾<a class="headerlink" href="#1" title="Permanent link">&para;</a></h3>
<ul>
<li>数组和链表是两种基本的数据结构,分别代表数据在计算机内存中的两种存储方式:连续空间存储和分散空间存储。两者的特点呈现出互补的特性。</li>
@ -3360,6 +3390,9 @@
<li>常见的链表类型包括单向链表、循环链表、双向链表,它们分别具有各自的应用场景。</li>
<li>列表是一种支持增删查改的元素有序集合,通常基于动态数组实现,其保留了数组的优势,同时可以灵活调整长度。</li>
<li>列表的出现大幅地提高了数组的实用性,但可能导致部分内存空间浪费。</li>
<li>程序运行时,数据主要存储在内存中。数组提供更高的内存空间效率,而链表则在内存使用上更加灵活。</li>
<li>缓存通过缓存行、预取机制以及空间和时间局部性等数据加载机制,为 CPU 提供快速数据访问,显著提升程序的执行效率。</li>
<li>由于数组具有更高的缓存命中率,因此它通常比链表更高效。在选择数据结构时,应根据具体需求和场景做出恰当选择。</li>
</ul>
<h3 id="2-q-a">2. &nbsp; Q &amp; A<a class="headerlink" href="#2-q-a" title="Permanent link">&para;</a></h3>
<div class="admonition question">
@ -3445,9 +3478,9 @@ aria-label="页脚"
<a
href="../list/"
href="../ram_and_cache/"
class="md-footer__link md-footer__link--prev"
aria-label="上一页: 4.3 &amp;nbsp; 列表"
aria-label="上一页: 4.4 &amp;nbsp; 内存与缓存 *"
rel="prev"
>
<div class="md-footer__button md-icon">
@ -3459,7 +3492,7 @@ aria-label="页脚"
上一页
</span>
<div class="md-ellipsis">
4.3 &nbsp; 列表
4.4 &nbsp; 内存与缓存 *
</div>
</div>
</a>
@ -3571,7 +3604,7 @@ aria-label="页脚"
<nav class="md-footer__inner md-grid" aria-label="页脚" >
<a href="../list/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 4.3 &amp;nbsp; 列表" rel="prev">
<a href="../ram_and_cache/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 4.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>
@ -3581,7 +3614,7 @@ aria-label="页脚"
上一页
</span>
<div class="md-ellipsis">
4.3 &nbsp; 列表
4.4 &nbsp; 内存与缓存 *
</div>
</div>
</a>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -895,6 +895,8 @@
@ -1003,12 +1005,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -1010,6 +1010,8 @@
@ -1118,12 +1120,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -949,6 +949,8 @@
@ -1057,12 +1059,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -1004,6 +1004,8 @@
@ -1112,12 +1114,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -949,6 +949,8 @@
@ -1057,12 +1059,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -1045,6 +1045,8 @@
@ -1153,12 +1155,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3709,7 +3739,7 @@
</div>
</div>
</div>
<p>根据以上方法,可以得到算法运行时间为 <span class="arithmatex">\(6n + 12\)</span> ns </p>
<p>根据以上方法,可以得到算法运行时间为 <span class="arithmatex">\((6n + 12)\)</span> ns </p>
<div class="arithmatex">\[
1 + 1 + 10 + (1 + 5) \times n = 6n + 12
\]</div>

View file

@ -905,6 +905,8 @@
@ -1013,12 +1015,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3469,7 +3499,7 @@
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="c1">// 使用多种基本数据类型来初始化数组</span>
<a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a><span class="kd">let</span><span class="w"> </span><span class="n">numbers</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">i32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="fm">vec!</span><span class="p">[</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="mi">5</span><span class="p">];</span>
<a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a><span class="kd">let</span><span class="w"> </span><span class="n">decimals</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="n">float</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="fm">vec!</span><span class="p">[</span><span class="mf">0.0</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">];</span>
<a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a><span class="kd">let</span><span class="w"> </span><span class="n">decimals</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">f32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="fm">vec!</span><span class="p">[</span><span class="mf">0.0</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">];</span>
<a id="__codelineno-9-4" name="__codelineno-9-4" href="#__codelineno-9-4"></a><span class="kd">let</span><span class="w"> </span><span class="n">characters</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="fm">vec!</span><span class="p">[</span><span class="sc">&#39;0&#39;</span><span class="p">;</span><span class="w"> </span><span class="mi">5</span><span class="p">];</span>
<a id="__codelineno-9-5" name="__codelineno-9-5" href="#__codelineno-9-5"></a><span class="kd">let</span><span class="w"> </span><span class="n">bools</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">bool</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="fm">vec!</span><span class="p">[</span><span class="kc">false</span><span class="p">;</span><span class="w"> </span><span class="mi">5</span><span class="p">];</span>
</code></pre></div>

View file

@ -970,6 +970,8 @@
@ -1078,12 +1080,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -949,6 +949,8 @@
@ -1057,12 +1059,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3370,14 +3400,17 @@
<li><strong>网状结构</strong>:图,元素之间是多对多的关系。</li>
</ul>
<h2 id="312">3.1.2 &nbsp; 物理结构:连续与分散<a class="headerlink" href="#312" title="Permanent link">&para;</a></h2>
<p>在计算机中,内存和硬盘是两种主要的存储硬件设备。硬盘主要用于长期存储数据,容量较大(通常可达到 TB 级别)、速度较慢。内存用于运行程序时暂存数据,速度较快,但容量较小(通常为 GB 级别)。</p>
<p><strong>在算法运行过程中,相关数据都存储在内存中</strong>。图 3-2 展示了一个计算机内存条,其中每个黑色方块都包含一块内存空间。我们可以将内存想象成一个巨大的 Excel 表格,其中每个单元格都可以存储一定大小的数据,在算法运行时,所有数据都被存储在这些单元格中。</p>
<p><strong>当算法程序运行时,正在处理的数据主要被存储在内存中</strong>。图 3-2 展示了一个计算机内存条,其中每个黑色方块都包含一块内存空间。我们可以将内存想象成一个巨大的 Excel 表格,其中每个单元格都可以存储一定大小的数据。</p>
<p><strong>系统通过内存地址来访问目标位置的数据</strong>。如图 3-2 所示,计算机根据特定规则为表格中的每个单元格分配编号,确保每个内存空间都有唯一的内存地址。有了这些地址,程序便可以访问内存中的数据。</p>
<p><a class="glightbox" href="../classification_of_data_structure.assets/computer_memory_location.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="内存条、内存空间、内存地址" class="animation-figure" src="../classification_of_data_structure.assets/computer_memory_location.png" /></a></p>
<p align="center"> 图 3-2 &nbsp; 内存条、内存空间、内存地址 </p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>值得说明的是,将内存比作 Excel 表格是一个简化的类比,实际内存的工作机制比较复杂,涉及到地址空间、内存管理、缓存机制、虚拟和物理内存等概念。</p>
</div>
<p>内存是所有程序的共享资源,当某块内存被某个程序占用时,则无法被其他程序同时使用了。<strong>因此在数据结构与算法的设计中,内存资源是一个重要的考虑因素</strong>。比如,算法所占用的内存峰值不应超过系统剩余空闲内存;如果缺少连续大块的内存空间,那么所选用的数据结构必须能够存储在分散的内存空间内。</p>
<p>如图 3-3 所示,<strong>物理结构反映了数据在计算机内存中的存储方式</strong>,可分为连续空间存储(数组)和分散空间存储(链表)。物理结构从底层决定了数据的访问、更新、增删等操作方法,同时在时间效率和空间效率方面呈现出互补的特点。</p>
<p>如图 3-3 所示,<strong>物理结构反映了数据在计算机内存中的存储方式</strong>,可分为连续空间存储(数组)和分散空间存储(链表)。物理结构从底层决定了数据的访问、更新、增删等操作方法,在时间效率和空间效率方面呈现出互补的特点。</p>
<p><a class="glightbox" href="../classification_of_data_structure.assets/classification_phisical_structure.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="连续空间存储与分散空间存储" class="animation-figure" src="../classification_of_data_structure.assets/classification_phisical_structure.png" /></a></p>
<p align="center"> 图 3-3 &nbsp; 连续空间存储与分散空间存储 </p>

View file

@ -895,6 +895,8 @@
@ -1003,12 +1005,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -949,6 +949,8 @@
@ -1057,12 +1059,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -949,6 +949,8 @@
@ -1057,12 +1059,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -905,6 +905,8 @@
@ -1013,12 +1015,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -895,6 +895,8 @@
@ -1003,12 +1005,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -905,6 +905,8 @@
@ -1013,12 +1015,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -956,6 +956,8 @@
@ -1064,12 +1066,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -956,6 +956,8 @@
@ -1064,12 +1066,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -970,6 +970,8 @@
@ -1078,12 +1080,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -905,6 +905,8 @@
@ -1013,12 +1015,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -891,6 +891,8 @@
@ -999,12 +1001,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -4378,7 +4408,7 @@
</div>
</div>
<h2 id="1155">11.5.5 &nbsp; 尾递归优化<a class="headerlink" href="#1155" title="Permanent link">&para;</a></h2>
<p><strong>在某些输入下,快速排序可能占用空间较多</strong>。以完全倒序的输入数组为例,由于每轮哨兵划分后右子数组长度为 <span class="arithmatex">\(0\)</span> ,递归树的高度会达到 <span class="arithmatex">\(n - 1\)</span> ,此时需要占用 <span class="arithmatex">\(O(n)\)</span> 大小的栈帧空间。</p>
<p><strong>在某些输入下,快速排序可能占用空间较多</strong>。以完全倒序的输入数组为例,设递归中的子数组长度为 <span class="arithmatex">\(m\)</span> ,每轮哨兵划分操作都将产生长度为 <span class="arithmatex">\(0\)</span> 的左子数组和长度为 <span class="arithmatex">\(m - 1\)</span> 的右子数组,这意味着每一层递归调用减少的问题规模非常小(只减少一个元素),递归树的高度会达到 <span class="arithmatex">\(n - 1\)</span> ,此时需要占用 <span class="arithmatex">\(O(n)\)</span> 大小的栈帧空间。</p>
<p>为了防止栈帧空间的累积,我们可以在每轮哨兵排序完成后,比较两个子数组的长度,<strong>仅对较短的子数组进行递归</strong>。由于较短子数组的长度不会超过 <span class="arithmatex">\(n / 2\)</span> ,因此这种方法能确保递归深度不超过 <span class="arithmatex">\(\log n\)</span> ,从而将最差空间复杂度优化至 <span class="arithmatex">\(O(\log n)\)</span></p>
<div class="tabbed-set tabbed-alternate" data-tabs="5:12"><input checked="checked" id="__tabbed_5_1" name="__tabbed_5" type="radio" /><input id="__tabbed_5_2" name="__tabbed_5" type="radio" /><input id="__tabbed_5_3" name="__tabbed_5" type="radio" /><input id="__tabbed_5_4" name="__tabbed_5" type="radio" /><input id="__tabbed_5_5" name="__tabbed_5" type="radio" /><input id="__tabbed_5_6" name="__tabbed_5" type="radio" /><input id="__tabbed_5_7" name="__tabbed_5" type="radio" /><input id="__tabbed_5_8" name="__tabbed_5" type="radio" /><input id="__tabbed_5_9" name="__tabbed_5" type="radio" /><input id="__tabbed_5_10" name="__tabbed_5" type="radio" /><input id="__tabbed_5_11" name="__tabbed_5" type="radio" /><input id="__tabbed_5_12" name="__tabbed_5" type="radio" /><div class="tabbed-labels"><label for="__tabbed_5_1">Python</label><label for="__tabbed_5_2">C++</label><label for="__tabbed_5_3">Java</label><label for="__tabbed_5_4">C#</label><label for="__tabbed_5_5">Go</label><label for="__tabbed_5_6">Swift</label><label for="__tabbed_5_7">JS</label><label for="__tabbed_5_8">TS</label><label for="__tabbed_5_9">Dart</label><label for="__tabbed_5_10">Rust</label><label for="__tabbed_5_11">C</label><label for="__tabbed_5_12">Zig</label></div>
<div class="tabbed-content">

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3328,7 +3358,7 @@ aria-label="页脚"
<a
href="../chapter_array_and_linkedlist/summary/"
class="md-footer__link md-footer__link--prev"
aria-label="上一页: 4.4 &amp;nbsp; 小结"
aria-label="上一页: 4.5 &amp;nbsp; 小结"
rel="prev"
>
<div class="md-footer__button md-icon">
@ -3340,7 +3370,7 @@ aria-label="页脚"
上一页
</span>
<div class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</div>
</div>
</a>
@ -3452,7 +3482,7 @@ aria-label="页脚"
<nav class="md-footer__inner md-grid" aria-label="页脚" >
<a href="../chapter_array_and_linkedlist/summary/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 4.4 &amp;nbsp; 小结" rel="prev">
<a href="../chapter_array_and_linkedlist/summary/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 4.5 &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>
@ -3462,7 +3492,7 @@ aria-label="页脚"
上一页
</span>
<div class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</div>
</div>
</a>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>

View file

@ -893,6 +893,8 @@
@ -1001,12 +1003,40 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 内存与缓存 *
</span>
<span class="md-status md-status--new" title="最近添加">
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
<span class="md-ellipsis">
4.4 &nbsp; 小结
4.5 &nbsp; 小结
</span>
@ -3693,15 +3723,15 @@
<a id="__codelineno-14-52" name="__codelineno-14-52" href="#__codelineno-14-52"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">val</span><span class="p">(</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">null</span><span class="p">)</span>
<a id="__codelineno-14-53" name="__codelineno-14-53" href="#__codelineno-14-53"></a><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<a id="__codelineno-14-54" name="__codelineno-14-54" href="#__codelineno-14-54"></a><span class="w"> </span><span class="c1">// 前序遍历</span>
<a id="__codelineno-14-55" name="__codelineno-14-55" href="#__codelineno-14-55"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">order</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;pre&quot;</span><span class="p">)</span>
<a id="__codelineno-14-55" name="__codelineno-14-55" href="#__codelineno-14-55"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;pre&quot;</span><span class="p">.</span><span class="na">equals</span><span class="p">(</span><span class="n">order</span><span class="p">))</span>
<a id="__codelineno-14-56" name="__codelineno-14-56" href="#__codelineno-14-56"></a><span class="w"> </span><span class="n">res</span><span class="p">.</span><span class="na">add</span><span class="p">(</span><span class="n">val</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
<a id="__codelineno-14-57" name="__codelineno-14-57" href="#__codelineno-14-57"></a><span class="w"> </span><span class="n">dfs</span><span class="p">(</span><span class="n">left</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="w"> </span><span class="n">order</span><span class="p">,</span><span class="w"> </span><span class="n">res</span><span class="p">);</span>
<a id="__codelineno-14-58" name="__codelineno-14-58" href="#__codelineno-14-58"></a><span class="w"> </span><span class="c1">// 中序遍历</span>
<a id="__codelineno-14-59" name="__codelineno-14-59" href="#__codelineno-14-59"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">order</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;in&quot;</span><span class="p">)</span>
<a id="__codelineno-14-59" name="__codelineno-14-59" href="#__codelineno-14-59"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;in&quot;</span><span class="p">.</span><span class="na">equals</span><span class="p">(</span><span class="n">order</span><span class="p">))</span>
<a id="__codelineno-14-60" name="__codelineno-14-60" href="#__codelineno-14-60"></a><span class="w"> </span><span class="n">res</span><span class="p">.</span><span class="na">add</span><span class="p">(</span><span class="n">val</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
<a id="__codelineno-14-61" name="__codelineno-14-61" href="#__codelineno-14-61"></a><span class="w"> </span><span class="n">dfs</span><span class="p">(</span><span class="n">right</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="w"> </span><span class="n">order</span><span class="p">,</span><span class="w"> </span><span class="n">res</span><span class="p">);</span>
<a id="__codelineno-14-62" name="__codelineno-14-62" href="#__codelineno-14-62"></a><span class="w"> </span><span class="c1">// 后序遍历</span>
<a id="__codelineno-14-63" name="__codelineno-14-63" href="#__codelineno-14-63"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">order</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;post&quot;</span><span class="p">)</span>
<a id="__codelineno-14-63" name="__codelineno-14-63" href="#__codelineno-14-63"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;post&quot;</span><span class="p">.</span><span class="na">equals</span><span class="p">(</span><span class="n">order</span><span class="p">))</span>
<a id="__codelineno-14-64" name="__codelineno-14-64" href="#__codelineno-14-64"></a><span class="w"> </span><span class="n">res</span><span class="p">.</span><span class="na">add</span><span class="p">(</span><span class="n">val</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
<a id="__codelineno-14-65" name="__codelineno-14-65" href="#__codelineno-14-65"></a><span class="w"> </span><span class="p">}</span>
<a id="__codelineno-14-66" name="__codelineno-14-66" href="#__codelineno-14-66"></a>

Some files were not shown because too many files have changed in this diff Show more