mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-01 12:47:14 +00:00
build
This commit is contained in:
@@ -10,12 +10,12 @@ comments: true
|
||||
|
||||
## 0.2.1 Writing Style Conventions
|
||||
|
||||
- Titles marked with `*` are optional sections with relatively difficult content. If you have limited time, you can skip them first.
|
||||
- Technical terms will be in bold (in paper and PDF versions) or underlined (in web versions), such as <u>array</u>. It is recommended to memorize them for reading literature.
|
||||
- Sections marked with `*` after the title are optional and somewhat more challenging. If you're short on time, you can skip them on your first pass.
|
||||
- Technical terms are shown in bold (in the print and PDF editions) or underlined (in the web edition), such as <u>array</u>. They are worth remembering, as they will help when reading technical literature.
|
||||
- Key content and summary statements will be **bolded**, and such text deserves special attention.
|
||||
- Words and phrases with specific meanings will be marked with "quotation marks" to avoid ambiguity.
|
||||
- When it comes to nouns that are inconsistent between programming languages, this book uses Python as the standard, for example, using `None` to represent "null".
|
||||
- This book partially abandons the comment conventions of programming languages in favor of more compact content layout. Comments are mainly divided into three types: title comments, content comments, and multi-line comments.
|
||||
- When terminology differs across programming languages, this book follows Python conventions; for example, it uses `None` to represent "null".
|
||||
- This book partially relaxes conventional programming-language comment styles in favor of a more compact layout. Comments are mainly divided into three types: title comments, content comments, and multi-line comments.
|
||||
|
||||
=== "Python"
|
||||
|
||||
@@ -141,10 +141,8 @@ comments: true
|
||||
|
||||
// Content comment, used to explain code in detail
|
||||
|
||||
/**
|
||||
* Multi-line
|
||||
* comment
|
||||
*/
|
||||
// Multi-line
|
||||
// comment
|
||||
```
|
||||
|
||||
=== "C"
|
||||
@@ -186,9 +184,9 @@ comments: true
|
||||
|
||||
## 0.2.2 Learning Efficiently with Animated Illustrations
|
||||
|
||||
Compared to text, videos and images have higher information density and structural organization, making them easier to understand. In this book, **key and difficult knowledge will mainly be presented in the form of animated illustrations**, with text serving as explanation and supplement.
|
||||
Compared with plain text, videos and images have higher information density and a clearer structure, making them easier to understand. In this book, **key concepts and challenging topics are presented mainly through animated illustrations**, with text serving as explanation and supplement.
|
||||
|
||||
If you find that a section of content provides animated illustrations as shown in Figure 0-2 while reading this book, **please focus on the illustrations first, with text as a supplement**, and combine the two to understand the content.
|
||||
If, while reading this book, you encounter an animated illustration like the one shown below, **treat the illustration as primary and the text as supplementary**, and use both together to understand the content.
|
||||
|
||||
{ class="animation-figure" }
|
||||
|
||||
@@ -200,15 +198,15 @@ The accompanying code for this book is hosted in the [GitHub repository](https:/
|
||||
|
||||
If time permits, **it is recommended that you type out the code yourself**. If you have limited study time, please at least read through and run all the code.
|
||||
|
||||
Compared to reading code, the process of writing code often brings more rewards. **Learning by doing is the real learning**.
|
||||
Compared with simply reading code, writing it yourself often brings greater rewards. **Hands-on practice is where real learning happens**.
|
||||
|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> Figure 0-3 Example of running code </p>
|
||||
|
||||
The preliminary work for running code is mainly divided into three steps.
|
||||
Getting the code running mainly involves three preliminary steps.
|
||||
|
||||
**Step 1: Install the local programming environment**. Please follow the [tutorial](https://www.hello-algo.com/chapter_appendix/installation/) shown in the appendix for installation. If already installed, you can skip this step.
|
||||
**Step 1: Install the local programming environment**. Please follow the [tutorial](https://www.hello-algo.com/chapter_appendix/installation/) in the appendix. If it is already installed, you can skip this step.
|
||||
|
||||
**Step 2: Clone or download the code repository**. Visit the [GitHub repository](https://github.com/krahets/hello-algo). If you have already installed [Git](https://git-scm.com/downloads), you can clone this repository with the following command:
|
||||
|
||||
@@ -216,7 +214,7 @@ The preliminary work for running code is mainly divided into three steps.
|
||||
git clone https://github.com/krahets/hello-algo.git
|
||||
```
|
||||
|
||||
Of course, you can also click the "Download ZIP" button at the location shown in Figure 0-4 to directly download the code compressed package, and then extract it locally.
|
||||
Alternatively, you can click the "Download ZIP" button shown below to download a ZIP archive of the repository directly and then extract it locally.
|
||||
|
||||
{ class="animation-figure" }
|
||||
|
||||
@@ -228,7 +226,7 @@ Of course, you can also click the "Download ZIP" button at the location shown in
|
||||
|
||||
<p align="center"> Figure 0-5 Code blocks and corresponding source code files </p>
|
||||
|
||||
In addition to running code locally, **the web version also supports visual running of Python code** (implemented based on [pythontutor](https://pythontutor.com/)). As shown in Figure 0-6, you can click "Visual Run" below the code block to expand the view and observe the execution process of the algorithm code; you can also click "Full Screen View" for a better viewing experience.
|
||||
In addition to running code locally, **the web version also supports visual execution of Python code** (implemented based on [pythontutor](https://pythontutor.com/)). As shown in Figure 0-6, you can click "Visual Run" below the code block to expand the view and observe the execution process of the algorithm code; you can also click "Full Screen View" for a better viewing experience.
|
||||
|
||||
{ class="animation-figure" }
|
||||
|
||||
@@ -236,9 +234,9 @@ In addition to running code locally, **the web version also supports visual runn
|
||||
|
||||
## 0.2.4 Growing Together Through Questions and Discussions
|
||||
|
||||
When reading this book, please do not easily skip knowledge points that you have not learned well. **Feel free to ask your questions in the comments section**, and my friends and I will do our best to answer you, and generally reply within two days.
|
||||
When reading this book, please do not skip over points that you still do not fully understand. **Feel free to ask your questions in the comments section**, and my friends and I will do our best to answer them, usually within two days.
|
||||
|
||||
As shown in Figure 0-7, the web version has a comments section at the bottom of each chapter. I hope you will pay more attention to the content of the comments section. On the one hand, you can learn about the problems that everyone encounters, thus checking for omissions and stimulating deeper thinking. On the other hand, I hope you can generously answer other friends' questions, share your insights, and help others progress.
|
||||
As shown in Figure 0-7, the web version has a comments section at the bottom of each chapter. I encourage you to pay close attention to the discussions there. On the one hand, you can learn about the problems that others encounter, thereby filling gaps in your own understanding and prompting deeper thought. On the other hand, I hope you will generously answer other readers' questions, share your insights, and help others improve.
|
||||
|
||||
{ class="animation-figure" }
|
||||
|
||||
@@ -246,10 +244,10 @@ As shown in Figure 0-7, the web version has a comments section at the bottom of
|
||||
|
||||
## 0.2.5 Algorithm Learning Roadmap
|
||||
|
||||
From an overall perspective, we can divide the process of learning data structures and algorithms into three stages.
|
||||
Overall, we can divide the process of learning data structures and algorithms into three stages.
|
||||
|
||||
1. **Stage 1: Algorithm introduction**. We need to familiarize ourselves with the characteristics and usage of various data structures, and learn the principles, processes, uses, and efficiency of different algorithms.
|
||||
2. **Stage 2: Practice algorithm problems**. It is recommended to start with popular problems, and accumulate at least 100 problems first, to familiarize yourself with mainstream algorithm problems. When first practicing problems, "knowledge forgetting" may be a challenge, but rest assured, this is very normal. We can review problems according to the "Ebbinghaus forgetting curve", and usually after 3-5 rounds of repetition, we can firmly remember them. For recommended problem lists and practice plans, please see this [GitHub repository](https://github.com/krahets/LeetCode-Book).
|
||||
2. **Stage 2: Practice algorithm problems**. It is recommended to start with popular problems and solve at least 100 of them first, so that you become familiar with mainstream algorithm questions. When you first begin practicing problems, "knowledge forgetting" may feel like a challenge, but rest assured, this is very normal. We can review problems according to the "Ebbinghaus forgetting curve", and after 3-5 rounds of repetition, they usually stick firmly in memory. For recommended problem lists and practice plans, please see this [GitHub repository](https://github.com/krahets/LeetCode-Book).
|
||||
3. **Stage 3: Building a knowledge system**. In terms of learning, we can read algorithm column articles, problem-solving frameworks, and algorithm textbooks to continuously enrich our knowledge system. In terms of practicing problems, we can try advanced problem-solving strategies, such as categorization by topic, one problem multiple solutions, one solution multiple problems, etc. Related problem-solving insights can be found in various communities.
|
||||
|
||||
As shown in Figure 0-8, the content of this book mainly covers "Stage 1", aiming to help you more efficiently carry out Stage 2 and Stage 3 learning.
|
||||
|
||||
Reference in New Issue
Block a user