This commit is contained in:
krahets
2025-12-31 19:38:45 +08:00
parent fdc032e300
commit f31cbc3f9f
474 changed files with 130810 additions and 103691 deletions
+165 -97
View File
@@ -58,8 +58,8 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Lato";--md-code-font:"JetBrains Mono"}</style>
@@ -371,7 +371,7 @@
<span class="md-ellipsis">
Before starting
Before Starting
@@ -388,7 +388,7 @@
<span class="md-nav__icon md-icon"></span>
Before starting
Before Starting
</label>
@@ -489,7 +489,7 @@
<span class="md-ellipsis">
0.1 About this book
0.1 About This Book
@@ -517,7 +517,7 @@
<span class="md-ellipsis">
0.2 How to read
0.2 How to Use This Book
@@ -547,6 +547,24 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
0.3 Summary
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
@@ -564,6 +582,36 @@
</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="#1-key-review" class="md-nav__link">
<span class="md-ellipsis">
1. &nbsp; Key Review
</span>
</a>
</li>
</ul>
</nav>
</li>
@@ -616,7 +664,7 @@
<span class="md-ellipsis">
Chapter 1. Encounter with algorithms
Chapter 1. Encounter With Algorithms
@@ -638,7 +686,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 1. Encounter with algorithms
Chapter 1. Encounter With Algorithms
</label>
@@ -660,7 +708,7 @@
<span class="md-ellipsis">
1.1 Algorithms are everywhere
1.1 Algorithms Are Everywhere
@@ -688,7 +736,7 @@
<span class="md-ellipsis">
1.2 What is an algorithm
1.2 What Is an Algorithm
@@ -781,7 +829,7 @@
<span class="md-ellipsis">
Chapter 2. Complexity analysis
Chapter 2. Complexity Analysis
@@ -803,7 +851,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 2. Complexity analysis
Chapter 2. Complexity Analysis
</label>
@@ -825,7 +873,7 @@
<span class="md-ellipsis">
2.1 Algorithm efficiency assessment
2.1 Algorithm Efficiency Evaluation
@@ -853,7 +901,7 @@
<span class="md-ellipsis">
2.2 Iteration and recursion
2.2 Iteration and Recursion
@@ -881,7 +929,7 @@
<span class="md-ellipsis">
2.3 Time complexity
2.3 Time Complexity
@@ -909,7 +957,7 @@
<span class="md-ellipsis">
2.4 Space complexity
2.4 Space Complexity
@@ -1002,7 +1050,7 @@
<span class="md-ellipsis">
Chapter 3. Data structures
Chapter 3. Data Structures
@@ -1024,7 +1072,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 3. Data structures
Chapter 3. Data Structures
</label>
@@ -1046,7 +1094,7 @@
<span class="md-ellipsis">
3.1 Classification of data structures
3.1 Classification of Data Structures
@@ -1074,7 +1122,7 @@
<span class="md-ellipsis">
3.2 Basic data types
3.2 Basic Data Types
@@ -1102,7 +1150,7 @@
<span class="md-ellipsis">
3.3 Number encoding *
3.3 Number Encoding *
@@ -1130,7 +1178,7 @@
<span class="md-ellipsis">
3.4 Character encoding *
3.4 Character Encoding *
@@ -1223,7 +1271,7 @@
<span class="md-ellipsis">
Chapter 4. Array and linked list
Chapter 4. Array and Linked List
@@ -1245,7 +1293,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 4. Array and linked list
Chapter 4. Array and Linked List
</label>
@@ -1295,7 +1343,7 @@
<span class="md-ellipsis">
4.2 Linked list
4.2 Linked List
@@ -1351,7 +1399,7 @@
<span class="md-ellipsis">
4.4 Memory and cache *
4.4 Memory and Cache *
@@ -1442,7 +1490,7 @@
<span class="md-ellipsis">
Chapter 5. Stack and queue
Chapter 5. Stack and Queue
@@ -1464,7 +1512,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 5. Stack and queue
Chapter 5. Stack and Queue
</label>
@@ -1542,7 +1590,7 @@
<span class="md-ellipsis">
5.3 Double-ended queue
5.3 Double-Ended Queue
@@ -1633,7 +1681,7 @@
<span class="md-ellipsis">
Chapter 6. Hash table
Chapter 6. Hashing
@@ -1655,7 +1703,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 6. Hash table
Chapter 6. Hashing
</label>
@@ -1677,7 +1725,7 @@
<span class="md-ellipsis">
6.1 Hash table
6.1 Hash Table
@@ -1705,7 +1753,7 @@
<span class="md-ellipsis">
6.2 Hash collision
6.2 Hash Collision
@@ -1733,7 +1781,7 @@
<span class="md-ellipsis">
6.3 Hash algorithm
6.3 Hash Algorithm
@@ -1872,7 +1920,7 @@
<span class="md-ellipsis">
7.1 Binary tree
7.1 Binary Tree
@@ -1900,7 +1948,7 @@
<span class="md-ellipsis">
7.2 Binary tree traversal
7.2 Binary Tree Traversal
@@ -1928,7 +1976,7 @@
<span class="md-ellipsis">
7.3 Array Representation of tree
7.3 Array Representation of Tree
@@ -1956,7 +2004,7 @@
<span class="md-ellipsis">
7.4 Binary Search tree
7.4 Binary Search Tree
@@ -1984,7 +2032,7 @@
<span class="md-ellipsis">
7.5 AVL tree *
7.5 AVL Tree *
@@ -2147,7 +2195,7 @@
<span class="md-ellipsis">
8.2 Building a heap
8.2 Building a Heap
@@ -2175,7 +2223,7 @@
<span class="md-ellipsis">
8.3 Top-k problem
8.3 Top-K Problem
@@ -2338,7 +2386,7 @@
<span class="md-ellipsis">
9.2 Basic graph operations
9.2 Basic Operations on Graphs
@@ -2366,7 +2414,7 @@
<span class="md-ellipsis">
9.3 Graph traversal
9.3 Graph Traversal
@@ -2505,7 +2553,7 @@
<span class="md-ellipsis">
10.1 Binary search
10.1 Binary Search
@@ -2533,7 +2581,7 @@
<span class="md-ellipsis">
10.2 Binary search insertion
10.2 Binary Search Insertion
@@ -2561,7 +2609,7 @@
<span class="md-ellipsis">
10.3 Binary search boundaries
10.3 Binary Search Edge Cases
@@ -2589,7 +2637,7 @@
<span class="md-ellipsis">
10.4 Hashing optimization strategies
10.4 Hash Optimization Strategy
@@ -2617,7 +2665,7 @@
<span class="md-ellipsis">
10.5 Search algorithms revisited
10.5 Search Algorithms Revisited
@@ -2766,7 +2814,7 @@
<span class="md-ellipsis">
11.1 Sorting algorithms
11.1 Sorting Algorithms
@@ -2794,7 +2842,7 @@
<span class="md-ellipsis">
11.2 Selection sort
11.2 Selection Sort
@@ -2822,7 +2870,7 @@
<span class="md-ellipsis">
11.3 Bubble sort
11.3 Bubble Sort
@@ -2850,7 +2898,7 @@
<span class="md-ellipsis">
11.4 Insertion sort
11.4 Insertion Sort
@@ -2878,7 +2926,7 @@
<span class="md-ellipsis">
11.5 Quick sort
11.5 Quick Sort
@@ -2906,7 +2954,7 @@
<span class="md-ellipsis">
11.6 Merge sort
11.6 Merge Sort
@@ -2934,7 +2982,7 @@
<span class="md-ellipsis">
11.7 Heap sort
11.7 Heap Sort
@@ -2962,7 +3010,7 @@
<span class="md-ellipsis">
11.8 Bucket sort
11.8 Bucket Sort
@@ -2990,7 +3038,7 @@
<span class="md-ellipsis">
11.9 Counting sort
11.9 Counting Sort
@@ -3018,7 +3066,7 @@
<span class="md-ellipsis">
11.10 Radix sort
11.10 Radix Sort
@@ -3111,7 +3159,7 @@
<span class="md-ellipsis">
Chapter 12. Divide and conquer
Chapter 12. Divide and Conquer
@@ -3133,7 +3181,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 12. Divide and conquer
Chapter 12. Divide and Conquer
</label>
@@ -3155,7 +3203,7 @@
<span class="md-ellipsis">
12.1 Divide and conquer algorithms
12.1 Divide and Conquer Algorithms
@@ -3183,7 +3231,7 @@
<span class="md-ellipsis">
12.2 Divide and conquer search strategy
12.2 Divide and Conquer Search Strategy
@@ -3211,7 +3259,7 @@
<span class="md-ellipsis">
12.3 Building binary tree problem
12.3 Building a Binary Tree Problem
@@ -3239,7 +3287,7 @@
<span class="md-ellipsis">
12.4 Tower of Hanoi Problem
12.4 Hanoi Tower Problem
@@ -3376,7 +3424,7 @@
<span class="md-ellipsis">
13.1 Backtracking algorithms
13.1 Backtracking Algorithm
@@ -3404,7 +3452,7 @@
<span class="md-ellipsis">
13.2 Permutation problem
13.2 Permutations Problem
@@ -3432,7 +3480,7 @@
<span class="md-ellipsis">
13.3 Subset sum problem
13.3 Subset-Sum Problem
@@ -3460,7 +3508,7 @@
<span class="md-ellipsis">
13.4 n queens problem
13.4 N-Queens Problem
@@ -3557,7 +3605,7 @@
<span class="md-ellipsis">
Chapter 14. Dynamic programming
Chapter 14. Dynamic Programming
@@ -3579,7 +3627,7 @@
<span class="md-nav__icon md-icon"></span>
Chapter 14. Dynamic programming
Chapter 14. Dynamic Programming
</label>
@@ -3601,7 +3649,7 @@
<span class="md-ellipsis">
14.1 Introduction to dynamic programming
14.1 Introduction to Dynamic Programming
@@ -3629,7 +3677,7 @@
<span class="md-ellipsis">
14.2 Characteristics of DP problems
14.2 Characteristics of Dynamic Programming Problems
@@ -3657,7 +3705,7 @@
<span class="md-ellipsis">
14.3 DP problem-solving approach
14.3 Dynamic Programming Problem-Solving Approach
@@ -3685,7 +3733,7 @@
<span class="md-ellipsis">
14.4 0-1 Knapsack problem
14.4 0-1 Knapsack Problem
@@ -3713,7 +3761,7 @@
<span class="md-ellipsis">
14.5 Unbounded knapsack problem
14.5 Unbounded Knapsack Problem
@@ -3741,7 +3789,7 @@
<span class="md-ellipsis">
14.6 Edit distance problem
14.6 Edit Distance Problem
@@ -3878,7 +3926,7 @@
<span class="md-ellipsis">
15.1 Greedy algorithms
15.1 Greedy Algorithm
@@ -3906,7 +3954,7 @@
<span class="md-ellipsis">
15.2 Fractional knapsack problem
15.2 Fractional Knapsack Problem
@@ -3934,7 +3982,7 @@
<span class="md-ellipsis">
15.3 Maximum capacity problem
15.3 Maximum Capacity Problem
@@ -3962,7 +4010,7 @@
<span class="md-ellipsis">
15.4 Maximum product cutting problem
15.4 Maximum Product Cutting Problem
@@ -4095,7 +4143,7 @@
<span class="md-ellipsis">
16.1 Installation
16.1 Programming Environment Installation
@@ -4123,7 +4171,7 @@
<span class="md-ellipsis">
16.2 Contributing
16.2 Contributing Together
@@ -4151,7 +4199,7 @@
<span class="md-ellipsis">
16.3 Terminology
16.3 Terminology Table
@@ -4258,6 +4306,25 @@
<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="#1-key-review" class="md-nav__link">
<span class="md-ellipsis">
1. &nbsp; Key Review
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
@@ -4294,13 +4361,14 @@
<!-- Page content -->
<h1 id="03-summary">0.3 &nbsp; Summary<a class="headerlink" href="#03-summary" title="Permanent link">&para;</a></h1>
<h3 id="1-key-review">1. &nbsp; Key Review<a class="headerlink" href="#1-key-review" title="Permanent link">&para;</a></h3>
<ul>
<li>The main audience of this book is beginners in algorithm. If you already have some basic knowledge, this book can help you systematically review your algorithm knowledge, and the source code in this book can also be used as a "Coding Toolkit".</li>
<li>The book consists of three main sections, Complexity Analysis, Data Structures, and Algorithms, covering most of the topics in the field.</li>
<li>For newcomers to algorithms, it is crucial to read an introductory book in the beginning stages to avoid many detours or common pitfalls.</li>
<li>Animations and figures within the book are usually used to introduce key points and difficult knowledge. These should be given more attention when reading the book.</li>
<li>Practice is the best way to learn programming. It is highly recommended that you run the source code and type in the code yourself.</li>
<li>Each chapter in the web version of this book features a discussion section, and you are welcome to share your questions and insights at any time.</li>
<li>The main audience of this book is algorithm beginners. If you already have a certain foundation, this book can help you systematically review algorithm knowledge, and the source code in the book can also be used as a "problem-solving toolkit."</li>
<li>The content of the book mainly includes three parts: complexity analysis, data structures, and algorithms, covering most topics in this field.</li>
<li>For algorithm novices, reading an introductory book during the initial learning stage is crucial, as it can help you avoid many detours.</li>
<li>The animated illustrations in the book are usually used to introduce key and difficult knowledge. When reading this book, you should pay more attention to these contents.</li>
<li>Practice is the best way to learn programming. It is strongly recommended to run the source code and type the code yourself.</li>
<li>The web version of this book has a comments section for each chapter, where you are welcome to share your questions and insights at any time.</li>
</ul>
<!-- Source file information -->
@@ -4324,7 +4392,7 @@ aria-label="Footer"
<a
href="../suggestions/"
class="md-footer__link md-footer__link--prev"
aria-label="Previous: 0.2 How to read"
aria-label="Previous: 0.2 How to Use This Book"
rel="prev"
>
<div class="md-footer__button md-icon">
@@ -4336,7 +4404,7 @@ aria-label="Footer"
Previous
</span>
<div class="md-ellipsis">
0.2 How to read
0.2 How to Use This Book
</div>
</div>
</a>
@@ -4348,7 +4416,7 @@ aria-label="Footer"
<a
href="../../chapter_introduction/"
class="md-footer__link md-footer__link--next"
aria-label="Next: Chapter 1. &amp;nbsp; Encounter with algorithms"
aria-label="Next: Chapter 1. &amp;nbsp; Encounter with Algorithms"
rel="next"
>
<div class="md-footer__title">
@@ -4356,7 +4424,7 @@ aria-label="Footer"
Next
</span>
<div class="md-ellipsis">
Chapter 1. &nbsp; Encounter with algorithms
Chapter 1. &nbsp; Encounter with Algorithms
</div>
</div>
<div class="md-footer__button md-icon">
@@ -4449,7 +4517,7 @@ aria-label="Footer"
<nav class="md-footer__inner md-grid" aria-label="Footer" >
<a href="../suggestions/" class="md-footer__link md-footer__link--prev" aria-label="Previous: 0.2 How to read">
<a href="../suggestions/" class="md-footer__link md-footer__link--prev" aria-label="Previous: 0.2 How to Use This Book">
<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 11z"/></svg>
@@ -4459,20 +4527,20 @@ aria-label="Footer"
Previous
</span>
<div class="md-ellipsis">
0.2 How to read
0.2 How to Use This Book
</div>
</div>
</a>
<a href="../../chapter_introduction/" class="md-footer__link md-footer__link--next" aria-label="Next: Chapter 1. &amp;nbsp; Encounter with algorithms">
<a href="../../chapter_introduction/" class="md-footer__link md-footer__link--next" aria-label="Next: Chapter 1. &amp;nbsp; Encounter with Algorithms">
<div class="md-footer__title">
<span class="md-footer__direction">
Next
</span>
<div class="md-ellipsis">
Chapter 1. &nbsp; Encounter with algorithms
Chapter 1. &nbsp; Encounter with Algorithms
</div>
</div>
<div class="md-footer__button md-icon">