Update README for zh-hant version (#1228)
* Bug fixes * Fix the term in heap figures * Unify the font of the chapter covers for the zh, en, and zh-Hant version * Sync the zh-hant vertion with the main branch * Update README for testing * Update README for testing * Update README for testing * Update README for zh, en, zh-hant version * Fix the issue links * Update README * Update README * edition -> version
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
@@ -27,18 +27,18 @@
|
||||
| big-$O$ notation | 大 $O$ 记号 | 大 $O$ 記號 |
|
||||
| asymptotic upper bound | 渐近上界 | 漸近上界 |
|
||||
| sign-magnitude | 原码 | 原碼 |
|
||||
| 1’s complement | 反码 | 反碼 |
|
||||
| 2’s complement | 补码 | 補碼 |
|
||||
| 1’s complement | 反码 | 一補數 |
|
||||
| 2’s complement | 补码 | 二補數 |
|
||||
| array | 数组 | 陣列 |
|
||||
| index | 索引 | 索引 |
|
||||
| linked list | 链表 | 鏈結串列 |
|
||||
| linked list node, list node | 链表节点 | 鏈結串列節點 |
|
||||
| head node | 头节点 | 頭節點 |
|
||||
| tail node | 尾节点 | 尾節點 |
|
||||
| list | 列表 | 列表 |
|
||||
| list | 列表 | 串列 |
|
||||
| dynamic array | 动态数组 | 動態陣列 |
|
||||
| hard disk | 硬盘 | 硬碟 |
|
||||
| random-access memory (RAM) | 内存 | 內存 |
|
||||
| random-access memory (RAM) | 内存 | 記憶體 |
|
||||
| cache memory | 缓存 | 快取 |
|
||||
| cache miss | 缓存未命中 | 快取未命中 |
|
||||
| cache hit rate | 缓存命中率 | 快取命中率 |
|
||||
|
||||
@@ -563,13 +563,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
void loop(int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
func();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
void recur(int n) {
|
||||
if (n == 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -583,13 +583,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
void loop(int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
function();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
void recur(int n) {
|
||||
if (n == 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -603,13 +603,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
void Loop(int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
Function();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
int Recur(int n) {
|
||||
if (n == 1) return 1;
|
||||
return Recur(n - 1);
|
||||
@@ -624,14 +624,14 @@
|
||||
return 0
|
||||
}
|
||||
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
func loop(n int) {
|
||||
for i := 0; i < n; i++ {
|
||||
function()
|
||||
}
|
||||
}
|
||||
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
func recur(n int) {
|
||||
if n == 1 {
|
||||
return
|
||||
@@ -649,14 +649,14 @@
|
||||
return 0
|
||||
}
|
||||
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
func loop(n: Int) {
|
||||
for _ in 0 ..< n {
|
||||
function()
|
||||
}
|
||||
}
|
||||
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
func recur(n: Int) {
|
||||
if n == 1 {
|
||||
return
|
||||
@@ -672,13 +672,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
function loop(n) {
|
||||
for (let i = 0; i < n; i++) {
|
||||
constFunc();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
function recur(n) {
|
||||
if (n === 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -692,13 +692,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
function loop(n: number): void {
|
||||
for (let i = 0; i < n; i++) {
|
||||
constFunc();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
function recur(n: number): void {
|
||||
if (n === 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -712,13 +712,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
void loop(int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
function();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
void recur(int n) {
|
||||
if (n == 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -732,13 +732,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
fn loop(n: i32) {
|
||||
for i in 0..n {
|
||||
function();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
fn recur(n: i32) {
|
||||
if n == 1 {
|
||||
return;
|
||||
@@ -754,13 +754,13 @@
|
||||
// 执行某些操作
|
||||
return 0;
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
void loop(int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
func();
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
void recur(int n) {
|
||||
if (n == 1) return;
|
||||
return recur(n - 1);
|
||||
@@ -774,13 +774,13 @@
|
||||
// 执行某些操作
|
||||
return 0
|
||||
}
|
||||
/* 循环 O(1) */
|
||||
/* 循环的空间复杂度为 O(1) */
|
||||
fun loop(n: Int) {
|
||||
for (i in 0..<n) {
|
||||
function()
|
||||
}
|
||||
}
|
||||
/* 递归 O(n) */
|
||||
/* 递归的空间复杂度为 O(n) */
|
||||
fun recur(n: Int) {
|
||||
if (n == 1) return
|
||||
return recur(n - 1)
|
||||
|
||||
@@ -743,7 +743,7 @@ $$
|
||||
|
||||
$T(n)$ 是一次函数,说明其运行时间的增长趋势是线性的,因此它的时间复杂度是线性阶。
|
||||
|
||||
我们将线性阶的时间复杂度记为 $O(n)$ ,这个数学符号称为<u>大$O$ 记号(big-$O$ notation)</u>,表示函数 $T(n)$ 的<u>渐近上界(asymptotic upper bound)</u>。
|
||||
我们将线性阶的时间复杂度记为 $O(n)$ ,这个数学符号称为<u>大 $O$ 记号(big-$O$ notation)</u>,表示函数 $T(n)$ 的<u>渐近上界(asymptotic upper bound)</u>。
|
||||
|
||||
时间复杂度分析本质上是计算“操作数量 $T(n)$”的渐近上界,它具有明确的数学定义。
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |