Skip to content

Commit 982520c

Browse files
committed
fix(translator): use Taiwan CS terminology instead of Mainland China
- Add Taiwan vs Mainland China terminology comparison table - Key differences: 指標(TW) vs 指針(CN), 原地 vs 就地, 列舉 vs 枚舉 - Fix existing zh-TW file with correct Taiwan terms - Make prompt generalizable for future translations
1 parent f6aeb15 commit 982520c

File tree

5 files changed

+380
-167
lines changed

5 files changed

+380
-167
lines changed

tools/ai-markmap-agent/outputs/versions/v1/neetcode_ontology_agent_evolved_zh-TW.html

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -59,42 +59,41 @@
5959
document.addEventListener('DOMContentLoaded', function() {
6060
const { Transformer, Markmap } = window.markmap;
6161
const transformer = new Transformer();
62-
const markdown = `\`\`\`markdown
63-
---
64-
title: LeetCode Patterns Knowledge Graph (33 Problems) — API Kernels → Patterns → Problems 🎯
62+
const markdown = `---
63+
title: LeetCode Patterns 知識圖譜 (33 題) — API 核心 → 模式 → 問題 🎯
6564
markmap:
6665
colorFreezeLevel: 2
6766
maxWidth: 300
6867
---
6968
70-
## 🎯 如何使用這個心智圖(快速)
71-
- **從上到下閱讀**:*API Kernel* → *Pattern* → *Problems*(連結
72-
- **練習循環**:實作範本 → 解決 2–3 個問題 → 重構為可重用的 \`solve(pattern_state_machine)\` 心智模型
69+
## 🎯 如何使用這個思維導圖(快速)
70+
- **自上而下閱讀**:*API 核心* → *模式* → *問題*(鏈接
71+
- **練習循環**:實作模板 → 解決 2–3 個問題 → 重構為可重用的 \`solve(pattern_state_machine)\` 心智模型
7372
- **進度追蹤**
74-
- [ ] 先做所有 **簡單**
75-
- [ ] 然後是 **中等** 變體
76-
- [ ] 最後是 **困難** 的「邊界情況放大器
73+
- [ ] 先做所有 **簡單**
74+
- [ ] 然後 **中等** 變體
75+
- [ ] 最後 **困難** 邊界情況放大器
7776
7877
---
7978
8079
## 🧠 API 核心(“引擎”)
8180
### SubstringSlidingWindow — *一維窗口狀態機*
82-
- ==核心不變性==:窗口 \`[L,R]\` 透過 **向右擴展** + **向左收縮** 保持有效
83-
- 複雜度:通常是 $O(n)$ 時間,$O(\\Sigma)$ 空間(字母表 / 不同鍵)
81+
- ==核心不變性==:窗口 \`[L,R]\` 通過 **向右擴展** + **向左收縮** 保持有效
82+
- 複雜度:通常 $O(n)$ 時間,$O(\\Sigma)$ 空間(字母表 / 不同鍵)
8483
8584
<!-- markmap: fold -->
86-
#### 模式速查表(來自文件
85+
#### 模式速查表(來自文檔
8786
| 問題 | 不變性 | 狀態 | 窗口大小 | 目標 |
8887
|---------|-----------|-------|-------------|------|
8988
| [LeetCode 3 - Longest Substring Without Repeating Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0003_longest_substring_without_repeating_characters.py) | 全部唯一 | 最後索引映射 | 可變 | 最大 |
90-
| [LeetCode 340 - Longest Substring with At Most K Distinct Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0340_longest_substring_with_at_most_k_distinct.py) | ≤K 不同 | 頻率映射 | 可變 | 最大 |
91-
| [LeetCode 76 - Minimum Window Substring](https://github.com/lufftw/neetcode/blob/main/solutions/0076_minimum_window_substring.py) | 覆蓋 \`t\` | 需要/擁有 | 可變 | 最小 |
89+
| [LeetCode 340 - Longest Substring with At Most K Distinct Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0340_longest_substring_with_at_most_k_distinct.py) | ≤K 種不同 | 頻率映射 | 可變 | 最大 |
90+
| [LeetCode 76 - Minimum Window Substring](https://github.com/lufftw/neetcode/blob/main/solutions/0076_minimum_window_substring.py) | 覆蓋 \`t\` | 需要/ | 可變 | 最小 |
9291
| [LeetCode 567 - Permutation in String](https://github.com/lufftw/neetcode/blob/main/solutions/0567_permutation_in_string.py) | 精確頻率匹配 | 頻率 + 匹配 | 固定 | 存在 |
9392
| [LeetCode 438 - Find All Anagrams in a String](https://github.com/lufftw/neetcode/blob/main/solutions/0438_find_all_anagrams_in_a_string.py) | 精確頻率匹配 | 頻率 + 匹配 | 固定 | 全部 |
9493
| [LeetCode 209 - Minimum Size Subarray Sum](https://github.com/lufftw/neetcode/blob/main/solutions/0209_minimum_size_subarray_sum.py) | 和 ≥ 目標 | 整數和 | 可變 | 最小 |
9594
9695
#### 模式
97-
- **sliding_window_unique** *(最大化,“向左跳”優化)*
96+
- **sliding_window_unique** *(最大化,“跳左”優化)*
9897
- 🎯 問題
9998
- [ ] [LeetCode 3 - Longest Substring Without Repeating Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0003_longest_substring_without_repeating_characters.py)
10099
- 關鍵狀態:\`last_seen[char]\` → \`L = max(L, last_seen[c]+1)\`
@@ -115,13 +114,13 @@
115114
---
116115
117116
### TwoPointersTraversal — *序列上的指針編排*
118-
- ==核心不變性==:指針確定性移動;已處理區域是“安全”的
119-
- 複雜度:通常是 $O(n)$ 時間,$O(1)$ 空間(排序步驟除外
117+
- ==核心不變性==:指針確定性移動;處理過的區域是“安全的”
118+
- 複雜度:通常 $O(n)$ 時間,$O(1)$ 空間(除了排序步驟
120119
121-
#### 模式比較(來自文件
120+
#### 模式比較(來自文檔
122121
| 模式 | 指針初始化 | 移動 | 終止 | 時間 | 空間 | 關鍵用例 |
123122
|---------|--------------|----------|-------------|------|-------|--------------|
124-
| 相反 | \`0, n-1\` | 向中心 | \`L>=R\` | $O(n)$ | $O(1)$ | 已排序對 / 回文 / 最大化 |
123+
| 相反 | \`0, n-1\` | 向中心 | \`L>=R\` | $O(n)$ | $O(1)$ | 排序對 / 回文 / 最大化 |
125124
| 同方向 | \`write, read\` | 向前 | \`read==n\` | $O(n)$ | $O(1)$ | 就地修改 |
126125
| 快–慢 | \`slow, fast\` | 1× / 2× | 相遇或空 | $O(n)$ | $O(1)$ | 循環 / 中點 |
127126
| 去重枚舉 | \`i\` + \`L,R\` | 嵌套 | 完成 | $O(n^2)$ | $O(1)$ | 3Sum/4Sum |
@@ -130,12 +129,12 @@
130129
- **two_pointer_opposite_maximize**
131130
- 🎯 問題
132131
- [ ] [LeetCode 11 - Container With Most Water](https://github.com/lufftw/neetcode/blob/main/solutions/0011_container_with_most_water.py)
133-
- 洞察:移動 **較短** 高度的指針
132+
- 洞察:移動**較短**高度的指針
134133
- **two_pointer_three_sum** *(去重枚舉)*
135134
- 🎯 問題
136135
- [ ] [LeetCode 15 - 3Sum](https://github.com/lufftw/neetcode/blob/main/solutions/0015_3sum.py)
137136
- [ ] [LeetCode 16 - 3Sum Closest](https://github.com/lufftw/neetcode/blob/main/solutions/0016_3sum_closest.py)
138-
- 要求:先排序 ($O(n\\log n)$),然後用去重掃描
137+
- 要求:先排序 ($O(n\\log n)$),然後掃描去重
139138
- **two_pointer_opposite_palindrome**
140139
- 🎯 問題
141140
- [ ] [LeetCode 125 - Valid Palindrome](https://github.com/lufftw/neetcode/blob/main/solutions/0125_valid_palindrome.py)
@@ -181,7 +180,7 @@
181180
---
182181
183182
### MergeSortedSequences — *合併兩個已排序序列*
184-
- ==核心不變性==:輸出前綴是完全排序的
183+
- ==核心不變性==:輸出前綴完全排序
185184
- 模式
186185
- **merge_two_sorted_lists**
187186
- [ ] [LeetCode 21 - Merge Two Sorted Lists](https://github.com/lufftw/neetcode/blob/main/solutions/0021_merge_two_sorted_lists.py)
@@ -193,7 +192,7 @@
193192
---
194193
195194
### KWayMerge — *合併 K 個已排序序列*
196-
- 兩個主要實現
195+
- 兩種主要實現
197196
- **merge_k_sorted_heap** → $O(N\\log k)$ 時間,$O(k)$ 堆
198197
- **merge_k_sorted_divide** → $O(N\\log k)$ 時間,有時常數較小
199198
- 🎯 問題
@@ -202,7 +201,7 @@
202201
203202
---
204203
205-
### HeapTopK — *在流更新中保持最佳 K*
204+
### HeapTopK — *在流式更新中保持最佳 K*
206205
- 模式
207206
- **heap_kth_element**
208207
- [ ] [LeetCode 215 - Kth Largest Element in an Array](https://github.com/lufftw/neetcode/blob/main/solutions/0215_kth_largest_element_in_an_array.py)
@@ -213,12 +212,12 @@
213212
- 模式
214213
- **linked_list_k_group_reversal**
215214
- [ ] [LeetCode 25 - Reverse Nodes in k-Group](https://github.com/lufftw/neetcode/blob/main/solutions/0025_reverse_nodes_in_k_group.py)
216-
- 也包括核心鏈表算術
215+
- 也包括核心鏈表運算
217216
- [ ] [LeetCode 2 - Add Two Numbers](https://github.com/lufftw/neetcode/blob/main/solutions/0002_add_two_numbers.py)
218217
219218
---
220219
221-
### BacktrackingExploration — *帶剪枝的搜索樹*
220+
### BacktrackingExploration — *帶修剪的搜索樹*
222221
- 模式
223222
- **backtracking_n_queens**
224223
- [ ] [LeetCode 51 - N-Queens](https://github.com/lufftw/neetcode/blob/main/solutions/0051_n_queens.py)
@@ -233,7 +232,7 @@
233232
234233
---
235234
236-
## 🧭 路線圖切片(接下來要做什麼
235+
## 🧭 路線圖切片(下一步要做什麼
237236
### 滑動窗口精通 📚
238237
- [ ] [LeetCode 3 - Longest Substring Without Repeating Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0003_longest_substring_without_repeating_characters.py)
239238
- [ ] [LeetCode 340 - Longest Substring with At Most K Distinct Characters](https://github.com/lufftw/neetcode/blob/main/solutions/0340_longest_substring_with_at_most_k_distinct.py)
@@ -260,18 +259,18 @@
260259
261260
---
262261
263-
## 🧩 “同一問題,不同視角” (遷移學習)
264-
- **選擇**:[LeetCode 215 - Kth Largest Element in an Array](https://github.com/lufftw/neetcode/blob/main/solutions/0215_kth_largest_element_in_an_array.py)
262+
## 🧩 “相同問題,不同視角”(遷移學習)
263+
- **選擇**: [LeetCode 215 - Kth Largest Element in an Array](https://github.com/lufftw/neetcode/blob/main/solutions/0215_kth_largest_element_in_an_array.py)
265264
- 選項 A:\`quickselect_partition\`(期望 $O(n)$)
266-
- 選項 B:\`heap_kth_element\`($O(n\\log k)$,流處理友好
265+
- 選項 B:\`heap_kth_element\`($O(n\\log k)$,流式友好
267266
- **合併**:
268267
- 2 路:[LeetCode 21 - Merge Two Sorted Lists](https://github.com/lufftw/neetcode/blob/main/solutions/0021_merge_two_sorted_lists.py), [LeetCode 88 - Merge Sorted Array](https://github.com/lufftw/neetcode/blob/main/solutions/0088_merge_sorted_array.py)
269268
- K 路:[LeetCode 23 - Merge k Sorted Lists](https://github.com/lufftw/neetcode/blob/main/solutions/0023_merge_k_sorted_lists.py)
270269
- “邊界 + 合併思維”:[LeetCode 4 - Median of Two Sorted Arrays](https://github.com/lufftw/neetcode/blob/main/solutions/0004_median_of_two_sorted_arrays.py)
271270
272271
---
273272
274-
## 🧱 最小可重用範本(心智 API)
273+
## 🧱 最小可重用模板(心智 API)
275274
\`\`\`python
276275
# 滑動窗口(可變,最大化)
277276
def max_window(seq):
@@ -294,9 +293,7 @@
294293
else:
295294
R -= 1
296295
\`\`\`
297-
298-
---
299-
\`\`\``;
296+
`;
300297
const { root } = transformer.transform(markdown);
301298
const svg = d3.select('.markmap').append('svg');
302299
const mm = Markmap.create(svg.node(), { color: (node) => node.payload?.color || '#f59e0b' }, root);

0 commit comments

Comments
 (0)