-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
030bded
commit b191621
Showing
719 changed files
with
4,576 additions
and
12,711 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.
Binary file modified
BIN
+507 Bytes
(100%)
面试和算法/hello-algo/assets/covers/chapter_array_and_linkedlist.jpg
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+523 Bytes
(100%)
面试和算法/hello-algo/assets/covers/chapter_complexity_analysis.jpg
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-15.3 KB
(87%)
面试和算法/hello-algo/assets/covers/chapter_divide_and_conquer.jpg
Oops, something went wrong.
Binary file modified
BIN
+849 Bytes
(100%)
面试和算法/hello-algo/assets/covers/chapter_dynamic_programming.jpg
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+454 Bytes
(100%)
面试和算法/hello-algo/assets/covers/chapter_stack_and_queue.jpg
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Binary file modified
BIN
-129 KB
(40%)
面试和算法/hello-algo/chapter_appendix/contribution.assets/edit_markdown.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# 附录 | ||
|
||
<div class="center-table" markdown> | ||
|
||
{ width="600" } | ||
|
||
</div> | ||
 |
Binary file added
BIN
+124 KB
...llo-algo/chapter_appendix/installation.assets/vscode_extension_installation.png
Oops, something went wrong.
Binary file added
BIN
+103 KB
面试和算法/hello-algo/chapter_appendix/installation.assets/vscode_installation.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,68 @@ | ||
# 编程环境安装 | ||
|
||
### VSCode | ||
## 安装 IDE | ||
|
||
本书推荐使用开源轻量的 VSCode 作为本地 IDE ,下载并安装 [VSCode](https://code.visualstudio.com/) 。 | ||
推荐使用开源、轻量的 VS Code 作为本地集成开发环境(IDE)。访问 [VS Code 官网](https://code.visualstudio.com/),根据操作系统选择相应版本的 VS Code 进行下载和安装。 | ||
|
||
### Java 环境 | ||
 | ||
|
||
1. 下载并安装 [OpenJDK](https://jdk.java.net/18/)(版本需满足 > JDK 9)。 | ||
2. 在 VSCode 的插件市场中搜索 `java` ,安装 Extension Pack for Java 。 | ||
VS Code 拥有强大的扩展包生态系统,支持大多数编程语言的运行和调试。以 Python 为例,安装“Python Extension Pack”扩展包之后,即可进行 Python 代码调试。安装步骤如下图所示。 | ||
|
||
### C/C++ 环境 | ||
 | ||
|
||
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 }` 。 | ||
## 安装语言环境 | ||
|
||
### Python 环境 | ||
|
||
1. 下载并安装 [Miniconda3](https://docs.conda.io/en/latest/miniconda.html) 。 | ||
2. 在 VSCode 的插件市场中搜索 `python` ,安装 Python Extension Pack 。 | ||
1. 下载并安装 [Miniconda3](https://docs.conda.io/en/latest/miniconda.html) ,需要 Python 3.10 或更新版本。 | ||
2. 在 VS Code 的插件市场中搜索 `python` ,安装 Python Extension Pack 。 | ||
3. (可选)在命令行输入 `pip install black` ,安装代码格式化工具。 | ||
|
||
### Go 环境 | ||
### C/C++ 环境 | ||
|
||
1. 下载并安装 [go](https://go.dev/dl/) 。 | ||
2. 在 VSCode 的插件市场中搜索 `go` ,安装 Go 。 | ||
3. 快捷键 `Ctrl + Shift + P` 呼出命令栏,输入 go ,选择 `Go: Install/Update Tools` ,全部勾选并安装即可。 | ||
1. Windows 系统需要安装 [MinGW](https://sourceforge.net/projects/mingw-w64/files/)([配置教程](https://blog.csdn.net/qq_33698226/article/details/129031241));MacOS 自带 Clang ,无须安装。 | ||
2. 在 VS Code 的插件市场中搜索 `c++` ,安装 C/C++ Extension Pack 。 | ||
3. (可选)打开 Settings 页面,搜索 `Clang_format_fallback Style` 代码格式化选项,设置为 `{ BasedOnStyle: Microsoft, BreakBeforeBraces: Attach }` 。 | ||
|
||
### JavaScript 环境 | ||
### Java 环境 | ||
|
||
1. 下载并安装 [node.js](https://nodejs.org/en/) 。 | ||
2. 在 VSCode 的插件市场中搜索 `javascript` ,安装 JavaScript (ES6) code snippets 。 | ||
3. (可选)在 VSCode 的插件市场中搜索 `Prettier` ,安装代码格式化工具。 | ||
1. 下载并安装 [OpenJDK](https://jdk.java.net/18/)(版本需满足 > JDK 9)。 | ||
2. 在 VS Code 的插件市场中搜索 `java` ,安装 Extension Pack for Java 。 | ||
|
||
### C# 环境 | ||
|
||
1. 下载并安装 [.Net 6.0](https://dotnet.microsoft.com/en-us/download) 。 | ||
2. 在 VSCode 的插件市场中搜索 `C# Dev Kit` ,安装 C# Dev Kit ([配置教程](https://code.visualstudio.com/docs/csharp/get-started))。 | ||
1. 下载并安装 [.Net 8.0](https://dotnet.microsoft.com/en-us/download) 。 | ||
2. 在 VS Code 的插件市场中搜索 `C# Dev Kit` ,安装 C# Dev Kit ([配置教程](https://code.visualstudio.com/docs/csharp/get-started))。 | ||
3. 也可使用 Visual Studio([安装教程](https://learn.microsoft.com/zh-cn/visualstudio/install/install-visual-studio?view=vs-2022))。 | ||
|
||
### Go 环境 | ||
|
||
1. 下载并安装 [go](https://go.dev/dl/) 。 | ||
2. 在 VS Code 的插件市场中搜索 `go` ,安装 Go 。 | ||
3. 按快捷键 `Ctrl + Shift + P` 呼出命令栏,输入 go ,选择 `Go: Install/Update Tools` ,全部勾选并安装即可。 | ||
|
||
### Swift 环境 | ||
|
||
1. 下载并安装 [Swift](https://www.swift.org/download/)。 | ||
2. 在 VSCode 的插件市场中搜索 `swift` ,安装 [Swift for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang)。 | ||
1. 下载并安装 [Swift](https://www.swift.org/download/) 。 | ||
2. 在 VS Code 的插件市场中搜索 `swift` ,安装 [Swift for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang) 。 | ||
|
||
### JavaScript 环境 | ||
|
||
1. 下载并安装 [Node.js](https://nodejs.org/en/) 。 | ||
2. (可选)在 VS Code 的插件市场中搜索 `Prettier` ,安装代码格式化工具。 | ||
|
||
### TypeScript 环境 | ||
|
||
1. 同 JavaScript 环境安装步骤。 | ||
2. 安装 [TypeScript Execute (tsx)](https://github.com/privatenumber/tsx?tab=readme-ov-file#global-installation) 。 | ||
3. 在 VS Code 的插件市场中搜索 `typescript` ,安装 [Pretty TypeScript Errors](https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors) 。 | ||
|
||
### Dart 环境 | ||
|
||
1. 下载并安装 [Dart](https://dart.dev/get-dart) 。 | ||
2. 在 VSCode 的插件市场中搜索 `dart` ,安装 [Dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) 。 | ||
2. 在 VS Code 的插件市场中搜索 `dart` ,安装 [Dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) 。 | ||
|
||
### Rust 环境 | ||
|
||
1. 下载并安装 [Rust](https://www.rust-lang.org/tools/install)。 | ||
2. 在 VSCode 的插件市场中搜索 `rust` ,安装 [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)。 | ||
1. 下载并安装 [Rust](https://www.rust-lang.org/tools/install) 。 | ||
2. 在 VS Code 的插件市场中搜索 `rust` ,安装 [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) 。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# 术语表 | ||
|
||
下表列出了书中出现的重要术语,值得注意以下几点。 | ||
|
||
- 建议记住名词的英文叫法,以便阅读英文文献。 | ||
- 部分名词在简体中文和繁体中文下的叫法不同。 | ||
|
||
<p align="center"> 表 <id> 数据结构与算法的重要名词 </p> | ||
|
||
| English | 简体中文 | 繁体中文 | | ||
| ------------------------------ | -------------- | -------------- | | ||
| algorithm | 算法 | 演算法 | | ||
| data structure | 数据结构 | 資料結構 | | ||
| code | 代码 | 程式碼 | | ||
| file | 文件 | 檔案 | | ||
| function | 函数 | 函式 | | ||
| method | 方法 | 方法 | | ||
| variable | 变量 | 變數 | | ||
| asymptotic complexity analysis | 渐近复杂度分析 | 漸近複雜度分析 | | ||
| time complexity | 时间复杂度 | 時間複雜度 | | ||
| space complexity | 空间复杂度 | 空間複雜度 | | ||
| loop | 循环 | 迴圈 | | ||
| iteration | 迭代 | 迭代 | | ||
| recursion | 递归 | 遞迴 | | ||
| tail recursion | 尾递归 | 尾遞迴 | | ||
| recursion tree | 递归树 | 遞迴樹 | | ||
| big-$O$ notation | 大 $O$ 记号 | 大 $O$ 記號 | | ||
| asymptotic upper bound | 渐近上界 | 漸近上界 | | ||
| sign-magnitude | 原码 | 原碼 | | ||
| 1’s complement | 反码 | 一補數 | | ||
| 2’s complement | 补码 | 二補數 | | ||
| array | 数组 | 陣列 | | ||
| index | 索引 | 索引 | | ||
| linked list | 链表 | 鏈結串列 | | ||
| linked list node, list node | 链表节点 | 鏈結串列節點 | | ||
| head node | 头节点 | 頭節點 | | ||
| tail node | 尾节点 | 尾節點 | | ||
| list | 列表 | 串列 | | ||
| dynamic array | 动态数组 | 動態陣列 | | ||
| hard disk | 硬盘 | 硬碟 | | ||
| random-access memory (RAM) | 内存 | 記憶體 | | ||
| cache memory | 缓存 | 快取 | | ||
| cache miss | 缓存未命中 | 快取未命中 | | ||
| cache hit rate | 缓存命中率 | 快取命中率 | | ||
| stack | 栈 | 堆疊 | | ||
| top of the stack | 栈顶 | 堆疊頂 | | ||
| bottom of the stack | 栈底 | 堆疊底 | | ||
| queue | 队列 | 佇列 | | ||
| double-ended queue | 双向队列 | 雙向佇列 | | ||
| front of the queue | 队首 | 佇列首 | | ||
| rear of the queue | 队尾 | 佇列尾 | | ||
| hash table | 哈希表 | 雜湊表 | | ||
| hash set | 哈希集合 | 雜湊集合 | | ||
| 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 | 平衡二叉树 | 平衡二元樹 | | ||
| binary search tree | 二叉搜索树 | 二元搜尋樹 | | ||
| AVL tree | AVL 树 | AVL 樹 | | ||
| 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 | 堆化 | 堆積化 | | ||
| top-$k$ problem | Top-$k$ 问题 | Top-$k$ 問題 | | ||
| 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$-queens problem | $n$ 皇后问题 | $n$ 皇后問題 | | ||
| dynamic programming | 动态规划 | 動態規劃 | | ||
| initial state | 初始状态 | 初始狀態 | | ||
| state-transition equation | 状态转移方程 | 狀態轉移方程 | | ||
| knapsack problem | 背包问题 | 背包問題 | | ||
| edit distance problem | 编辑距离问题 | 編輯距離問題 | | ||
| greedy algorithm | 贪心算法 | 貪婪演算法 | |
Binary file modified
BIN
-44.8 KB
(29%)
面试和算法/hello-algo/chapter_array_and_linkedlist/array.assets/array_definition.png
Oops, something went wrong.
Binary file modified
BIN
-56.4 KB
(32%)
...法/hello-algo/chapter_array_and_linkedlist/array.assets/array_insert_element.png
Oops, something went wrong.
Binary file modified
BIN
-51 KB
(29%)
...chapter_array_and_linkedlist/array.assets/array_memory_location_calculation.png
Oops, something went wrong.
Binary file modified
BIN
-53.1 KB
(32%)
...法/hello-algo/chapter_array_and_linkedlist/array.assets/array_remove_element.png
Oops, something went wrong.
Oops, something went wrong.