Skip to content

Commit 3a11f43

Browse files
committed
Improve Traditional Chinese (zh-TW) translation coverage
The zh-TW README was significantly outdated, missing ~40% of algorithms, entire sections, difficulty labels, and containing mixed Simplified/Traditional characters. This overhaul brings it to parity with the English README. Changes to README.zh-TW.md: - Add B/A difficulty labels to all items - Add 5 missing data structures (Doubly Linked List, Segment Tree, etc.) - Add ~35 missing algorithms across all categories - Add entirely new sections: Cryptography, ML, Image Processing, Statistics - Translate all remaining English descriptions to Traditional Chinese - Fix Simplified Chinese character leaks (组合→組合, 循环→循環) - Fix terminology (貯列→佇列, using standard TW computing terms) - Update complexity tables with missing rows and columns - Add ESLint, Troubleshooting sections to "How to Use" - Update language navigation links New zh-TW sub-READMEs for 6 core data structures: - linked-list, queue, stack, hash-table, heap, tree Updated English sub-READMEs to include 繁體中文 language links. https://claude.ai/code/session_01RftDRB79YtH9PFWHCDrgQz
1 parent 115e428 commit 3a11f43

13 files changed

Lines changed: 601 additions & 159 deletions

File tree

README.zh-TW.md

Lines changed: 262 additions & 153 deletions
Large diffs are not rendered by default.

src/data-structures/hash-table/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ _Read this in other languages:_
77
[_Français_](README.fr-FR.md),
88
[_Português_](README.pt-BR.md),
99
[_한국어_](README.ko-KR.md),
10-
[_Українська_](README.uk-UA.md)
10+
[_Українська_](README.uk-UA.md),
11+
[_繁體中文_](README.zh-TW.md)
1112

1213
In computing, a **hash table** (hash map) is a data
1314
structure which implements an _associative array_
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 雜湊表
2+
3+
_以其他語言閱讀:_
4+
[_English_](README.md),
5+
[_简体中文_](README.zh-CN.md),
6+
[_Русский_](README.ru-RU.md),
7+
[_日本語_](README.ja-JP.md),
8+
[_Français_](README.fr-FR.md),
9+
[_Português_](README.pt-BR.md),
10+
[_한국어_](README.ko-KR.md),
11+
[_Українська_](README.uk-UA.md)
12+
13+
在電腦科學中,**雜湊表**(雜湊對映)是一種實作*關聯式陣列*抽象資料型別的資料結構,它可以將*鍵對映到值*。雜湊表使用*雜湊函數*來計算一個索引值,指向一個桶(bucket)或槽(slot)的陣列,從中可以找到所需的值。
14+
15+
理想情況下,雜湊函數會將每個鍵分配到唯一的桶中,但大多數雜湊表的設計採用不完美的雜湊函數,這可能會導致雜湊碰撞——即雜湊函數為多個不同的鍵產生相同的索引值。這類碰撞必須以某種方式處理。
16+
17+
![Hash Table](./images/hash-table.jpeg)
18+
19+
透過分離鏈結法解決雜湊碰撞
20+
21+
![Hash Collision](./images/collision-resolution.jpeg)
22+
23+
*使用 [okso.app](https://okso.app) 製作*
24+
25+
## 參考資料
26+
27+
- [維基百科](https://zh.wikipedia.org/wiki/哈希表)
28+
- [YouTube](https://www.youtube.com/watch?v=shs0KM3wKv8&index=4&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)

src/data-structures/heap/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ _Read this in other languages:_
88
[_Português_](README.pt-BR.md),
99
[_Türkçe_](README.tr-TR.md),
1010
[_한국어_](README.ko-KR.md),
11-
[_Українська_](README.uk-UA.md)
11+
[_Українська_](README.uk-UA.md),
12+
[_繁體中文_](README.zh-TW.md)
1213

1314

1415
In computer science, a **heap** is a specialized tree-based
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# 堆積(資料結構)
2+
3+
_以其他語言閱讀:_
4+
[_English_](README.md),
5+
[_简体中文_](README.zh-CN.md),
6+
[_Русский_](README.ru-RU.md),
7+
[_日本語_](README.ja-JP.md),
8+
[_Français_](README.fr-FR.md),
9+
[_Português_](README.pt-BR.md),
10+
[_Türkçe_](README.tr-TR.md),
11+
[_한국어_](README.ko-KR.md),
12+
[_Українська_](README.uk-UA.md)
13+
14+
在電腦科學中,**堆積**是一種特殊的樹狀資料結構,滿足以下描述的堆積性質。
15+
16+
*最小堆積*中,若 `P``C` 的父節點,則 `P` 的鍵值(數值)小於或等於 `C` 的鍵值。
17+
18+
![MinHeap](./images/min-heap.jpeg)
19+
20+
*使用 [okso.app](https://okso.app) 製作*
21+
22+
*最大堆積*中,`P` 的鍵值大於或等於 `C` 的鍵值。
23+
24+
![MaxHeap](./images/max-heap.jpeg)
25+
26+
![Array Representation](./images/array-representation.jpeg)
27+
28+
堆積中沒有父節點的最頂端節點稱為根節點。
29+
30+
## 時間複雜度
31+
32+
以下是各種堆積資料結構的時間複雜度。函數名稱假設為最大堆積。
33+
34+
| 操作 | find-max | delete-max | insert | increase-key | meld |
35+
| ---------- | ---------- | ---------- | ---------- | ------------ | ---------- |
36+
| [二元堆積](https://en.wikipedia.org/wiki/Binary_heap) | `Θ(1)` | `Θ(log n)` | `O(log n)` | `O(log n)` | `Θ(n)` |
37+
| [左偏樹](https://en.wikipedia.org/wiki/Leftist_tree) | `Θ(1)` | `Θ(log n)` | `Θ(log n)` | `O(log n)` | `Θ(log n)` |
38+
| [二項式堆積](https://en.wikipedia.org/wiki/Binomial_heap) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `O(log n)` | `O(log n)` |
39+
| [費波那契堆積](https://en.wikipedia.org/wiki/Fibonacci_heap) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `Θ(1)` | `Θ(1)` |
40+
| [配對堆積](https://en.wikipedia.org/wiki/Pairing_heap) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `o(log n)` | `Θ(1)` |
41+
| [Brodal 佇列](https://en.wikipedia.org/wiki/Brodal_queue) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `Θ(1)` | `Θ(1)` |
42+
| [Rank-pairing 堆積](https://en.wikipedia.org/w/index.php?title=Rank-pairing_heap&action=edit&redlink=1) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `Θ(1)` | `Θ(1)` |
43+
| [嚴格費波那契堆積](https://en.wikipedia.org/wiki/Fibonacci_heap) | `Θ(1)` | `Θ(log n)` | `Θ(1)` | `Θ(1)` | `Θ(1)` |
44+
| [2-3 堆積](https://en.wikipedia.org/wiki/2%E2%80%933_heap) | `O(log n)` | `O(log n)` | `O(log n)` | `Θ(1)` | `?` |
45+
46+
其中:
47+
- **find-max(或 find-min)**:分別找到最大堆積中的最大項目或最小堆積中的最小項目(又稱 *peek*
48+
- **delete-max(或 delete-min)**:分別移除最大堆積(或最小堆積)的根節點
49+
- **insert**:將新的鍵值加入堆積中(又稱 *push*
50+
- **increase-key 或 decrease-key**:分別更新最大堆積或最小堆積中的鍵值
51+
- **meld**:將兩個堆積合併成一個新的有效堆積,包含兩者的所有元素,並銷毀原來的堆積
52+
53+
> 在本知識庫中,[MaxHeap.js](./MaxHeap.js)[MinHeap.js](./MinHeap.js)**二元堆積**的範例。
54+
55+
## 實作
56+
57+
- [MaxHeap.js](./MaxHeap.js)[MinHeap.js](./MinHeap.js)
58+
- [MaxHeapAdhoc.js](./MaxHeapAdhoc.js)[MinHeapAdhoc.js](./MinHeapAdhoc.js) - MinHeap/MaxHeap 資料結構的極簡(ad hoc)版本,不依賴外部相依套件,可在面試中輕鬆複製貼上使用(因為 JavaScript 中缺少許多資料結構)。
59+
60+
## 參考資料
61+
62+
- [維基百科](https://zh.wikipedia.org/wiki/堆_(資料結構))
63+
- [YouTube](https://www.youtube.com/watch?v=t0Cq6tVNRBA&index=5&t=0s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)

src/data-structures/linked-list/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ _Read this in other languages:_
88
[_한국어_](README.ko-KR.md),
99
[_Español_](README.es-ES.md),
1010
[_Türkçe_](README.tr-TR.md),
11-
[_Українська_](README.uk-UA.md)
11+
[_Українська_](README.uk-UA.md),
12+
[_繁體中文_](README.zh-TW.md)
1213

1314
In computer science, a **linked list** is a linear collection
1415
of data elements, in which linear order is not given by
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# 鏈結串列
2+
3+
_以其他語言閱讀:_
4+
[_English_](README.md),
5+
[_简体中文_](README.zh-CN.md),
6+
[_Русский_](README.ru-RU.md),
7+
[_日本語_](README.ja-JP.md),
8+
[_Português_](README.pt-BR.md),
9+
[_한국어_](README.ko-KR.md),
10+
[_Español_](README.es-ES.md),
11+
[_Türkçe_](README.tr-TR.md),
12+
[_Українська_](README.uk-UA.md)
13+
14+
在電腦科學中,**鏈結串列**是一種資料元素的線性集合,其線性順序不是由元素在記憶體中的物理位置決定的。每個元素指向下一個元素。鏈結串列是由一組節點組成的資料結構,這些節點共同表示一個序列。在最簡單的形式下,每個節點由資料和一個指向序列中下一個節點的參考(換句話說,就是一個連結)組成。這種結構允許在走訪過程中,從序列的任何位置有效率地插入或移除元素。更複雜的變體會增加額外的連結,允許從任意元素參考進行有效率的插入或移除。鏈結串列的缺點是存取時間為線性的(且難以進行管線化處理)。較快速的存取方式,如隨機存取,是不可行的。與鏈結串列相比,陣列擁有更好的快取局部性。
15+
16+
![Linked List](./images/linked-list.jpeg)
17+
18+
*使用 [okso.app](https://okso.app) 製作*
19+
20+
## 基本操作的虛擬碼
21+
22+
### 插入
23+
24+
```text
25+
Add(value)
26+
Pre: value 是要新增到串列的值
27+
Post: value 已被放置在串列的尾端
28+
n ← node(value)
29+
if head = ø
30+
head ← n
31+
tail ← n
32+
else
33+
tail.next ← n
34+
tail ← n
35+
end if
36+
end Add
37+
```
38+
39+
```text
40+
Prepend(value)
41+
Pre: value 是要新增到串列的值
42+
Post: value 已被放置在串列的頭部
43+
n ← node(value)
44+
n.next ← head
45+
head ← n
46+
if tail = ø
47+
tail ← n
48+
end
49+
end Prepend
50+
```
51+
52+
### 搜尋
53+
54+
```text
55+
Contains(head, value)
56+
Pre: head 是串列中的頭部節點
57+
value 是要搜尋的值
58+
Post: 如果項目在鏈結串列中則回傳 true;否則回傳 false
59+
n ← head
60+
while n != ø and n.value != value
61+
n ← n.next
62+
end while
63+
if n = ø
64+
return false
65+
end if
66+
return true
67+
end Contains
68+
```
69+
70+
### 刪除
71+
72+
```text
73+
Remove(head, value)
74+
Pre: head 是串列中的頭部節點
75+
value 是要從串列中移除的值
76+
Post: 如果 value 從串列中移除則回傳 true,否則回傳 false
77+
if head = ø
78+
return false
79+
end if
80+
n ← head
81+
if n.value = value
82+
if head = tail
83+
head ← ø
84+
tail ← ø
85+
else
86+
head ← head.next
87+
end if
88+
return true
89+
end if
90+
while n.next != ø and n.next.value != value
91+
n ← n.next
92+
end while
93+
if n.next != ø
94+
if n.next = tail
95+
tail ← n
96+
tail.next = null
97+
else
98+
n.next ← n.next.next
99+
end if
100+
return true
101+
end if
102+
return false
103+
end Remove
104+
```
105+
106+
### 走訪
107+
108+
```text
109+
Traverse(head)
110+
Pre: head 是串列中的頭部節點
111+
Post: 串列中的項目已被走訪
112+
n ← head
113+
while n != ø
114+
yield n.value
115+
n ← n.next
116+
end while
117+
end Traverse
118+
```
119+
120+
### 反向走訪
121+
122+
```text
123+
ReverseTraversal(head, tail)
124+
Pre: head 和 tail 屬於同一個串列
125+
Post: 串列中的項目已被反向走訪
126+
if tail != ø
127+
curr ← tail
128+
while curr != head
129+
prev ← head
130+
while prev.next != curr
131+
prev ← prev.next
132+
end while
133+
yield curr.value
134+
curr ← prev
135+
end while
136+
yield curr.value
137+
end if
138+
end ReverseTraversal
139+
```
140+
141+
## 複雜度
142+
143+
### 時間複雜度
144+
145+
| 存取 | 搜尋 | 插入 | 刪除 |
146+
| :-------: | :-------: | :-------: | :-------: |
147+
| O(n) | O(n) | O(1) | O(n) |
148+
149+
### 空間複雜度
150+
151+
O(n)
152+
153+
## 參考資料
154+
155+
- [維基百科](https://zh.wikipedia.org/wiki/链表)
156+
- [YouTube](https://www.youtube.com/watch?v=njTh_OwMljA&index=2&t=1s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)

src/data-structures/queue/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ _Read this in other languages:_
77
[_Français_](README.fr-FR.md),
88
[_Português_](README.pt-BR.md),
99
[_한국어_](README.ko-KR.md),
10-
[_Українська_](README.uk-UA.md)
10+
[_Українська_](README.uk-UA.md),
11+
[_繁體中文_](README.zh-TW.md)
1112

1213
In computer science, a **queue** is a particular kind of abstract data
1314
type or collection in which the entities in the collection are
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 佇列
2+
3+
_以其他語言閱讀:_
4+
[_English_](README.md),
5+
[_简体中文_](README.zh-CN.md),
6+
[_Русский_](README.ru-RU.md),
7+
[_日本語_](README.ja-JP.md),
8+
[_Français_](README.fr-FR.md),
9+
[_Português_](README.pt-BR.md),
10+
[_한국어_](README.ko-KR.md),
11+
[_Українська_](README.uk-UA.md)
12+
13+
在電腦科學中,**佇列**是一種特定的抽象資料型別或集合,其中集合中的元素按照順序排列,對集合的主要(或唯一)操作是將元素加入到尾端位置(稱為 enqueue,入列),以及從前端位置移除元素(稱為 dequeue,出列)。這使得佇列成為先進先出(FIFO, First-In-First-Out)的資料結構。在 FIFO 資料結構中,第一個被加入佇列的元素將會是第一個被移除的。這等同於一旦新元素被加入後,所有在其之前加入的元素都必須先被移除,新元素才能被移除。通常還會提供一個 peek 或 front 操作,用於回傳前端元素的值而不將其移出佇列。佇列是線性資料結構的一個範例,或更抽象地說,是一種循序集合。
14+
15+
先進先出(FIFO)佇列的示意圖
16+
17+
![Queue](./images/queue.jpeg)
18+
19+
*使用 [okso.app](https://okso.app) 製作*
20+
21+
## 參考資料
22+
23+
- [維基百科](https://zh.wikipedia.org/wiki/队列)
24+
- [YouTube](https://www.youtube.com/watch?v=wjI1WNcIntg&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8&index=3&)

src/data-structures/stack/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ _Read this in other languages:_
77
[_Français_](README.fr-FR.md),
88
[_Português_](README.pt-BR.md),
99
[_한국어_](README.ko-KR.md),
10-
[_Українська_](README.uk-UA.md)
10+
[_Українська_](README.uk-UA.md),
11+
[_繁體中文_](README.zh-TW.md)
1112

1213
In computer science, a **stack** is an abstract data type that serves
1314
as a collection of elements, with two principal operations:

0 commit comments

Comments
 (0)