This commit is contained in:
krahets
2024-05-02 01:46:20 +08:00
parent 5e90519796
commit 23353e7960
324 changed files with 420 additions and 419 deletions

View File

@@ -3675,7 +3675,7 @@
<!-- Page content -->
<h1 id="51-stack">5.1 &nbsp; Stack<a class="headerlink" href="#51-stack" title="Permanent link">&para;</a></h1>
<p>A "Stack" is a linear data structure that follows the principle of Last-In-First-Out (LIFO).</p>
<p>A <u>stack</u> is a linear data structure that follows the principle of Last-In-First-Out (LIFO).</p>
<p>We can compare a stack to a pile of plates on a table. To access the bottom plate, one must first remove the plates on top. By replacing the plates with various types of elements (such as integers, characters, objects, etc.), we obtain the data structure known as a stack.</p>
<p>As shown in Figure 5-1, we refer to the top of the pile of elements as the "top of the stack" and the bottom as the "bottom of the stack." The operation of adding elements to the top of the stack is called "push," and the operation of removing the top element is called "pop."</p>
<p><a class="glightbox" href="../stack.assets/stack_operations.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Stack's last-in-first-out rule" class="animation-figure" src="../stack.assets/stack_operations.png" /></a></p>
@@ -5721,7 +5721,7 @@ aria-label="Footer"
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2022-2024 krahets<br>The website content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>
Copyright &copy; 2024 krahets<br>The website content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>
</div>