adding an English translation version(chp0&1)

This commit is contained in:
Yuelin Xin 2023-01-08 18:13:43 +00:00
parent e8f7d8f8ba
commit 38eeb9bda7
38 changed files with 643 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,38 @@
---
comments: true
---
# Algorithms Are Everywhere
Every time you see the word "algorithm", you probably think of mathematics. But in fact, complex mathematics aren't found in most algorithms. What is more common is basic logic, which we can see everywhere in our daily lives.
Before diving into the details of algorithms, I want to tell you something interesting: **In fact, you have already learned many algorithms in the past, and you have been accustomed to applying them to daily life.** Next, I will introduce two vivid examples to prove this.
**Example 1: Building LEGO.** When you buy a set of LEGO, in addition to the various components, you will also receive a detailed assembly instruction. By following the instructions step by step, you can build a complex LEGO model.
Think of this from a data structure and algorithm perspective. The various *LEGO blocks* are data structures, and the series of steps on the *assembly instructions* are algorithms.
**Example 2: Looking up a dictionary.** In a dictionary, English words are sorted in alphabetical order. If we want to look up a word starting with letter $r$ in the dictionary, we usually do it like this:
1. Open the dictionary up in the middle, and check the first letter of the page (assume it is $m$ );
2. Since $r$ is after $m$ in the English alphabet, we should exclude the first half of the dictionary, and our search range is only the second half now;
3. Repeat step 1-2 until we find the page with the first letter of the word we are looking for ($r$) and stop.
=== "Step 1"
![look_up_dictionary_step_1](algorithms_are_everywhere.assets/look_up_dictionary_step_1.png)
=== "Step 2"
![look_up_dictionary_step_2](algorithms_are_everywhere.assets/look_up_dictionary_step_2.png)
=== "Step 3"
![look_up_dictionary_step_3](algorithms_are_everywhere.assets/look_up_dictionary_step_3.png)
=== "Step 4"
![look_up_dictionary_step_4](algorithms_are_everywhere.assets/look_up_dictionary_step_4.png)
=== "Step 5"
![look_up_dictionary_step_5](algorithms_are_everywhere.assets/look_up_dictionary_step_5.png)
Something as simple as looking up a dictionary is actually a real life application of the famous *binary search*. From a data structure perspective, we can view the dictionary as a sorted *array*; from an algorithm perspective, we can view the series of steps for looking up a dictionary as the *binary search* algorithm.
From simple tasks like cooking, to complex tasks like interstellar travel, almost no problem can be solved without algorithms. The birth of computers allows us to write code to store data structures in computer memory, and to use CPU and GPU to execute algorithms, so that we can abstract the problems in our daily lives into computers programs, and solve complex problems more efficiently.
!!! tip
Up to this point, if you feel that you are not familiar with the concepts of data structures, algorithms, arrays, binary search, etc., then that's great! Because that's the very thing that this book is here to help you with. From now on, we will guide you step by step through the world of data structures and algorithms.

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,53 @@
---
comments: true
---
# What is Data Structures and Algorithms?
## Definition of Algorithm
*Algorithm* is a set of instructions or operations to solve a problem (or a set of problems) in a finite amount of time. Algorithms have the following characteristics:
- The problem is clear, and the input and output definitions are clear.
- Deterministic, that is, the same input will always produce the same output.
- Feasible, that is, it can be completed in a finite number of steps, a finite amount of time, and a finite amount of memory space.
- Independent of programming languages, in other words, it can be implemented in multiple languages.
## Definition of Data Structure
*Data Structure* is a way of organizing and storing data in a computer. In order to improve the performance of data storage and operation, the design principles of data structures are:
- Occupying as little space as possible, saving computer memory.
- Data operations should be as fast as possible, including data access, addition, deletion, update, etc.
- Provide concise data representation and logical information to facilitate efficient operation by algorithms.
Data structure design is a process full of compromises, this means that if you get an advantage in one aspect, you will have to make a compromise in another aspect. For example, linked lists are more convenient for data addition and deletion than arrays, but they sacrifice the speed of data access; graphs provide more logical information than linked lists, but occupy more memory space.
## Relationship between Data Structures and Algorithms
*Data Structures* and *Algorithms* are highly related and tightly integrated, which are shown in the following:
- Data structures are the foundation of algorithms. Data structures provide structured data storage and corresponding methods for manipulating data.
- Algorithms are the stage for data structures to show their advantages. Data structures only store information, and only with algorithms can they solve specific problems.
- Algorithms have corresponding optimal data structures. Given an algorithm, it can be implemented based on different data structures, and the final execution efficiency may vary greatly.
![relationship_between_data_structure_and_algorithm](what_is_dsa.assets/relationship_between_data_structure_and_algorithm.png)
<p align="center"> Fig. Relationship between data structures and algorithms </p>
If we compare *Data Structures and Algorithms* to *LEGO*, we can get the corresponding relationship shown in the following table.
<div class="center-table" markdown>
| Data Structures & Algorithms | LEGO |
| ------------------------- | -------------------------------------- |
| Input data | LEGO blocks |
| Data structure | The way blocks piece together (including size, shape, connection interface, etc.) |
| Algorithm | The steps to piece all the blocks together to get the desired model |
| Output data | A LEGO model |
</div>
!!! tip "A conventional abbreviation"
In discussions, we usually abbreviate *Data Structures and Algorithms* as *Algorithms*. For example, the algorithm problems on LeetCode, actually involve both data structures and algorithms.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,244 @@
---
comments: true
---
# About the Book
Something happened 5 years ago became the pivoting point of my career. At that time, I was a graduate student at SJTU, and I knew nothing about getting a job in tech companies. But I still applied for a Microsoft software engineer internship. The interviewer asked me to write the "quick sort" code on a whiteboard. I timidly wrote a "bubble sort", and I even got that wrong ` (ToT) `. From the interviewer's face, the only two words I saw were "Game Over".
The hit I took this time forced me to start crawling through algorithm questions. I used the "minesweeper" method of learning, with my eyes closed and my head covered, crawling through the questions, and when I encountered something I couldn't solve, I would look it up and "remove the mine". Combined with periodic summaries, I gradually formed a knowledge map of data structures and algorithms. Fortunately, I got multiple offers from big tech companies in the autumn recruitment.
When I looked back on my own experience of being blown up in the "minesweeper" method of learning, with my mind jiggling about it for a long time, and I realized that a "must-read" book for the "newbies" can help them avoid many detours. The desire to write came in like a wrecking ball, so let's get started:
<h4 align="center"> HelloAlgorithm </h4>
## Audience
!!! success "Prerequisites"
You should know how to write and read simple code in at least one programming language.
If you are an **algorithm beginner**, you have never touched algorithms before, or you have accumulated some algorithm experience, but you only have a vague understanding of data structures and algorithms, and you are constantly jumping between "know" and "don't know", then this book is for you! This book can bring you:
- An understanding of **data structures** required to go through algorithm questions, including common operations, advantages and disadvantages, typical applications, and implementation methods.
- Learning all sorts of **algorithms**, introducing the design ideas, running efficiency, advantages and disadvantages, and implementation methods of algorithms.
- A **code repository** that can be run with one click, including detailed comments to help you deepen your understanding through practice.
If you are an **algorithm proficient**, you have accumulated a certain amount of algorithm experience, and have been exposed to most types of questions, then the content of this book may be slightly basic for you, but it can still bring you the following value:
- The book is not long, which can help you review your algorithm knowledge in a nutshell.
- The book contains many comparative and summary algorithm contents, which can help you sort out your algorithm knowledge system.
- The code in the book implements various classic data structures and algorithms, which can be used as a "algorithms questions library".
If you are an **algorithm expert**, then you have my respect! I hope you can take the time to provide some advice and suggestions, or [join us to collaborate](https://www.hello-algo.com/chapter_preface/contribution/), and help algorithms learners by producing better materials, thank you!
## Book Structure
The main content of this book is divided into three parts: complexity analysis, data structures, and algorithms.
![mindmap](index.assets/mindmap.png)
<p align="center"> Fig. Mind Map of Key Points </p>
### Complexity Analysis
We will first introduce the evaluation factors of data structures and algorithms, the evaluation methods of algorithm efficiency, and the concept of computational complexity.
Then, from the **asymptotic upper bound of functions** , we will introduce **time complexity** and **space complexity** respectively, including calculation methods, common types, examples, etc. At the same time, we will analyze the relationship and difference between the **worst, best, and average** time complexity.
### Data Structures
We will first introduce the **basic data types** that are commonly used, and how they are stored in memory.
Then, we will introduce two **data structure classification methods**, including logical structure and physical structure.
After that, we will introduce **array, linked list, stack, queue, hash table, tree, heap, graph** and other data structures, and we will focus on the following content:
- Basic definitions: the designing ideas, and the purposes served by these data structures;
- Primary characteristics: the pros and cons of various data operations;
- Common operations: such as access, update, insert, delete, traversal, search, etc.;
- Common types: the common types encountered in algorithm questions or engineering practice;
- Typical applications: typical algorithms that are often used with these data structures;
- Implementations: for important data structures, we will provide complete implementation examples;
### Algorithms
Including **searching algorithms, sorting algorithms, searching and backtracking, dynamic programming, and divide-and-conquer algorithms**, containing the following:
- Basic definitions: the designing ideas of algorithms;
- Primary characteristics: the preconditions, pros and cons of each algorithm;
- Algorithm efficiency: worst and average time complexity, space complexity;
- Implementations: complete algorithm implementations, and optimization measures;
- Example questions: adding example questions to deepen your understanding;
## Code Repository
The complete code repository is hosted on [GitHub](https://github.com/krahets/hello-algo), you can run the code with one click!
!!! tip "Preparation"
1. [Install your coding environment](https://www.hello-algo.com/chapter_preface/installation/), if you have already installed it, please skip this step
2. See [How to use this book](https://www.hello-algo.com/chapter_preface/suggestions/#_4) for code download and usage instructions
## Style Guide
- The * symbol trailing the title indicates that it is an optional chapter. If you are short on time, you can skip these chapters first.
- Important syllables will be marked as italic, such as *Array*. Mixing up the syllables will cause unnecessary ambiguity, so it is best to remember these syllables, so that they can be used when reading related materials in the future.
- Important content, summary sentences will be marked as **bold**, this kind of text is worth special attention.
- The names of proprietary nouns and words with specific meanings will be marked with " ", to avoid ambiguity.
- In engineering practice, each language has its own comment conventions; while this book gives up some of the comment conventions in order to achieve a more compact content layout. The comments are divided into three types: header comments, content comments, and multi-line comments.
=== "Java"
```java title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "C++"
```cpp title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "Python"
```python title=""
""" header comments, used to mark functions, classes, test cases, etc. """
# content comments, used to explain code
"""
multi-line
comments
"""
```
=== "Go"
```go title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "JavaScript"
```js title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "TypeScript"
```typescript title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "C"
```c title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
=== "C#"
```csharp title=""
/* header comments, used to mark functions, classes, test cases, etc. */
// content comments, used to explain code
/**
* multi-line
* comments
*/
```
"""
In Java, C, C++, C#, Go, JS, TS, `/* ... */` is used to comment functions, classes, test cases, etc., and `// ...` is used to explain code content; similarly, in Python, `""" ... """` is used to comment titles, and `# ...` is used to explain code.
## Key Features of This Book *
??? abstract "Default collapsed, can be skipped"
**Practice comes first.** We know that it is far from enough to just read books when learning English. We need to listen, speak, and write more, and practice in order to cultivate language sense and accumulate experience. Programming languages are also languages, so the learning method should be similar, and we need to be accustomed to walking through elegant code, writing more code and thinking about the logic behind the code.
The theoretical part of this book is relatively concise, mainly divided into two categories: one is the basic and necessary concepts, to cultivate the reader's intuitive understanding of algorithms; the second is essential classifications, comparisons or summaries, which is to give you a "god view" and hard overview of all the key points, so that you can form your own subconscious understanding.
The practice part is mainly made up of examples and code. The code is accompanied by brief comments, and complex examples will be presented as visually as possible. I strongly recommend that the readers type out the code themselves, if time is limited, at least read, copy and run the code line by line, and combine with the explanation to digest the code.
**Visualized learning.** Since the dawn of the information age, the endeavor of visualizing information has never ended. The media has transformed from text messages, to emails with text and image, to GIFs, to short (long) videos, interactive Web, and 3D games. The magnitude of information visualization is getting higher than ever, they are more unified with human senses, and the efficiency of spreading information has skyrocketed. The tech industry is also moving towards visualization, take the iPhone as an example, it is a highly visualized product compared to conventional devices, with articulately designed fonts, themes, and animations, etc.
In the past several years, short videos have become one of the most popular form of media, capable of delivering highly dense information, and can provide a comfortable consumption experience. Reading is different, there is a natural "distance" between the reader and the book, we will get tired, distracted, and will think about other things while reading, we will mark the sentences we like, and think about the meaning of a paragraph, this "distance" gives us a sense of freedom and the capability of stopping for a moment and think about what we just read.
As a beginner's guide, I wish to maintain the "slow pace" of books, but also to avoid putting too much "distance" between the reader and the book, and to try to sink the knowledge into that clever little brain of yours. I will utilize visualization techniques (e.g. illustrations, animations), and try to explain complex concepts and abstract examples as clearly as possible.
**Simplified contents.** Most classic textbooks try to cover almost every aspect of the subject, and the thoroughness is the reason why they are popular. However, for beginners who want to get started quickly, the practicality of these textbooks is quite poor. This book will avoid introducing unnecessary concepts, terms, definitions, etc., and will avoid unnecessary theoretical analysis, after all, this is not a hardcore textbook, our main goal is to get you started as rapidly as possible.
When introducing some fun examples from real life, which are quite suitable as a prelude to key content, or as a supplement to the explanation. However, we will try to keep the content as concise as possible, and avoid adding too many extra elements, which may make the reader lose focus and miss the key points, which is also something this book should avoid.
Coding is like writing, they should both pursue "beauty". This book tries to make the code beautiful, and ensure the consistency of variable naming, uniform spacing and line breaks, aligned indentation, and neat comments, etc.
## Acknowledgements
本书的成书过程中,我获得了许多人的帮助,包括但不限于:
- 感谢我的女朋友泡泡担任本书的首位读者,从算法小白的视角为本书的写作提出了许多建议,使这本书更加适合算法初学者来阅读。
- 感谢腾宝、琦宝、飞宝为本书起了个响当当的名字,好听又有梗,直接唤起我最初敲下第一行代码 "Hello, World!" 的回忆。
- 感谢我的导师李博,在小酌畅谈时您告诉我“觉得适合、想做就去做”,坚定了我写这本书的决心。
- 感谢苏潼为本书设计了封面和 LOGO ,我有些强迫症,前后多次修改,谢谢你的耐心。
- 感谢 @squidfunk ,包括 [Material-for-MkDocs](https://github.com/squidfunk/mkdocs-material/tree/master) 顶级开源项目以及给出的写作排版建议。
在写作过程中,我阅读了许多与数据结构与算法的书籍材料,学习到了许多知识,感谢前辈们的精彩创作。
感谢父母,你们一贯的支持与鼓励给了我自由度来做这些有趣的事。
## About the Author
![profile](about_the_book.assets/profile.png){: .center}
<h2 align="center"> Krahets </h2>
<h5 align="center"> 大厂高级算法工程师、算法爱好者 </h5>
<p align="center"> 力扣LeetCode全网阅读量最高博主 </p>
<p align="center"> 分享近百道算法题解,累积回复数千读者的评论问题 </p>
<p align="center"> 创作 LeetBook《图解算法数据结构》已免费售出 22 万本 </p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View File

@ -0,0 +1,44 @@
---
comments: true
---
# Contribute Together
!!! success "The beauty of open source"
The time between the two printings of a paper book is often several years, which makes content updates very inconvenient.</br> However, in this open source HTML book, the time for content updates is shortened to several days or even hours.
Because of the author's limited knowledge, the content of the book is bound to be incomplete and erroneous. Please understand. In addition, I hope you can participate in the creation of this book together. If you find typos, invalid links, missing content, ambiguous text, unclear explanations, or unreasonable text structure, please correct the content to help other readers obtain better learning content. All [contributors](https://github.com/krahets/hello-algo/graphs/contributors) will be shown on our repository homepage, to dedicate our thank to your selfless contribution to the open source community.
## Edit Text & Code
On the top right corner of each page, there is an "Edit" button. You can modify the article by following the steps:
1. Click the "Edit" button, if you see the prompt "You need to fork this repository", please click "Fork this repository";
2. Modify the Markdown source file content;
3. Fill in the change description at the bottom of the page, and then click the "Propose file change" button;
4. After the page jumps, click the "Create pull request" button to create a pull request, and I will check and update the content as soon as possible.
![edit_markdown](contribution.assets/edit_markdown.png)
## Edit Illustrations & Animations
The illustration in the book cannot be modified directly, you need to submit a modification request through the following methods:
1. Create a new Issue, copy or screenshot the image you need to modify, and paste it in the panel;
2. Describe the problem with the image, and how to modify it;
3. Submit the Issue, and I will draw the image again and replace it as soon as possible.
## Create New Content
If you want to create new content, such as **rewrite chapters, add chapters, modify code, translate code into other programming languages**, you need to implement the Pull Request workflow:
1. Sign in to GitHub and fork [this repository](https://github.com/krahets/hello-algo) to your own account;
2. Enter the forked repository page, use `git clone` to clone the repository to your computer;
3. Create the new content locally (it is recommended to verify the code correctness by running tests);
4. Commit the local changes and push them to the remote repository;
5. Refresh the repository page and click the "Create pull request" button to submit the pull request.
Let's work together to create a better book!
(TODOVideo tutorial)

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

View File

@ -0,0 +1,47 @@
---
comments: true
---
# Install Development Environment
(TODO Video tutorial)
## Install VSCode
We recommend using the open source lightweight editor VSCode as the local IDE, download and install [VSCode](https://code.visualstudio.com/).
## Java
1. Download and install [OpenJDK](https://jdk.java.net/18/) (version > JDK 9).
2. Search `java` in the VSCode extension market, install Java Extension Pack.
## C++
1. Windows needs to install [MinGW](https://www.mingw-w64.org/downloads/), MacOS has Clang built-in and does not need to be installed.
2. Search `c++` in the VSCode extension market, install C/C++ Extension Pack.
## Python
1. Download and install [Miniconda3](https://docs.conda.io/en/latest/miniconda.html).
2. Search `python` in the VSCode extension market, install Python Extension Pack.
## Go
1. Download and install [go](https://go.dev/dl/).
2. Search `go` in the VSCode extension market, install Go.
3. Press `Ctrl + Shift + P` to call up the command bar, enter go, select `Go: Install/Update Tools`, check all and install.
## JavaScript
1. Download and install [node.js](https://nodejs.org/en/).
2. Search `javascript` in the VSCode extension market, install JavaScript (ES6) code snippets.
## C#
1. Download and install [.Net 6.0](https://dotnet.microsoft.com/en-us/download).
2. Search `c#` in the VSCode extension market, install C#.
## Swift
1. Download and install [Swift](https://www.swift.org/download/).
2. Search `swift` in the VSCode extension market, install [Swift for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang).

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

View File

@ -0,0 +1,63 @@
---
comments: true
---
# How to Use This Book
## Learning With Text + Illustrations
Videos and images convey information in a denser and more structured way than text, making them easier to understand. In this book, the key and difficult parts will be presented mainly with animations and illustrations, and the purpose of the text is to explain and supplement the animations and illustrations.
When reading this book, if you find that a section contains an animation or illustration, **it is recommended that you use the illustrations as the main reference**, and try to map the text content (usually above the image) to the content in the illustrations to get a better understanding.
![algorithm_animation](suggestions.assets/algorithm_animation.gif)
## Learning by Doing
!!! tip "Preparation"
If you don't have any development environment installed, you can refer to the next section [Installation](https://www.hello-algo.com/chapter_preface/installation/).
### Download Source Code
If you have already installed [Git](https://git-scm.com/downloads), you can clone the code repository through the command line.
```shell
git clone https://github.com/krahets/hello-algo.git
```
Of course, you can always click "Download ZIP" to download the archive of the code, and then unzip it.
![download_code](suggestions.assets/download_code.png)
### Run Code
The code in this book is written in Java, C++, and Python (more are on their way). If the code blocks in the book are marked with `*.java`, `*.cpp`, `*.py`, you can find the corresponding **source code** in the codes folder of the repository.
![code_md_to_repo](suggestions.assets/code_md_to_repo.png)
These source files contain detailed comments, with test cases, which can be run directly to help you save unnecessary debugging time and focus on absorbing the content.
![running_code](suggestions.assets/running_code.gif)
!!! tip "Advice for code learners"
If you are short on time, **at least go through all the code and run them**. If you are not in a hurry, **it is strongly recommended that you code them out by yourself** to gradually train muscle memory. Compared with reading code, the process of writing code often brings new insights.
## Learning by Asking
If you have any questions while reading this book, **please do not hesitate to leave your questions in the comments**. Your questions are not wines, time don't do them any good! Me and other people will try to answer them (you will usually get a reply within 3 days).
At the mean time, I hope you can spend more time browsing through the comments. On the one hand, you can see what problems other people have encountered, and in turn check for omissions, which often leads to more in-depth thinking. On the other hand, I hope you can generously answer the questions of your peers and share your views. Let's all work together and make great progress!
![comment](suggestions.assets/comment.gif)
## Three Phases of Learning Algorithms
**Phase 1: Algorithm basics, which is what this book is for.** Familiarize yourself with the characteristics and usage of various data structures, and learn their working principles, applications, and efficiency of various algorithms.
**Phase 2: Algorithm practice.** Practice your algorithm using popular question lists, such as [LeetCode HOT 100](https://leetcode.com/problem-list/top-100-liked-questions/), [LeetCode Top Interview Questions](https://leetcode.com/problem-list/top-interview-questions/), accumulate at least 100 questions, and familiarize yourself with most algorithm problems. When you are just getting started, "forgetting" is the biggest obstacle, but this is normal, so don't worry. There is a concept in learning called "periodic review", which means doing the same question after a certain period of time, and when you have done it three or more times, you won't usually break a sweat remembering it.
**Phase 3: Building a knowledge network.** In terms of learning, you can browse through algorithm columns, problem frameworks, and algorithm textbooks to continuously enrich your knowledge network. In terms of practice, you can start using advanced practice schemes, such as topic classification, solving one question with multiple solutions, and one solution to solve multiple questions, etc. Practice schemes can be found in the community, and will not be discussed any further here.
![learning_route](suggestions.assets/learning_route.png)

View File

@ -0,0 +1,17 @@
# Reference
[1] Thomas H. Cormen, et al. Introduction to Algorithms (3rd Edition).
[2] Aditya Bhargava. Grokking Algorithms: An Illustrated Guide for Programmers and Other Curious People (1st Edition).
[3] 程杰. 大话数据结构.
[4] 王争. 数据结构与算法之美.
[5] 严蔚敏. 数据结构( C 语言版).
[6] 邓俊辉. 数据结构( C++ 语言版,第三版).
[7] 马克·艾伦·维斯著,陈越译. 数据结构与算法分析Java语言描述第三版.
[8] Gayle Laakmann McDowell. Cracking the Coding Interview: 189 Programming Questions and Solutions (6th Edition).

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

72
docs/en/index.md Normal file
View File

@ -0,0 +1,72 @@
---
comments: true
hide:
- footer
---
=== " "
<div class="result" markdown>
![conceptual_rendering](index.assets/conceptual_rendering.png){ align=left width=350 }
</br></br></br></br></br>
<h1 align="center"><i> Hello, Algorithm </i></h1>
<p align="center"> Illustrations & Animations, Click & Run, Community Discussions</br>A quick start tutorial for data structures and algorithms </p>
<p align="center"> [![github-stars](https://img.shields.io/github/stars/krahets/hello-algo?style=social)](https://github.com/krahets/hello-algo)</p>
<h6 align="center"> [@Krahets](https://leetcode.cn/u/jyd/) </h6>
</div>
---
<h2 align="center"><i> Clear Illustrations & Animations </i></h2>
<p align="center"> Key points with animation, learning with relaxation</br>Seamless reading on PC, tablet, and mobile </p>
![algorithm_animation](index.assets/animation.gif)
!!! quote ""
<p align="center"> "A picture is worth a thousand words." </p>
---
<h2 align="center"><i> Learning by Doing </i></h2>
<p align="center"> Provide clear implementations and test codes of classic algorithms</br>Multiple languages, detailed comments, all runnable </p>
![running_code](index.assets/running_code.gif)
!!! quote ""
<p align="center"> "Talk is cheap. Show me the code." </p>
---
<h2 align="center"><i> With Discussions & Questions </i></h2>
<p align="center"> Author usually replies within 72 hours</br>Discuss with other readers and improve together </p>
![comment](index.assets/comment.gif)
!!! quote ""
<p align="center"> "Once more unto the breach, dear friends, once more" </p>
---
<h2 align="center"> Recommendations </h2>
!!! quote
"An easy-to-understand beginners' guide to data structures and algorithms, guiding readers to learn with both hands and brains, and strongly recommended for algorithm beginners to read."
**—— 邓俊辉, Prof. of Computer Science, Tsinghua University**
<h2 align="center"> Acknowledgements </h2>
A huge thanks to the following people for their contributions to this project, without whom this book would not be as it is today:
<a href="https://github.com/krahets/hello-algo/graphs/contributors">
<img src="https://contrib.rocks/image?repo=krahets/hello-algo" />
</a>
---

View File

@ -0,0 +1,65 @@
/* Color Settings */
/* https://github.com/squidfunk/mkdocs-material/blob/6b5035f5580f97532d664e3d1babf5f320e88ee9/src/assets/stylesheets/main/_colors.scss */
/* https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-colors */
:root > * {
--md-primary-fg-color: #FFFFFF;
--md-primary-bg-color: #1D1D20;
--md-accent-fg-color: #999;
--md-typeset-color: #1D1D20;
--md-typeset-a-color: #2AA996;
}
[data-md-color-scheme="slate"] {
--md-primary-fg-color: #2E303E;
--md-primary-bg-color: #FEFEFE;
--md-accent-fg-color: #999;
--md-typeset-color: #FEFEFE;
--md-typeset-a-color: #21C8B8;
}
/* Center Markdown Tables (requires md_in_html extension) */
.center-table {
text-align: center;
}
.md-typeset .center-table :is(td,th):not([align]) {
/* Reset alignment for table cells */
text-align: initial;
}
/* Markdown Header */
/* https://github.com/squidfunk/mkdocs-material/blob/dcab57dd1cced4b77875c1aa1b53467c62709d31/src/assets/stylesheets/main/_typeset.scss */
.md-typeset h1 {
font-weight: 400;
color: var(--md-default-fg-color);
}
.md-typeset h2 {
font-weight: 400;
}
.md-typeset h3 {
font-weight: 500;
}
.md-typeset a {
text-decoration: underline;
}
/* Image align center */
.center {
display: block;
margin: 0 auto;
}
/* font-family setting for Win10 */
body {
--md-text-font-family: -apple-system,BlinkMacSystemFont,var(--md-text-font,_),Helvetica,Arial,sans-serif;
--md-code-font-family: var(--md-code-font,_),SFMono-Regular,Consolas,Menlo,-apple-system,BlinkMacSystemFont,var(--md-text-font,_),monospace;
}