This commit is contained in:
krahets
2025-12-31 19:37:45 +08:00
parent 29ec0c699d
commit 3c9d5689c4
279 changed files with 40895 additions and 16087 deletions

View File

@@ -2,45 +2,45 @@
comments: true
---
# 16.2   Contributing
# 16.2   Contributing Together
Due to the limited abilities of the author, some omissions and errors are inevitable in this book. Please understand. If you discover any typos, broken links, missing content, textual ambiguities, unclear explanations, or unreasonable text structures, please assist us in making corrections to provide readers with better quality learning resources.
Due to limited capacity, there may be inevitable omissions and errors in this book. We appreciate your understanding and are grateful for your help in correcting them. If you discover typos, broken links, missing content, ambiguous wording, unclear explanations, or structural issues, please help us make corrections to provide readers with higher-quality learning resources.
The GitHub IDs of all [contributors](https://github.com/krahets/hello-algo/graphs/contributors) will be displayed on the repository, web, and PDF versions of the homepage of this book to thank them for their selfless contributions to the open-source community.
The GitHub IDs of all [contributors](https://github.com/krahets/hello-algo/graphs/contributors) will be displayed on the homepage of the book repository, the web version, and the PDF version to acknowledge their selfless contributions to the open source community.
!!! success "The charm of open source"
!!! success "The Charm of Open Source"
The interval between two printings of a paper book is often long, making content updates very inconvenient.
In this open-source book, however, the content update cycle is shortened to just a few days or even hours.
The interval between two printings of a physical book is often quite long, making content updates very inconvenient.
### 1.   Content fine-tuning
In this open source book, the time for content updates has been shortened to just days or even hours.
As shown in Figure 16-3, there is an "edit icon" in the upper right corner of each page. You can follow these steps to modify text or code.
### 1.   Minor Content Adjustments
1. Click the "edit icon". If prompted to "fork this repository", please agree to do so.
2. Modify the Markdown source file content, check the accuracy of the content, and try to keep the formatting consistent.
3. Fill in the modification description at the bottom of the page, then click the "Propose file change" button. After the page redirects, click the "Create pull request" button to initiate the pull request.
As shown in Figure 16-3, there is an "edit icon" in the top-right corner of each page. You can modify text or code by following these steps.
![Edit page button](contribution.assets/edit_markdown.png){ class="animation-figure" }
1. Click the "edit icon". If you encounter a prompt asking you to "Fork this repository", please approve the operation.
2. Modify the content of the Markdown source file, verify the correctness of the content, and maintain consistent formatting as much as possible.
3. Fill in a description of your changes at the bottom of the page, then click the "Propose file change" button. After the page transitions, click the "Create pull request" button to submit your pull request.
<p align="center"> Figure 16-3 &nbsp; Edit page button </p>
![Page edit button](contribution.assets/edit_markdown.png){ class="animation-figure" }
Figures cannot be directly modified and require the creation of a new [Issue](https://github.com/krahets/hello-algo/issues) or a comment to describe the problem. We will redraw and replace the figures as soon as possible.
<p align="center"> Figure 16-3 &nbsp; Page edit button </p>
### 2. &nbsp; Content creation
Images cannot be directly modified. Please describe the issue by creating a new [Issue](https://github.com/krahets/hello-algo/issues) or leaving a comment. We will promptly redraw and replace the images.
If you are interested in participating in this open-source project, including translating code into other programming languages or expanding article content, then the following Pull Request workflow needs to be implemented.
### 2. &nbsp; Content Creation
1. Log in to GitHub and Fork the [code repository](https://github.com/krahets/hello-algo) of this book to your personal account.
2. Go to your Forked repository web page and use the `git clone` command to clone the repository to your local machine.
3. Create content locally and perform complete tests to verify the correctness of the code.
4. Commit the changes made locally, then push them to the remote repository.
5. Refresh the repository webpage and click the "Create pull request" button to initiate the pull request.
If you are interested in contributing to this open source project, including translating code into other programming languages or expanding article content, you will need to follow the Pull Request workflow below.
### 3. &nbsp; Docker deployment
1. Log in to GitHub and Fork the book's [code repository](https://github.com/krahets/hello-algo) to your personal account.
2. Enter your forked repository webpage and use the `git clone` command to clone the repository to your local machine.
3. Create content locally and conduct comprehensive tests to verify code correctness.
4. Commit your local changes and push them to the remote repository.
5. Refresh the repository webpage and click the "Create pull request" button to submit your pull request.
In the `hello-algo` root directory, execute the following Docker script to access the project at `http://localhost:8000`:
### 3. &nbsp; Docker Deployment
From the root directory of `hello-algo`, run the following Docker script to access the project at `http://localhost:8000`:
```shell
docker-compose up -d

View File

@@ -9,6 +9,6 @@ icon: material/help-circle-outline
## Chapter contents
- [16.1 &nbsp; Installation](installation.md)
- [16.2 &nbsp; Contributing](contribution.md)
- [16.3 &nbsp; Terminology](terminology.md)
- [16.1 &nbsp; Programming Environment Installation](installation.md)
- [16.2 &nbsp; Contributing Together](contribution.md)
- [16.3 &nbsp; Terminology Table](terminology.md)

View File

@@ -2,75 +2,75 @@
comments: true
---
# 16.1 &nbsp; Installation
# 16.1 &nbsp; Programming Environment Installation
## 16.1.1 &nbsp; Install IDE
## 16.1.1 &nbsp; Installing Ide
We recommend using the open-source, lightweight VS Code as your local Integrated Development Environment (IDE). Visit the [VS Code official website](https://code.visualstudio.com/) and choose the version of VS Code appropriate for your operating system to download and install.
We recommend using the open-source and lightweight VS Code as the local integrated development environment (IDE). Visit the [VS Code official website](https://code.visualstudio.com/), and download and install the appropriate version of VS Code according to your operating system.
![Download VS Code from the official website](installation.assets/vscode_installation.png){ class="animation-figure" }
![Download VS Code from the Official Website](installation.assets/vscode_installation.png){ class="animation-figure" }
<p align="center"> Figure 16-1 &nbsp; Download VS Code from the official website </p>
<p align="center"> Figure 16-1 &nbsp; Download VS Code from the Official Website </p>
VS Code has a powerful extension ecosystem, supporting the execution and debugging of most programming languages. For example, after installing the "Python Extension Pack," you can debug Python code. The installation steps are shown in Figure 16-2.
VS Code has a powerful ecosystem of extensions that supports running and debugging most programming languages. For example, after installing the "Python Extension Pack" extension, you can debug Python code. The installation steps are shown in the following figure.
![Install VS Code Extension Pack](installation.assets/vscode_extension_installation.png){ class="animation-figure" }
![Install VS Code Extensions](installation.assets/vscode_extension_installation.png){ class="animation-figure" }
<p align="center"> Figure 16-2 &nbsp; Install VS Code Extension Pack </p>
<p align="center"> Figure 16-2 &nbsp; Install VS Code Extensions </p>
## 16.1.2 &nbsp; Install language environments
## 16.1.2 &nbsp; Installing Language Environments
### 1. &nbsp; Python environment
### 1. &nbsp; Python Environment
1. Download and install [Miniconda3](https://docs.conda.io/en/latest/miniconda.html), requiring Python 3.10 or newer.
2. In the VS Code extension marketplace, search for `python` and install the Python Extension Pack.
3. (Optional) Enter `pip install black` in the command line to install the code formatting tool.
1. Download and install [Miniconda3](https://docs.conda.io/en/latest/miniconda.html), which requires Python 3.10 or newer.
2. Search for `python` in the VS Code extension marketplace and install the Python Extension Pack.
3. (Optional) Enter `pip install black` on the command line to install the code formatter.
### 2. &nbsp; C/C++ environment
### 2. &nbsp; C/c++ Environment
1. Windows systems need to install [MinGW](https://sourceforge.net/projects/mingw-w64/files/) ([Configuration tutorial](https://blog.csdn.net/qq_33698226/article/details/129031241)); MacOS comes with Clang, so no installation is necessary.
2. In the VS Code extension marketplace, search for `c++` and install the C/C++ Extension Pack.
1. Windows systems need to install [MinGW](https://sourceforge.net/projects/mingw-w64/files/) ([configuration tutorial](https://blog.csdn.net/qq_33698226/article/details/129031241)); macOS comes with Clang built-in and does not require installation.
2. Search for `c++` in the VS Code extension marketplace and install the C/C++ Extension Pack.
3. (Optional) Open the Settings page, search for the `Clang_format_fallback Style` code formatting option, and set it to `{ BasedOnStyle: Microsoft, BreakBeforeBraces: Attach }`.
### 3. &nbsp; Java environment
### 3. &nbsp; Java Environment
1. Download and install [OpenJDK](https://jdk.java.net/18/) (version must be > JDK 9).
2. In the VS Code extension marketplace, search for `java` and install the Extension Pack for Java.
2. Search for `java` in the VS Code extension marketplace and install the Extension Pack for Java.
### 4. &nbsp; C# environment
### 4. &nbsp; C# Environment
1. Download and install [.Net 8.0](https://dotnet.microsoft.com/en-us/download).
2. In the VS Code extension marketplace, search for `C# Dev Kit` and install the C# Dev Kit ([Configuration tutorial](https://code.visualstudio.com/docs/csharp/get-started)).
3. You can also use Visual Studio ([Installation tutorial](https://learn.microsoft.com/zh-cn/visualstudio/install/install-visual-studio?view=vs-2022)).
2. Search for `C# Dev Kit` in the VS Code extension marketplace and install C# Dev Kit ([configuration tutorial](https://code.visualstudio.com/docs/csharp/get-started)).
3. You can also use Visual Studio ([installation tutorial](https://learn.microsoft.com/zh-cn/visualstudio/install/install-visual-studio?view=vs-2022)).
### 5. &nbsp; Go environment
### 5. &nbsp; Go Environment
1. Download and install [go](https://go.dev/dl/).
2. In the VS Code extension marketplace, search for `go` and install Go.
3. Press `Ctrl + Shift + P` to call up the command bar, enter go, choose `Go: Install/Update Tools`, select all and install.
1. Download and install [Go](https://go.dev/dl/).
2. Search for `go` in the VS Code extension marketplace and install Go.
3. Press `Ctrl + Shift + P` to open the command palette, type `go`, select `Go: Install/Update Tools`, check all options and install.
### 6. &nbsp; Swift environment
### 6. &nbsp; Swift Environment
1. Download and install [Swift](https://www.swift.org/download/).
2. In the VS Code extension marketplace, search for `swift` and install [Swift for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang).
2. Search for `swift` in the VS Code extension marketplace and install [Swift for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang).
### 7. &nbsp; JavaScript environment
### 7. &nbsp; Javascript Environment
1. Download and install [Node.js](https://nodejs.org/en/).
2. (Optional) In the VS Code extension marketplace, search for `Prettier` and install the code formatting tool.
2. (Optional) Search for `Prettier` in the VS Code extension marketplace and install the code formatter.
### 8. &nbsp; TypeScript environment
### 8. &nbsp; Typescript Environment
1. Follow the same installation steps as the JavaScript environment.
2. Install [TypeScript Execute (tsx)](https://github.com/privatenumber/tsx?tab=readme-ov-file#global-installation).
3. In the VS Code extension marketplace, search for `typescript` and install [Pretty TypeScript Errors](https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors).
3. Search for `typescript` in the VS Code extension marketplace and install [Pretty TypeScript Errors](https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors).
### 9. &nbsp; Dart environment
### 9. &nbsp; Dart Environment
1. Download and install [Dart](https://dart.dev/get-dart).
2. In the VS Code extension marketplace, search for `dart` and install [Dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code).
2. Search for `dart` in the VS Code extension marketplace and install [Dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code).
### 10. &nbsp; Rust environment
### 10. &nbsp; Rust Environment
1. Download and install [Rust](https://www.rust-lang.org/tools/install).
2. In the VS Code extension marketplace, search for `rust` and install [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
2. Search for `rust` in the VS Code extension marketplace and install [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).

View File

@@ -2,19 +2,19 @@
comments: true
---
# 16.3 &nbsp; Glossary
# 16.3 &nbsp; Terminology Table
Table 16-1 lists the important terms that appear in the book, and it is worth noting the following points.
The following table lists important terms that appear in this book. It is worth noting the following points:
- It is recommended to remember the English names of the terms to facilitate reading English literature.
- Some terms have different names in Simplified and Traditional Chinese.
- We recommend remembering the English names of terms to help with reading English literature.
- Some terms have different names in Simplified Chinese and Traditional Chinese.
<p align="center"> Table 16-1 &nbsp; Important Terms in Data Structures and Algorithms </p>
<div class="center-table" markdown>
| English | 简体中文 | 繁体中文 |
| ------------------------------ | -------------- | -------------- |
| English | Simplified Chinese | Traditional Chinese |
| ------------------------------ | ------------------ | ------------------- |
| algorithm | 算法 | 演算法 |
| data structure | 数据结构 | 資料結構 |
| code | 代码 | 程式碼 |