feat: Revised the book (#978)

* Sync recent changes to the revised Word.

* Revised the preface chapter

* Revised the introduction chapter

* Revised the computation complexity chapter

* Revised the chapter data structure

* Revised the chapter array and linked list

* Revised the chapter stack and queue

* Revised the chapter hashing

* Revised the chapter tree

* Revised the chapter heap

* Revised the chapter graph

* Revised the chapter searching

* Reivised the sorting chapter

* Revised the divide and conquer chapter

* Revised the chapter backtacking

* Revised the DP chapter

* Revised the greedy chapter

* Revised the appendix chapter

* Revised the preface chapter doubly

* Revised the figures
This commit is contained in:
Yudong Jin
2023-12-02 06:21:34 +08:00
committed by GitHub
parent b824d149cb
commit e720aa2d24
404 changed files with 1537 additions and 1558 deletions

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@@ -1,14 +1,14 @@
# 一起参与创作
由于者能力有限,书中难免存在一些遗漏和错误,请您谅解。如果您发现了笔误、失效链接、内容缺失、文字歧义、解释不清晰或行文结构不合理等问题,请协助我们进行修正,以给读者提供更优质的学习资源。
由于者能力有限,书中难免存在一些遗漏和错误,请您谅解。如果您发现了笔误、链接失效、内容缺失、文字歧义、解释不清晰或行文结构不合理等问题,请协助我们进行修正,以给读者提供更优质的学习资源。
所有[撰稿人](https://github.com/krahets/hello-algo/graphs/contributors)的 GitHub ID 将被展示在本书仓库主页上,以感谢他们对开源社区的无私奉献。
所有[撰稿人](https://github.com/krahets/hello-algo/graphs/contributors)的 GitHub ID 将在本书仓库、网页版和 PDF 版的主页上进行展示,以感谢他们对开源社区的无私奉献。
!!! success "开源的魅力"
纸质书的两次印刷的间隔时间往往需要数年,内容更新非常不方便。
纸质书的两次印刷的间隔时间往往较久,内容更新非常不方便。
而在本开源书中,内容更迭的时间被缩短至数日甚至几个小时。
而在本开源书中,内容更迭的时间被缩短至数日甚至几个小时。
### 内容微调
@@ -26,7 +26,7 @@
如果您有兴趣参与此开源项目,包括将代码翻译成其他编程语言、扩展文章内容等,那么需要实施以下 Pull Request 工作流程。
1. 登录 GitHub ,将[本仓库](https://github.com/krahets/hello-algo) Fork 到个人账号下。
1. 登录 GitHub ,将本书的[代码仓库](https://github.com/krahets/hello-algo) Fork 到个人账号下。
2. 进入您的 Fork 仓库网页,使用 `git clone` 命令将仓库克隆至本地。
3. 在本地进行内容创作,并进行完整测试,验证代码的正确性。
4. 将本地所做更改 Commit ,然后 Push 至远程仓库。
@@ -34,13 +34,13 @@
### Docker 部署
`hello-algo` 根目录下,执行以下 Docker 脚本,即可在 `http://localhost:8000` 访问本项目
`hello-algo` 根目录下,执行以下 Docker 脚本,即可在 `http://localhost:8000` 访问本项目
```shell
docker-compose up -d
```
使用以下命令即可删除部署
使用以下命令即可删除部署
```shell
docker-compose down

View File

@@ -2,7 +2,7 @@
### VSCode
本书推荐使用开源轻量的 VSCode 作为本地 IDE ,下载并安装 [VSCode](https://code.visualstudio.com/) 。
本书推荐使用开源轻量的 VSCode 作为本地 IDE ,下载并安装 [VSCode](https://code.visualstudio.com/) 。
### Java 环境
@@ -11,7 +11,7 @@
### C/C++ 环境
1. Windows 系统需要安装 [MinGW](https://sourceforge.net/projects/mingw-w64/files/)[配置教程](https://blog.csdn.net/qq_33698226/article/details/129031241)MacOS 自带 Clang 无须安装。
1. Windows 系统需要安装 [MinGW](https://sourceforge.net/projects/mingw-w64/files/)[配置教程](https://blog.csdn.net/qq_33698226/article/details/129031241)MacOS 自带 Clang 无须安装。
2. 在 VSCode 的插件市场中搜索 `c++` ,安装 C/C++ Extension Pack 。
3. (可选)打开 Settings 页面,搜索 `Clang_format_fallback Style` 代码格式化选项,设置为 `{ BasedOnStyle: Microsoft, BreakBeforeBraces: Attach }`
@@ -25,7 +25,7 @@
1. 下载并安装 [go](https://go.dev/dl/) 。
2. 在 VSCode 的插件市场中搜索 `go` ,安装 Go 。
3. 快捷键 `Ctrl + Shift + P` 呼出命令栏,输入 go ,选择 `Go: Install/Update Tools` ,全部勾选并安装即可。
3. 快捷键 `Ctrl + Shift + P` 呼出命令栏,输入 go ,选择 `Go: Install/Update Tools` ,全部勾选并安装即可。
### JavaScript 环境

View File

@@ -2,113 +2,65 @@
下表列出了书中出现的重要术语。建议你同时记住它们的中英文叫法,以便阅读英文文献。
<p align="center"> 表 <id> &nbsp; 数据结构与算法重要名词 </p>
<p align="center"> 表 <id> &nbsp; 数据结构与算法重要名词 </p>
| 中文 | English |
| -------------- | ------------------------------ |
| 算法 | algorithm |
| 数据结构 | data structure |
| 渐近复杂度分析 | asymptotic complexity analysis |
| 时间复杂度 | time complexity |
| 空间复杂度 | space complexity |
| 迭代 | iteration |
| 递归 | recursion |
| 尾递归 | tail recursion |
| 递归树 | recursion tree |
| 大 $O$ 记号 | big-$O$ notation |
| 渐近上界 | asymptotic upper bound |
| 原码 | signmagnitude |
| 码 | 1's complement |
| 码 | 2's complement |
| 数组 | array |
| 索引 | index |
| 链表 | linked list |
| 链表节点 | linked list node, list node |
| 列表 | list |
| 动态数组 | dynamic array |
| 栈 | stack |
| 队列 | queue |
| 双向队列 | double-ended queue |
| 哈希表 | hash table |
| 桶 | bucket |
| 哈希函数 | hash function |
| 哈希冲突 | hash collision |
| 负载因子 | load factor |
| 链式地址 | separate chaining |
| 开放寻址 | open addressing |
| 线性探测 | linear probing |
| 懒删除 | lazy deletion |
| 二叉树 | binary tree |
| 树节点 | tree node |
| 左子节点 | left-child node |
| 右子节点 | right-child node |
| 父节点 | parent node |
| 左子树 | left subtree |
| 右子树 | right subtree |
| 节点 | root node |
| 叶节点 | leaf node |
| | edge |
| | level |
| | degree |
| 高度 | height |
| 深度 | depth |
| 完美二叉树 | perfect binary tree |
| 完全二叉树 | complete binary tree |
| 完满二叉树 | full binary tree |
| 平衡二叉树 | balanced binary tree |
| AVL 树 | AVL tree |
| 红黑树 | red-black tree |
| 层序遍历 | level-order traversal |
| 广度优先遍历 | breadth-first traversal |
| 深度优先遍历 | depth-first traversal |
| 二叉搜索树 | binary search tree |
| 平衡二叉搜索树 | balanced binary search tree |
| 平衡因子 | balance factor |
| 堆 | heap |
| 大顶堆 | max heap |
| 小顶堆 | min heap |
| 优先队列 | priority queue |
| 堆化 | heapify |
| 图 | graph |
| 顶点 | vertex |
| 无向图 | undirected graph |
| 有向图 | directed graph |
| 连通图 | connected graph |
| 非连通图 | disconnected graph |
| 有权图 | weighted graph |
| 邻接 | adjacency |
| 路径 | path |
| 入度 | in-degree |
| 出度 | out-degree |
| 邻接矩阵 | adjacency matrix |
| 邻接表 | adjacency list |
| 广度优先搜索 | breadth-first search |
| 深度优先搜索 | depth-first search |
| 二分查找 | binary search |
| 搜索算法 | searching algorithm |
| 排序算法 | sorting algorithm |
| 选择排序 | selection sort |
| 冒泡排序 | bubble sort |
| 插入排序 | insertion sort |
| 快速排序 | quick sort |
| 归并排序 | merge sort |
| 堆排序 | heap sort |
| 桶排序 | bucket sort |
| 计数排序 | counting sort |
| 基数排序 | radix sort |
| 分治 | divide and conquer |
| 汉诺塔问题 | hanota problem |
| 回溯算法 | backtracking algorithm |
| 约束 | constraint |
| 解 | solution |
| 状态 | state |
| 剪枝 | pruning |
| 全排列问题 | permutations problem |
| 子集和问题 | subset-sum problem |
| N 皇后问题 | N-queens problem |
| 动态规划 | dynamic programming |
| 初始状态 | initial state |
| 状态转移方程 | state-trasition equation |
| 背包问题 | knapsack problem |
| 编辑距离问题 | edit distance problem |
| 贪心算法 | greedy algorithm |
| 中文 | English | 中文 | English |
| -------------- | ------------------------------ | -------------- | --------------------------- |
| 算法 | algorithm | 层序遍历 | level-order traversal |
| 数据结构 | data structure | 广度优先遍历 | breadth-first traversal |
| 渐近复杂度分析 | asymptotic complexity analysis | 深度优先遍历 | depth-first traversal |
| 时间复杂度 | time complexity | 二叉搜索树 | binary search tree |
| 空间复杂度 | space complexity | 平衡二叉搜索树 | balanced binary search tree |
| 迭代 | iteration | 平衡因子 | balance factor |
| 递归 | recursion | 堆 | heap |
| 尾递归 | tail recursion | 大顶堆 | max heap |
| 递归树 | recursion tree | 小顶堆 | min heap |
| 大 | big- | 优先队列 | priority queue |
| 记号 | notation | | |
| 渐近上界 | asymptotic upper bound | 堆化 | heapify |
| 码 | signmagnitude | 图 | graph |
| 码 | 1s complement | 顶点 | vertex |
| 补码 | 2s complement | 无向图 | undirected graph |
| 数组 | array | 有向图 | directed graph |
| 索引 | index | 连通图 | connected graph |
| 链表 | linked list | 非连通图 | disconnected graph |
| 链表节点 | linked list node, list node | 有权图 | weighted graph |
| 列表 | list | 邻接 | adjacency |
| 动态数组 | dynamic array | 路径 | path |
| 硬盘 | hard disk | 入度 | in-degree |
| 内存 | random-access memory (RAM) | 出度 | out-degree |
| 缓存 | cache memory | 邻接矩阵 | adjacency matrix |
| 缓存未命中 | cache miss | 邻接表 | adjacency list |
| 缓存命中率 | cache hit rate | 广度优先搜索 | breadth-first search |
| | stack | 深度优先搜索 | depth-first search |
| 队列 | queue | 二分查找 | binary search |
| 双向队列 | double-ended queue | 搜索算法 | searching algorithm |
| 哈希表 | hash table | 排序算法 | sorting algorithm |
| | bucket | 选择排序 | selection sort |
| 哈希函数 | hash function | 冒泡排序 | bubble sort |
| 哈希冲突 | hash collision | 插入排序 | insertion sort |
| 负载因子 | load factor | 快速排序 | quick sort |
| 链式地址 | separate chaining | 归并排序 | merge sort |
| 开放寻址 | open addressing | 堆排序 | heap sort |
| 线性探测 | linear probing | 桶排序 | bucket sort |
| 懒删除 | lazy deletion | 计数排序 | counting sort |
| 二叉树 | binary tree | 基数排序 | radix sort |
| 节点 | tree node | 分治 | divide and conquer |
| 左子节点 | left-child node | 汉诺塔问题 | hanota problem |
| 右子节点 | right-child node | 回溯算法 | backtracking algorithm |
| 父节点 | parent node | 约束 | constraint |
| 左子树 | left subtree | 解 | solution |
| 右子树 | right subtree | 状态 | state |
| 根节点 | root node | 剪枝 | pruning |
| 叶节点 | leaf node | 全排列问题 | permutations problem |
| 边 | edge | 子集和问题 | subset-sum problem |
| 层 | level | N 皇后问题 | N-queens problem |
| 度 | degree | 动态规划 | dynamic programming |
| 高度 | height | 初始状态 | initial state |
| 深度 | depth | 状态转移方程 | state-trasition equation |
| 完美二叉树 | perfect binary tree | 背包问题 | knapsack problem |
| 完全二叉树 | complete binary tree | 编辑距离问题 | edit distance problem |
| 完满二叉树 | full binary tree | 贪心算法 | greedy algorithm |
| 平衡二叉树 | balanced binary tree | | |
| AVL 树 | AVL tree | | |
| 红黑树 | red-black tree | | |