This commit is contained in:
krahets
2023-02-28 20:02:48 +08:00
parent 3f5140e815
commit a436f145a1
90 changed files with 753 additions and 4433 deletions

View File

@ -25,7 +25,7 @@
<title>5.2.   队列Queue - Hello 算法</title>
<title>5.2.   队列 - Hello 算法</title>
@ -79,7 +79,7 @@
<div data-md-component="skip">
<a href="#52-queue" class="md-skip">
<a href="#52" class="md-skip">
跳转至
</a>
@ -111,7 +111,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
5.2. &nbsp; 队列Queue
5.2. &nbsp; 队列
</span>
</div>
@ -650,7 +650,7 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/array/" class="md-nav__link">
4.1. &nbsp; 数组Array
4.1. &nbsp; 数组
</a>
</li>
@ -664,7 +664,7 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/linked_list/" class="md-nav__link">
4.2. &nbsp; 链表Linked List
4.2. &nbsp; 链表
</a>
</li>
@ -678,7 +678,7 @@
<li class="md-nav__item">
<a href="../../chapter_array_and_linkedlist/list/" class="md-nav__link">
4.3. &nbsp; 列表List
4.3. &nbsp; 列表
</a>
</li>
@ -755,7 +755,7 @@
<li class="md-nav__item">
<a href="../stack/" class="md-nav__link">
5.1. &nbsp;Stack
5.1. &nbsp;
</a>
</li>
@ -778,12 +778,12 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
5.2. &nbsp; 队列Queue
5.2. &nbsp; 队列
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
5.2. &nbsp; 队列Queue
5.2. &nbsp; 队列
</a>
@ -865,7 +865,7 @@
<li class="md-nav__item">
<a href="../deque/" class="md-nav__link">
5.3. &nbsp; 双向队列Deque
5.3. &nbsp; 双向队列
</a>
</li>
@ -938,7 +938,7 @@
<li class="md-nav__item">
<a href="../../chapter_hashing/hash_map/" class="md-nav__link">
6.1. &nbsp; 哈希表Hash Map
6.1. &nbsp; 哈希表
</a>
</li>
@ -1011,14 +1011,14 @@
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
7. &nbsp; &nbsp; 二叉
7. &nbsp; &nbsp;
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
7. &nbsp; &nbsp; 二叉
7. &nbsp; &nbsp;
</label>
<ul class="md-nav__list" data-md-scrollfix>
@ -1029,7 +1029,7 @@
<li class="md-nav__item">
<a href="../../chapter_tree/binary_tree/" class="md-nav__link">
7.1. &nbsp; 二叉树Binary Tree
7.1. &nbsp; 二叉树
</a>
</li>
@ -1144,7 +1144,7 @@
<li class="md-nav__item">
<a href="../../chapter_heap/heap/" class="md-nav__link">
8.1. &nbsp;Heap
8.1. &nbsp;
</a>
</li>
@ -1233,7 +1233,7 @@
<li class="md-nav__item">
<a href="../../chapter_graph/graph/" class="md-nav__link">
9.1. &nbsp;Graph
9.1. &nbsp;
</a>
</li>
@ -1742,7 +1742,7 @@
<h1 id="52-queue">5.2. &nbsp; 队列Queue<a class="headerlink" href="#52-queue" title="Permanent link">&para;</a></h1>
<h1 id="52">5.2. &nbsp; 队列<a class="headerlink" href="#52" title="Permanent link">&para;</a></h1>
<p>「队列 Queue」是一种遵循「先入先出 first in, first out」数据操作规则的线性数据结构。顾名思义队列模拟的是排队现象即外面的人不断加入队列尾部而处于队列头部的人不断地离开。</p>
<p>我们将队列头部称为「队首」,队列尾部称为「队尾」,将把元素加入队尾的操作称为「入队」,删除队首元素的操作称为「出队」。</p>
<p><img alt="队列的先入先出规则" src="../queue.assets/queue_operations.png" /></p>
@ -3417,7 +3417,7 @@
<nav class="md-footer__inner md-grid" aria-label="页脚" >
<a href="../stack/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 5.1. &amp;nbsp; 栈Stack" rel="prev">
<a href="../stack/" class="md-footer__link md-footer__link--prev" aria-label="上一页: 5.1. &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>
@ -3426,20 +3426,20 @@
<span class="md-footer__direction">
上一页
</span>
5.1. &nbsp;Stack
5.1. &nbsp;
</div>
</div>
</a>
<a href="../deque/" class="md-footer__link md-footer__link--next" aria-label="下一页: 5.3. &amp;nbsp; 双向队列Deque" rel="next">
<a href="../deque/" class="md-footer__link md-footer__link--next" aria-label="下一页: 5.3. &amp;nbsp; 双向队列" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
下一页
</span>
5.3. &nbsp; 双向队列Deque
5.3. &nbsp; 双向队列
</div>
</div>
<div class="md-footer__button md-icon">