Prepare 1.0.0b3 release.
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 84 KiB |
|
@ -145,7 +145,7 @@
|
||||||
在每次“尝试”中,我们通过将当前节点添加进 `path` 来记录路径;而在“回退”前,我们需要将该节点从 `path` 中弹出,**以恢复本次尝试之前的状态**。换句话说,**我们可以将尝试和回退理解为“前进”与“撤销”**,两个操作是互为相反的。
|
在每次“尝试”中,我们通过将当前节点添加进 `path` 来记录路径;而在“回退”前,我们需要将该节点从 `path` 中弹出,**以恢复本次尝试之前的状态**。换句话说,**我们可以将尝试和回退理解为“前进”与“撤销”**,两个操作是互为相反的。
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![preorder_find_paths_step1](backtracking_algorithm.assets/preorder_find_paths_step1.png)
|
![尝试与回退](backtracking_algorithm.assets/preorder_find_paths_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![preorder_find_paths_step2](backtracking_algorithm.assets/preorder_find_paths_step2.png)
|
![preorder_find_paths_step2](backtracking_algorithm.assets/preorder_find_paths_step2.png)
|
||||||
|
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 74 KiB |
|
@ -82,7 +82,7 @@
|
||||||
2. 将键值对 `num[i]` 和索引 `i` 添加进哈希表;
|
2. 将键值对 `num[i]` 和索引 `i` 添加进哈希表;
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![two_sum_hashtable_step1](replace_linear_by_hashing.assets/two_sum_hashtable_step1.png)
|
![辅助哈希表求解两数之和](replace_linear_by_hashing.assets/two_sum_hashtable_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![two_sum_hashtable_step2](replace_linear_by_hashing.assets/two_sum_hashtable_step2.png)
|
![two_sum_hashtable_step2](replace_linear_by_hashing.assets/two_sum_hashtable_step2.png)
|
||||||
|
|
|
@ -94,7 +94,7 @@ $$
|
||||||
遍历完成后,数组 `res` 中就是排序好的结果,最后使用 `res` 覆盖原数组 `nums` 即可。
|
遍历完成后,数组 `res` 中就是排序好的结果,最后使用 `res` 覆盖原数组 `nums` 即可。
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![counting_sort_step1](counting_sort.assets/counting_sort_step1.png)
|
![计数排序步骤](counting_sort.assets/counting_sort_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![counting_sort_step2](counting_sort.assets/counting_sort_step2.png)
|
![counting_sort_step2](counting_sort.assets/counting_sort_step2.png)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
- 若 `cur.val = num` ,说明找到目标节点,跳出循环并返回该节点;
|
- 若 `cur.val = num` ,说明找到目标节点,跳出循环并返回该节点;
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![bst_search_step1](binary_search_tree.assets/bst_search_step1.png)
|
![二叉搜索树查找节点示例](binary_search_tree.assets/bst_search_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![bst_search_step2](binary_search_tree.assets/bst_search_step2.png)
|
![bst_search_step2](binary_search_tree.assets/bst_search_step2.png)
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
3. 用 `tmp` 的值覆盖待删除节点的值;
|
3. 用 `tmp` 的值覆盖待删除节点的值;
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![bst_remove_case3_step1](binary_search_tree.assets/bst_remove_case3_step1.png)
|
![二叉搜索树删除节点示例](binary_search_tree.assets/bst_remove_case3_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![bst_remove_case3_step2](binary_search_tree.assets/bst_remove_case3_step2.png)
|
![bst_remove_case3_step2](binary_search_tree.assets/bst_remove_case3_step2.png)
|
||||||
|
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 82 KiB |
|
@ -209,7 +209,7 @@
|
||||||
递归过程可分为“递”和“归”两个相反的部分。“递”表示开启新方法,程序在此过程中访问下一个节点;“归”表示函数返回,代表该节点已经访问完毕。如下图所示,为前序遍历二叉树的递归过程。
|
递归过程可分为“递”和“归”两个相反的部分。“递”表示开启新方法,程序在此过程中访问下一个节点;“归”表示函数返回,代表该节点已经访问完毕。如下图所示,为前序遍历二叉树的递归过程。
|
||||||
|
|
||||||
=== "<1>"
|
=== "<1>"
|
||||||
![preorder_step1](binary_tree_traversal.assets/preorder_step1.png)
|
![前序遍历的递归过程](binary_tree_traversal.assets/preorder_step1.png)
|
||||||
|
|
||||||
=== "<2>"
|
=== "<2>"
|
||||||
![preorder_step2](binary_tree_traversal.assets/preorder_step2.png)
|
![preorder_step2](binary_tree_traversal.assets/preorder_step2.png)
|
||||||
|
|