mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 10:09:54 +08:00
deploy
This commit is contained in:
@@ -15,6 +15,10 @@
|
||||
<link rel="canonical" href="https://www.hello-algo.com/en/chapter_data_structure/classification_of_data_structure/">
|
||||
|
||||
|
||||
<link rel="prev" href="../">
|
||||
|
||||
|
||||
<link rel="next" href="../basic_data_types/">
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/images/favicon.png">
|
||||
@@ -22,7 +26,7 @@
|
||||
|
||||
|
||||
|
||||
<title>Classification Of Data Structures - Hello Algo</title>
|
||||
<title>3.1 Classification of Data Structures - Hello Algo</title>
|
||||
|
||||
|
||||
|
||||
@@ -87,7 +91,7 @@
|
||||
<div data-md-component="skip">
|
||||
|
||||
|
||||
<a href="#classification-of-data-structures" class="md-skip">
|
||||
<a href="#31-classification-of-data-structures" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
@@ -122,7 +126,7 @@
|
||||
<div class="md-header__topic" data-md-component="header-topic">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Classification Of Data Structures
|
||||
3.1 Classification of Data Structures
|
||||
|
||||
</span>
|
||||
</div>
|
||||
@@ -362,7 +366,7 @@
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
0.1 The Book
|
||||
0.1 About This Book
|
||||
</span>
|
||||
|
||||
|
||||
@@ -493,7 +497,7 @@
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
1.1 Algorithms Are Everywhere
|
||||
1.1 Algorithms are Everywhere
|
||||
</span>
|
||||
|
||||
|
||||
@@ -514,7 +518,7 @@
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
1.2 What Is Algorithms
|
||||
1.2 What is an Algorithm
|
||||
</span>
|
||||
|
||||
|
||||
@@ -628,7 +632,7 @@
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
2.1 Evaluating Algorithm Efficiency
|
||||
2.1 Algorithm Efficiency Assessment
|
||||
</span>
|
||||
|
||||
|
||||
@@ -729,6 +733,420 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked>
|
||||
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../" class="md-nav__link ">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 13.5v8H3v-8h8m-2 2H5v4h4v-4M12 2l5.5 9h-11L12 2m0 3.86L10.08 9h3.84L12 5.86M17.5 13c2.5 0 4.5 2 4.5 4.5S20 22 17.5 22 13 20 13 17.5s2-4.5 4.5-4.5m0 2a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5Z"/></svg>
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Chapter 3. Data Structures
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="0">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true">
|
||||
<label class="md-nav__title" for="__nav_4">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Chapter 3. Data Structures
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.1 Classification of Data Structures
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<a href="./" class="md-nav__link md-nav__link--active">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.1 Classification of Data Structures
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Table of contents
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#311-logical-structure-linear-and-non-linear" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
3.1.1 Logical Structure: Linear and Non-Linear
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#312-physical-structure-contiguous-and-dispersed" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
3.1.2 Physical Structure: Contiguous and Dispersed
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../basic_data_types/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.2 Fundamental Data Types
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../number_encoding/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.3 Number Encoding *
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../character_encoding/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.4 Character Encoding *
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../summary/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
3.5 Summary
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
|
||||
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../../chapter_array_and_linkedlist/" class="md-nav__link ">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 5v14h17V5H3m4 2v2H5V7h2m-2 6v-2h2v2H5m0 2h2v2H5v-2m13 2H9v-2h9v2m0-4H9v-2h9v2m0-4H9V7h9v2Z"/></svg>
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Chapter 4. Array and Linked List
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_5">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Chapter 4. Array and Linked List
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../chapter_array_and_linkedlist/array/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
4.1 Array
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../chapter_array_and_linkedlist/linked_list/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
4.2 Linked List
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../chapter_array_and_linkedlist/list/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
4.3 List
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../chapter_array_and_linkedlist/ram_and_cache/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
4.4 Memory and Cache
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../chapter_array_and_linkedlist/summary/" class="md-nav__link">
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
4.5 Summary
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -756,18 +1174,18 @@
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#logical-structures-linear-and-non-linear" class="md-nav__link">
|
||||
<a href="#311-logical-structure-linear-and-non-linear" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Logical Structures: Linear And Non-linear
|
||||
3.1.1 Logical Structure: Linear and Non-Linear
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#physical-structure-continuous-vs-dispersed" class="md-nav__link">
|
||||
<a href="#312-physical-structure-contiguous-and-dispersed" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Physical Structure: Continuous vs. Dispersed
|
||||
3.1.2 Physical Structure: Contiguous and Dispersed
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -809,42 +1227,47 @@
|
||||
|
||||
|
||||
<!-- Page content -->
|
||||
<h1 id="classification-of-data-structures">Classification Of Data Structures<a class="headerlink" href="#classification-of-data-structures" title="Permanent link">¶</a></h1>
|
||||
<p>Common data structures include arrays, linked lists, stacks, queues, hash tables, trees, heaps, and graphs. They can be divided into two categories: logical structure and physical structure.</p>
|
||||
<h2 id="logical-structures-linear-and-non-linear">Logical Structures: Linear And Non-linear<a class="headerlink" href="#logical-structures-linear-and-non-linear" title="Permanent link">¶</a></h2>
|
||||
<p><strong>Logical structures reveal logical relationships between data elements</strong>. In arrays and linked lists, data are arranged in sequential order, reflecting the linear relationship between data; while in trees, data are arranged hierarchically from the top down, showing the derived relationship between ancestors and descendants; and graphs are composed of nodes and edges, reflecting the complex network relationship.</p>
|
||||
<p>As shown in the figure below, logical structures can further be divided into "linear data structure" and "non-linear data structure". Linear data structures are more intuitive, meaning that the data are arranged linearly in terms of logical relationships; non-linear data structures, on the other hand, are arranged non-linearly.</p>
|
||||
<h1 id="31-classification-of-data-structures">3.1 Classification of Data Structures<a class="headerlink" href="#31-classification-of-data-structures" title="Permanent link">¶</a></h1>
|
||||
<p>Common data structures include arrays, linked lists, stacks, queues, hash tables, trees, heaps, and graphs. They can be classified into two dimensions: "Logical Structure" and "Physical Structure".</p>
|
||||
<h2 id="311-logical-structure-linear-and-non-linear">3.1.1 Logical Structure: Linear and Non-Linear<a class="headerlink" href="#311-logical-structure-linear-and-non-linear" title="Permanent link">¶</a></h2>
|
||||
<p><strong>The logical structure reveals the logical relationships between data elements</strong>. In arrays and linked lists, data is arranged in a certain order, reflecting a linear relationship between them. In trees, data is arranged from top to bottom in layers, showing a "ancestor-descendant" hierarchical relationship. Graphs, consisting of nodes and edges, represent complex network relationships.</p>
|
||||
<p>As shown in the Figure 3-1 , logical structures can be divided into two major categories: "Linear" and "Non-linear". Linear structures are more intuitive, indicating data is arranged linearly in logical relationships; non-linear structures, conversely, are arranged non-linearly.</p>
|
||||
<ul>
|
||||
<li><strong>Linear data structures</strong>: arrays, linked lists, stacks, queues, hash tables.</li>
|
||||
<li><strong>Nonlinear data structures</strong>: trees, heaps, graphs, hash tables.</li>
|
||||
<li><strong>Linear Data Structures</strong>: Arrays, Linked Lists, Stacks, Queues, Hash Tables.</li>
|
||||
<li><strong>Non-Linear Data Structures</strong>: Trees, Heaps, Graphs, Hash Tables.</li>
|
||||
</ul>
|
||||
<p><a class="glightbox" href="../classification_of_data_structure.assets/classification_logic_structure.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Linear and nonlinear data structures" src="../classification_of_data_structure.assets/classification_logic_structure.png" /></a></p>
|
||||
<p>Non-linear data structures can be further divided into tree and graph structures.</p>
|
||||
<p><a class="glightbox" href="../classification_of_data_structure.assets/classification_logic_structure.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Linear and Non-Linear Data Structures" class="animation-figure" src="../classification_of_data_structure.assets/classification_logic_structure.png" /></a></p>
|
||||
<p align="center"> Figure 3-1 Linear and Non-Linear Data Structures </p>
|
||||
|
||||
<p>Non-linear data structures can be further divided into tree structures and network structures.</p>
|
||||
<ul>
|
||||
<li><strong>Linear structures</strong>: arrays, linked lists, queues, stacks, hash tables, with one-to-one sequential relationship between elements.</li>
|
||||
<li><strong>Tree structure</strong>: tree, heap, hash table, with one-to-many relationship between elements.</li>
|
||||
<li><strong>Graph</strong>: graph with many-to-many relationship between elements.</li>
|
||||
<li><strong>Tree Structures</strong>: Trees, Heaps, Hash Tables, where elements have one-to-many relationships.</li>
|
||||
<li><strong>Network Structures</strong>: Graphs, where elements have many-to-many relationships.</li>
|
||||
</ul>
|
||||
<h2 id="physical-structure-continuous-vs-dispersed">Physical Structure: Continuous vs. Dispersed<a class="headerlink" href="#physical-structure-continuous-vs-dispersed" title="Permanent link">¶</a></h2>
|
||||
<p><strong>When an algorithm is running, the data being processed is stored in memory</strong>. The figure below shows a computer memory module where each black square represents a memory space. We can think of the memory as a giant Excel sheet in which each cell can store data of a certain size.</p>
|
||||
<p><strong>The system accesses the data at the target location by means of a memory address</strong>. As shown in the figure below, the computer assigns a unique identifier to each cell in the table according to specific rules, ensuring that each memory space has a unique memory address. With these addresses, the program can access the data in memory.</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="memory_strip, memory_space, memory_address" src="../classification_of_data_structure.assets/computer_memory_location.png" /></a></p>
|
||||
<h2 id="312-physical-structure-contiguous-and-dispersed">3.1.2 Physical Structure: Contiguous and Dispersed<a class="headerlink" href="#312-physical-structure-contiguous-and-dispersed" title="Permanent link">¶</a></h2>
|
||||
<p><strong>When an algorithm program runs, the data being processed is mainly stored in memory</strong>. The following figure shows a computer memory stick, each black block containing a memory space. We can imagine memory as a huge Excel spreadsheet, where each cell can store a certain amount of data.</p>
|
||||
<p><strong>The system accesses data at the target location through memory addresses</strong>. As shown in the Figure 3-2 , the computer allocates numbers to each cell in the table according to specific rules, ensuring each memory space has a unique memory address. With these addresses, programs can access data in memory.</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="Memory Stick, Memory Spaces, Memory Addresses" class="animation-figure" src="../classification_of_data_structure.assets/computer_memory_location.png" /></a></p>
|
||||
<p align="center"> Figure 3-2 Memory Stick, Memory Spaces, Memory Addresses </p>
|
||||
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>It is worth noting that comparing memory to the Excel sheet is a simplified analogy. The actual memory working mechanism is more complicated, involving the concepts of address, space, memory management, cache mechanism, virtual and physical memory.</p>
|
||||
<p>It's worth noting that comparing memory to an Excel spreadsheet is a simplified analogy. The actual working mechanism of memory is more complex, involving concepts like address space, memory management, cache mechanisms, virtual memory, and physical memory.</p>
|
||||
</div>
|
||||
<p>Memory is a shared resource for all programs, and when a block of memory is occupied by one program, it cannot be used by other programs at the same time. <strong>Therefore, considering memory resources is crucial in designing data structures and algorithms</strong>. For example, the algorithm's peak memory usage should not exceed the remaining free memory of the system; if there is a lack of contiguous memory blocks, then the data structure chosen must be able to be stored in non-contiguous memory blocks.</p>
|
||||
<p>As shown in the figure below, <strong>Physical structure reflects the way data is stored in computer memory and it can be divided into consecutive space storage (arrays) and distributed space storage (linked lists)</strong>. The physical structure determines how data is accessed, updated, added, deleted, etc. Logical and physical structure complement each other in terms of time efficiency and space efficiency.</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="continuous vs. decentralized spatial storage" src="../classification_of_data_structure.assets/classification_phisical_structure.png" /></a></p>
|
||||
<p><strong>It is worth stating that all data structures are implemented based on arrays, linked lists, or a combination of the two</strong>. For example, stacks and queues can be implemented using both arrays and linked lists; and implementations of hash tables may contain both arrays and linked lists.</p>
|
||||
<p>Memory is a shared resource for all programs. When a block of memory is occupied by one program, it cannot be used by others simultaneously. <strong>Therefore, memory resources are an important consideration in the design of data structures and algorithms</strong>. For example, the peak memory usage of an algorithm should not exceed the system's remaining free memory. If there is a lack of contiguous large memory spaces, the chosen data structure must be able to store data in dispersed memory spaces.</p>
|
||||
<p>As shown in the Figure 3-3 , <strong>the physical structure reflects how data is stored in computer memory</strong>, which can be divided into contiguous space storage (arrays) and dispersed space storage (linked lists). The physical structure determines from the bottom level how data is accessed, updated, added, or deleted. Both types of physical structures exhibit complementary characteristics in terms of time efficiency and space efficiency.</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="Contiguous Space Storage and Dispersed Space Storage" class="animation-figure" src="../classification_of_data_structure.assets/classification_phisical_structure.png" /></a></p>
|
||||
<p align="center"> Figure 3-3 Contiguous Space Storage and Dispersed Space Storage </p>
|
||||
|
||||
<p>It's important to note that <strong>all data structures are implemented based on arrays, linked lists, or a combination of both</strong>. For example, stacks and queues can be implemented using either arrays or linked lists; while hash tables may include both arrays and linked lists.</p>
|
||||
<ul>
|
||||
<li><strong>Array-based structures</strong>: stacks, queues, hash tables, trees, heaps, graphs, matrices, tensors (arrays of dimension <span class="arithmatex">\(\geq 3\)</span>), and so on.</li>
|
||||
<li><strong>Linked list-based structures</strong>: stacks, queues, hash tables, trees, heaps, graphs, etc.</li>
|
||||
<li><strong>Array-based Implementations</strong>: Stacks, Queues, Hash Tables, Trees, Heaps, Graphs, Matrices, Tensors (arrays with dimensions <span class="arithmatex">\(\geq 3\)</span>).</li>
|
||||
<li><strong>Linked List-based Implementations</strong>: Stacks, Queues, Hash Tables, Trees, Heaps, Graphs, etc.</li>
|
||||
</ul>
|
||||
<p>Data structures based on arrays are also known as "static data structures", which means that such structures' length remains constant after initialization. In contrast, data structures based on linked lists are called "dynamic data structures", meaning that their length can be adjusted during program execution after initialization.</p>
|
||||
<p>Data structures implemented based on arrays are also called “Static Data Structures,” meaning their length cannot be changed after initialization. Conversely, those based on linked lists are called “Dynamic Data Structures,” which can still adjust their size during program execution.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>If you find it difficult to understand the physical structure, it is recommended that you read the next chapter, "Arrays and Linked Lists," before reviewing this section.</p>
|
||||
<p>If you find it difficult to understand the physical structure, it's recommended to read the next chapter first and then revisit this section.</p>
|
||||
</div>
|
||||
|
||||
<!-- Source file information -->
|
||||
@@ -864,13 +1287,110 @@ aria-label="Footer"
|
||||
|
||||
<!-- Link to previous page -->
|
||||
|
||||
|
||||
<a
|
||||
href="../"
|
||||
class="md-footer__link md-footer__link--prev"
|
||||
aria-label="Previous: Chapter 3. &nbsp; Data Structures"
|
||||
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>
|
||||
<div class="md-footer__title">
|
||||
<span class="md-footer__direction">
|
||||
Previous
|
||||
</span>
|
||||
<div class="md-ellipsis">
|
||||
Chapter 3. Data Structures
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<!-- Link to next page -->
|
||||
|
||||
|
||||
<a
|
||||
href="../basic_data_types/"
|
||||
class="md-footer__link md-footer__link--next"
|
||||
aria-label="Next: 3.2 Fundamental Data Types"
|
||||
rel="next"
|
||||
>
|
||||
<div class="md-footer__title">
|
||||
<span class="md-footer__direction">
|
||||
Next
|
||||
</span>
|
||||
<div class="md-ellipsis">
|
||||
3.2 Fundamental Data Types
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-footer__button md-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
|
||||
<!-- Comment system -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 align="center" id="__comments">Feel free to drop your insights, questions or suggestions</h5>
|
||||
|
||||
<!-- Insert generated snippet here -->
|
||||
<script
|
||||
src="https://giscus.app/client.js"
|
||||
data-repo="krahets/hello-algo"
|
||||
data-repo-id="R_kgDOIXtSqw"
|
||||
data-category="Announcements"
|
||||
data-category-id="DIC_kwDOIXtSq84CSZk_"
|
||||
data-mapping="pathname"
|
||||
data-strict="1"
|
||||
data-reactions-enabled="1"
|
||||
data-emit-metadata="0"
|
||||
data-input-position="top"
|
||||
data-theme="preferred_color_scheme"
|
||||
data-lang="en"
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
>
|
||||
</script>
|
||||
<!-- Synchronize Giscus theme with palette -->
|
||||
<script>
|
||||
var giscus = document.querySelector("script[src*=giscus]")
|
||||
|
||||
/* Set palette on initial load */
|
||||
var palette = __md_get("__palette")
|
||||
if (palette && typeof palette.color === "object") {
|
||||
var theme = palette.color.scheme === "slate" ? "dark_dimmed" : "light"
|
||||
giscus.setAttribute("data-theme", theme)
|
||||
}
|
||||
|
||||
/* Register event handlers after documented loaded */
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var ref = document.querySelector("[data-md-component=palette]")
|
||||
ref.addEventListener("change", function() {
|
||||
var palette = __md_get("__palette")
|
||||
if (palette && typeof palette.color === "object") {
|
||||
var theme = palette.color.scheme === "slate" ? "dark_dimmed" : "light"
|
||||
|
||||
/* Instruct Giscus to change theme */
|
||||
var frame = document.querySelector(".giscus-frame")
|
||||
frame.contentWindow.postMessage(
|
||||
{ giscus: { setConfig: { theme } } },
|
||||
"https://giscus.app"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
@@ -892,6 +1412,44 @@ aria-label="Footer"
|
||||
<footer class="md-footer">
|
||||
|
||||
|
||||
|
||||
<nav class="md-footer__inner md-grid" aria-label="Footer" >
|
||||
|
||||
|
||||
<a href="../" class="md-footer__link md-footer__link--prev" aria-label="Previous: Chapter 3. &nbsp; Data Structures">
|
||||
<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>
|
||||
<div class="md-footer__title">
|
||||
<span class="md-footer__direction">
|
||||
Previous
|
||||
</span>
|
||||
<div class="md-ellipsis">
|
||||
Chapter 3. Data Structures
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="../basic_data_types/" class="md-footer__link md-footer__link--next" aria-label="Next: 3.2 Fundamental Data Types">
|
||||
<div class="md-footer__title">
|
||||
<span class="md-footer__direction">
|
||||
Next
|
||||
</span>
|
||||
<div class="md-ellipsis">
|
||||
3.2 Fundamental Data Types
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-footer__button md-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
|
||||
Reference in New Issue
Block a user