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
@@ -3730,12 +3730,12 @@
<!-- Page content -->
<h1 id="42-linked-list">4.2 &nbsp; Linked list<a class="headerlink" href="#42-linked-list" title="Permanent link">&para;</a></h1>
<p>Memory space is a shared resource among all programs. In a complex system environment, available memory can be dispersed throughout the memory space. We understand that the memory allocated for an array must be continuous. However, for very large arrays, finding a sufficiently large contiguous memory space might be challenging. This is where the flexible advantage of linked lists becomes evident.</p>
<p>A "linked list" is a linear data structure in which each element is a node object, and the nodes are interconnected through "references". These references hold the memory addresses of subsequent nodes, enabling navigation from one node to the next.</p>
<p>A <u>linked list</u> is a linear data structure in which each element is a node object, and the nodes are interconnected through "references". These references hold the memory addresses of subsequent nodes, enabling navigation from one node to the next.</p>
<p>The design of linked lists allows for their nodes to be distributed across memory locations without requiring contiguous memory addresses.</p>
<p><a class="glightbox" href="../linked_list.assets/linkedlist_definition.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Linked list definition and storage method" class="animation-figure" src="../linked_list.assets/linkedlist_definition.png" /></a></p>
<p align="center"> Figure 4-5 &nbsp; Linked list definition and storage method </p>
<p>As shown in the figure, we see that the basic building block of a linked list is the "node" object. Each node comprises two key components: the node's "value" and a "reference" to the next node.</p>
<p>As shown in the figure, we see that the basic building block of a linked list is the <u>node</u> object. Each node comprises two key components: the node's "value" and a "reference" to the next node.</p>
<ul>
<li>The first node in a linked list is the "head node", and the final one is the "tail node".</li>
<li>The tail node points to "null", designated as <code>null</code> in Java, <code>nullptr</code> in C++, and <code>None</code> in Python.</li>
@@ -5248,7 +5248,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>