data-structure-typed 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +311 -1687
  3. package/README_CN.md +509 -0
  4. package/SECURITY.md +962 -11
  5. package/SECURITY.zh-CN.md +966 -0
  6. package/SPECIFICATION.md +689 -30
  7. package/SPECIFICATION.zh-CN.md +715 -0
  8. package/SPONSOR.zh-CN.md +62 -0
  9. package/SPONSOR_POLISHED.md +62 -0
  10. package/benchmark/report.html +1 -1
  11. package/benchmark/report.json +215 -172
  12. package/dist/cjs/index.cjs +163 -0
  13. package/dist/cjs/index.cjs.map +1 -1
  14. package/dist/cjs-legacy/index.cjs +164 -0
  15. package/dist/cjs-legacy/index.cjs.map +1 -1
  16. package/dist/esm/index.mjs +163 -0
  17. package/dist/esm/index.mjs.map +1 -1
  18. package/dist/esm-legacy/index.mjs +164 -0
  19. package/dist/esm-legacy/index.mjs.map +1 -1
  20. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +96 -2
  21. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +103 -7
  22. package/dist/types/data-structures/binary-tree/bst.d.ts +156 -13
  23. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +84 -35
  24. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -2
  25. package/dist/types/data-structures/graph/directed-graph.d.ts +126 -1
  26. package/dist/types/data-structures/graph/undirected-graph.d.ts +160 -1
  27. package/dist/types/data-structures/hash/hash-map.d.ts +110 -27
  28. package/dist/types/data-structures/heap/heap.d.ts +107 -58
  29. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +72 -404
  30. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -5
  31. package/dist/types/data-structures/queue/deque.d.ts +95 -67
  32. package/dist/types/data-structures/queue/queue.d.ts +90 -34
  33. package/dist/types/data-structures/stack/stack.d.ts +58 -40
  34. package/dist/types/data-structures/trie/trie.d.ts +109 -47
  35. package/dist/types/interfaces/binary-tree.d.ts +1 -0
  36. package/dist/umd/data-structure-typed.js +164 -0
  37. package/dist/umd/data-structure-typed.js.map +1 -1
  38. package/dist/umd/data-structure-typed.min.js +3 -3
  39. package/dist/umd/data-structure-typed.min.js.map +1 -1
  40. package/package.json +3 -2
  41. package/src/data-structures/binary-tree/avl-tree.ts +96 -2
  42. package/src/data-structures/binary-tree/binary-tree.ts +117 -7
  43. package/src/data-structures/binary-tree/bst.ts +322 -13
  44. package/src/data-structures/binary-tree/red-black-tree.ts +84 -35
  45. package/src/data-structures/binary-tree/tree-multi-map.ts +2 -2
  46. package/src/data-structures/graph/directed-graph.ts +126 -1
  47. package/src/data-structures/graph/undirected-graph.ts +160 -1
  48. package/src/data-structures/hash/hash-map.ts +110 -27
  49. package/src/data-structures/heap/heap.ts +107 -58
  50. package/src/data-structures/linked-list/doubly-linked-list.ts +72 -404
  51. package/src/data-structures/linked-list/singly-linked-list.ts +121 -5
  52. package/src/data-structures/queue/deque.ts +95 -67
  53. package/src/data-structures/queue/queue.ts +90 -34
  54. package/src/data-structures/stack/stack.ts +58 -40
  55. package/src/data-structures/trie/trie.ts +109 -47
  56. package/src/interfaces/binary-tree.ts +2 -0
  57. package/test/performance/benchmark-runner.ts +14 -11
  58. package/test/performance/data-structures/binary-tree/avl-tree.test.ts +8 -8
  59. package/test/performance/data-structures/binary-tree/binary-tree-overall.test.ts +8 -8
  60. package/test/performance/data-structures/binary-tree/binary-tree.test.ts +6 -6
  61. package/test/performance/data-structures/binary-tree/bst.test.ts +5 -5
  62. package/test/performance/data-structures/binary-tree/red-black-tree.test.ts +10 -10
  63. package/test/performance/reportor.ts +2 -1
  64. package/test/performance/single-suite-runner.ts +7 -4
  65. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +117 -0
  66. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +166 -0
  67. package/test/unit/data-structures/binary-tree/bst.test.ts +766 -8
  68. package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +89 -37
  69. package/test/unit/data-structures/graph/directed-graph.test.ts +133 -0
  70. package/test/unit/data-structures/graph/undirected-graph.test.ts +167 -0
  71. package/test/unit/data-structures/hash/hash-map.test.ts +149 -3
  72. package/test/unit/data-structures/heap/heap.test.ts +182 -47
  73. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +118 -14
  74. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +121 -0
  75. package/test/unit/data-structures/queue/deque.test.ts +98 -67
  76. package/test/unit/data-structures/queue/queue.test.ts +85 -51
  77. package/test/unit/data-structures/stack/stack.test.ts +142 -33
  78. package/test/unit/data-structures/trie/trie.test.ts +135 -39
  79. package/tsup.leetcode.config.js +99 -0
  80. package/typedoc.json +2 -1
  81. package/POSTS_zh-CN.md +0 -54
  82. package/README_zh-CN.md +0 -1208
  83. package/SPECIFICATION_zh-CN.md +0 -81
package/README_CN.md ADDED
@@ -0,0 +1,509 @@
1
+ # README:data-structure-typed 库
2
+
3
+ 一个包含生产级实现的完整 TypeScript 数据结构库。
4
+
5
+ **📚 [快速开始](#-快速开始30秒) • [完整文档](./docs/CONCEPTS_CN.md) • [API 参考](./docs/REFERENCE_CN.md) • [示例](./docs/GUIDES_CN.md)**
6
+
7
+ ---
8
+
9
+ ## 目录
10
+
11
+ 1. [谁应该使用这个库?](#-谁应该使用这个库)
12
+ 2. [为什么不直接用 Array 或 Map?](#-为什么不直接用-array-或-map)
13
+ 3. [关键特性](#-关键特性)
14
+ 4. [安装](#-安装)
15
+ 5. [快速开始](#-快速开始30秒)
16
+ 6. [可用的数据结构](#-可用的数据结构)
17
+ 7. [文档](#-文档)
18
+
19
+ ---
20
+
21
+ ## 🎯 谁应该使用这个库?
22
+
23
+ **如果您在 TypeScript 中构建排序集合、调度队列或排序数据结构,**
24
+ **可以考虑使用 `data-structure-typed` 而不是手工编写的 Array 或 Map。**
25
+
26
+ ### 完美应用场景:
27
+
28
+ - **排行榜和排名系统** — 无需反复排序就能高效维护前 K 个元素
29
+ - **任务调度系统** — 优先队列、有序执行、基于时间的操作
30
+ - **实时仪表板** — Grafana 风格的工作负载和即时查询
31
+ - **时间序列数据** — 有序插入 + 快速范围查询
32
+ - **搜索和自动完成** — 大规模前缀匹配
33
+ - **图论问题** — 路径查找、环检测、拓扑排序
34
+
35
+ ---
36
+
37
+ ## ⚡ 为什么不直接用 Array 或 Map?
38
+
39
+ | 使用场景 | Array | Map | data-structure-typed |
40
+ |---------|-------|-----|:---:|
41
+ | **排序查询** | ❌ O(n) | ❌ 无序 | ✅ **O(log n)** |
42
+ | **指定位置插入** | ❌ O(n) shift | ❌ 无位置概念 | ✅ **O(log n)** |
43
+ | **排行榜前 K** | ❌ 重新排序 O(n log n) | ❌ 需手动排序 | ✅ **即时** |
44
+ | **从前面移除** | ❌ O(n) | ❌ 无出队操作 | ✅ **O(1)** |
45
+ | **前缀搜索** | ❌ O(n*m) | ❌ 不适用 | ✅ **O(m + k)** |
46
+ | **熟悉的 API** | ✅ 是 | ✅ 是 | ✅ **相同** |
47
+
48
+ ### 真实场景的痛点
49
+
50
+ ```javascript
51
+ // ❌ 不使用 data-structure-typed
52
+ const queue = [1, 2, 3, ..., 100000];
53
+ for (let i = 0; i < 100000; i++) {
54
+ queue.shift(); // O(n) - 重新索引每个元素!
55
+ }
56
+ // 耗时:2829ms ❌
57
+
58
+ // ✅ 使用 data-structure-typed (Deque)
59
+ const deque = new Deque([1, 2, 3, ..., 100000]);
60
+ for (let i = 0; i < 100000; i++) {
61
+ deque.shift(); // O(1) - 只是移动指针
62
+ }
63
+ // 耗时:5.83ms ✅
64
+ // **快 484 倍!**
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 🚀 性能(简版)
70
+
71
+ - **热路径性能提升 10-40%**
72
+ - Array.sort() O(n log n) → TreeSet O(log n) 插入
73
+ - 重复 Array.shift() O(n) → Queue O(1)
74
+ - 手动索引追踪 → RB-Tree 自动平衡
75
+
76
+ - **针对 V8 JIT 优化**(Node.js 18+,现代浏览器)
77
+
78
+ - **可树摇动的** ESM / CJS / 传统版本
79
+
80
+ 📊 [完整基准测试 →](./docs/PERFORMANCE_CN.md)
81
+
82
+ ---
83
+
84
+ ## ✨ 关键特性
85
+
86
+ ### 🏠 统一的 API
87
+
88
+ 不需要学习新 API。只需在任何地方使用 `push`、`pop`、`map`、`filter` 和 `reduce`。
89
+
90
+ ```javascript
91
+ // 所有线性结构使用相同的 4 个方法
92
+ const deque = new Deque([1, 2, 3]);
93
+ const queue = new Queue([1, 2, 3]);
94
+ const stack = new Stack([1, 2, 3]);
95
+
96
+ // 它们都支持:
97
+ structure.push(item); // 添加到末尾
98
+ structure.pop(); // 从末尾移除
99
+ structure.shift(); // 从开头移除
100
+ structure.unshift(item); // 添加到开头
101
+ ```
102
+
103
+ ### 🛡️ 类型安全
104
+
105
+ 开箱即用的完整泛型和严格 TypeScript 支持。
106
+
107
+ ```typescript
108
+ const tree = new RedBlackTree<number, string>();
109
+ tree.set(1, 'Alice');
110
+ tree.set(2, 'Bob');
111
+
112
+ // 类型安全的访问
113
+ const value = tree.get(1); // 类型:string | undefined
114
+ ```
115
+
116
+ ### ✨ 零摩擦
117
+
118
+ 到处都能用。展开它 `[...]`、循环它 `for..of`、立即转换它。
119
+
120
+ ```javascript
121
+ // 所有数据结构都支持迭代器协议
122
+ const tree = new RedBlackTree([5, 2, 8]);
123
+ const sorted = [...tree]; // 展开操作符
124
+ for (const item of tree) {
125
+ } // for...of 循环
126
+ const set = new Set(tree); // Set 构造器
127
+ ```
128
+
129
+ ---
130
+
131
+ ## 📥 安装
132
+
133
+ ```bash
134
+ pnpm add data-structure-typed
135
+ ```
136
+
137
+ ```bash
138
+ npm i data-structure-typed --save
139
+ ```
140
+
141
+ ```bash
142
+ yarn add data-structure-typed
143
+ ```
144
+
145
+ ### 独立包
146
+
147
+ 只使用需要的部分:
148
+
149
+ ```bash
150
+ pnpm add heap-typed deque-typed red-black-tree-typed
151
+ ```
152
+
153
+ ---
154
+
155
+ ## 💡 何时考虑使用这个库?
156
+
157
+ ✅ **当您需要:**
158
+
159
+ - 无需重复排序就能进行前 K 元素查询
160
+ - 同时具有插入顺序和查询性能
161
+ - 具有快速位置访问的优先队列
162
+ - 具有范围查询的时间序列数据
163
+ - Red-Black Tree / Heap 性能而无需学习新 API
164
+
165
+ ✅ **当您的代码中有:**
166
+
167
+ - `array.sort()` 在热路径中(请求处理程序、循环)
168
+ - 插入后的手动索引追踪
169
+ - 大列表上的 `Array.shift()`(队列)
170
+ - 跨文件重复的自定义排序逻辑
171
+ - 需要有序的 Map
172
+
173
+ ---
174
+
175
+ ## 🚀 快速开始:30 秒
176
+
177
+ ### 排行榜(排序集合)
178
+
179
+ ```typescript
180
+ import { RedBlackTree } from 'data-structure-typed';
181
+
182
+ const leaderboard = new RedBlackTree([
183
+ [100, 'Alice'],
184
+ [85, 'Bob'],
185
+ [92, 'Charlie']
186
+ ]);
187
+
188
+ // 获取排序分数(自动维护!)
189
+ for (const [score, player] of leaderboard) {
190
+ console.log(`${player}: ${score}`);
191
+ }
192
+ // 输出:
193
+ // Alice: 100
194
+ // Charlie: 92
195
+ // Bob: 85
196
+
197
+ // 更新分数
198
+ leaderboard.delete(85);
199
+ leaderboard.set(95, 'Bob'); // O(log n)
200
+
201
+ // 查询前玩家
202
+ const topPlayers = [...leaderboard.values()].reverse().slice(0, 3);
203
+ ```
204
+
205
+ ### 任务队列(调度)
206
+
207
+ ```typescript
208
+ import { MaxPriorityQueue } from 'data-structure-typed';
209
+
210
+ const taskQueue = new MaxPriorityQueue([], {
211
+ comparator: (a, b) => b.priority - a.priority
212
+ });
213
+
214
+ taskQueue.add({ priority: 5, task: 'Email' });
215
+ taskQueue.add({ priority: 9, task: 'Alert' }); // 即时优先级处理
216
+
217
+ const nextTask = taskQueue.poll(); // { priority: 9, task: 'Alert' }
218
+ ```
219
+
220
+ ### 快速队列(FIFO)
221
+
222
+ ```typescript
223
+ import { Deque } from 'data-structure-typed';
224
+
225
+ const queue = new Deque([1, 2, 3, 4, 5]);
226
+ queue.shift(); // 从前面移除:O(1) 不是 O(n)
227
+ queue.push(6); // 添加到后面:O(1)
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 📊 可用的数据结构
233
+
234
+ | 结构 | 使用场景 | 时间复杂度 | NPM |
235
+ |------|---------|----------|-----|
236
+ | **RedBlackTree** | 排序集合、范围查询 | O(log n) | [npm](https://www.npmjs.com/package/red-black-tree-typed) |
237
+ | **Heap / PriorityQueue** | 任务调度、前 K 元素 | O(log n) | [npm](https://www.npmjs.com/package/heap-typed) |
238
+ | **Deque** | 快速首尾操作 | O(1) | [npm](https://www.npmjs.com/package/deque-typed) |
239
+ | **Trie** | 自动完成、前缀搜索 | O(m+k) | [npm](https://www.npmjs.com/package/trie-typed) |
240
+ | **DirectedGraph** | 路径查找、DAG 算法 | O(V+E) | [npm](https://www.npmjs.com/package/directed-graph-typed) |
241
+ | **Stack** | 撤销/重做、表达式解析 | O(1) | [npm](https://www.npmjs.com/package/stack-typed) |
242
+ | **LinkedList** | 动态大小、无索引偏移 | O(1)* | [npm](https://www.npmjs.com/package/linked-list-typed) |
243
+ | **AVLTree** | 比 RB-Tree 更严格的平衡 | O(log n) | [npm](https://www.npmjs.com/package/avl-tree-typed) |
244
+
245
+ 👉 [查看所有 20+ 结构 →](./docs/REFERENCE_CN.md)
246
+
247
+ ---
248
+
249
+ ## 📖 文档
250
+
251
+ ### 不同使用场景
252
+
253
+ | 您的目标 | 从这里开始 | 后续步骤 |
254
+ |---------|----------|---------|
255
+ | **学习概念** | [CONCEPTS_CN.md](./docs/CONCEPTS_CN.md) | [GUIDES_CN.md](./docs/GUIDES_CN.md) |
256
+ | **在项目中使用** | [GUIDES_CN.md](./docs/GUIDES_CN.md) | [REFERENCE_CN.md](./docs/REFERENCE_CN.md) |
257
+ | **查询 API** | [REFERENCE_CN.md](./docs/REFERENCE_CN.md) | [PERFORMANCE_CN.md](./docs/PERFORMANCE_CN.md) |
258
+ | **性能问题** | [PERFORMANCE_CN.md](./docs/PERFORMANCE_CN.md) | [ARCHITECTURE_CN.md](./ARCHITECTURE_CN.md) |
259
+ | **框架集成** | [INTEGRATIONS_CN.md](./docs/INTEGRATIONS_CN.md) | [GUIDES_CN.md](./docs/GUIDES_CN.md) |
260
+ | **理解设计** | [ARCHITECTURE_CN.md](./ARCHITECTURE_CN.md) | [CONCEPTS_CN.md](./docs/CONCEPTS_CN.md) |
261
+
262
+ ### 文档文件
263
+
264
+ 1. **[CONCEPTS_CN.md](./docs/CONCEPTS_CN.md)** - 核心基础和理论
265
+ - 三大核心概念(BST、平衡树、堆)
266
+ - 13 个易于理解的解释
267
+ - 迭代器协议设计
268
+ - 5 个与原生 JavaScript 的对比
269
+ - 完整的决策指南
270
+
271
+ 2. **[REFERENCE_CN.md](./docs/REFERENCE_CN.md)** - 完整 API 和数据结构
272
+ - 快速参考表
273
+ - 所有 20+ 结构及示例
274
+ - CRUD 操作
275
+ - 常见方法
276
+ - TypeScript 支持
277
+
278
+ 3. **[ARCHITECTURE_CN.md](./ARCHITECTURE_CN.md)** - 设计和实现
279
+ - 设计理念和原则
280
+ - 3 个解决的痛点
281
+ - 为什么 Deque 快 484 倍
282
+ - 迭代器协议设计
283
+ - 自平衡策略
284
+ - V8 JIT 优化
285
+
286
+ 4. **[PERFORMANCE_CN.md](./docs/PERFORMANCE_CN.md)** - 基准和对比
287
+ - 性能摘要
288
+ - 3 个真实场景
289
+ - 详细基准
290
+ - 何时使用什么
291
+ - 优化技巧
292
+
293
+ 5. **[GUIDES_CN.md](./docs/GUIDES_CN.md)** - 真实示例
294
+ - 4 个设计模式
295
+ - 5 个生产代码示例
296
+ - 常见错误
297
+ - 最佳实践
298
+
299
+ 6. **[INTEGRATIONS_CN.md](./docs/INTEGRATIONS_CN.md)** - 框架集成
300
+ - React 集成(状态管理、排行榜)
301
+ - Express 集成(LRU 缓存、速率限制)
302
+ - Nest.js 集成(排名服务、任务队列)
303
+ - TypeScript 配置
304
+
305
+ ---
306
+
307
+ ## 💻 真实示例
308
+
309
+ ### LRU 缓存
310
+
311
+ ```typescript
312
+ class LRUCache<K, V> {
313
+ private cache = new Map<K, V>();
314
+ private order = new DoublyLinkedList<K>();
315
+
316
+ get(key: K): V | null {
317
+ if (!this.cache.has(key)) return null;
318
+ // 移动到末尾(最近使用)
319
+ // 使用 O(1) 操作高效处理
320
+ return this.cache.get(key)!;
321
+ }
322
+ }
323
+ ```
324
+
325
+ ### 排行榜
326
+
327
+ ```typescript
328
+ class Leaderboard {
329
+ private scores = new RedBlackTree<number, Player>(
330
+ (a, b) => b - a // 降序
331
+ );
332
+
333
+ getTopN(n: number): Player[] {
334
+ return [...this.scores.values()].slice(0, n);
335
+ }
336
+ }
337
+ ```
338
+
339
+ ### 消息队列
340
+
341
+ ```typescript
342
+ class MessageQueue {
343
+ private urgent = new Deque<Message>();
344
+ private normal = new Deque<Message>();
345
+
346
+ dequeue(): Message | null {
347
+ return this.urgent.shift() || this.normal.shift();
348
+ }
349
+ }
350
+ ```
351
+
352
+ 👉 [更多示例请见 GUIDES_CN.md](./docs/GUIDES_CN.md)
353
+
354
+ ---
355
+
356
+ ## 🎯 按行业的使用场景
357
+
358
+ ### 📊 金融
359
+
360
+ - 价格排序的订单簿
361
+ - 实时投资组合排名
362
+ - 期权链排序
363
+
364
+ ### 🎮 游戏
365
+
366
+ - 玩家排行榜
367
+ - 敌人优先级队列
368
+ - 游戏事件调度
369
+
370
+ ### 📱 社交媒体
371
+
372
+ - 趋势帖子(前 K)
373
+ - 信息流排序
374
+ - 通知调度
375
+
376
+ ### 🏥 医疗保健
377
+
378
+ - 患者优先级队列
379
+ - 约诊调度
380
+ - 医疗记录组织
381
+
382
+ ### 🛒 电子商务
383
+
384
+ - 产品价格范围
385
+ - 库存管理
386
+ - 订单调度
387
+
388
+ ---
389
+
390
+ ## ✨ 开发者为什么喜欢这个库
391
+
392
+ | 痛点 | 解决方案 |
393
+ |-----|---------|
394
+ | 重复排序拖累代码速度 | TreeSet 自动维护顺序 |
395
+ | 循环中 Array.shift 超时 | Deque O(1) shift 而不是 O(n) |
396
+ | 学习不同的 API | 所有结构使用 push/pop/shift/unshift |
397
+ | 类型安全噩梦 | 完整的 TypeScript 泛型支持 |
398
+ | 浏览器兼容性问题 | 在任何地方工作:Node、浏览器、CDN |
399
+
400
+ ---
401
+
402
+ ## 📦 您将获得什么
403
+
404
+ ✅ **6 个核心文档文件**(2500+ 行)
405
+ ✅ **20+ 个数据结构**(生产级)
406
+ ✅ **50+ 个代码示例**(真实模式)
407
+ ✅ **完整 TypeScript 支持**(严格类型)
408
+ ✅ **性能基准**(484 倍加速)
409
+ ✅ **框架集成**(React、Express、Nest.js)
410
+
411
+ ---
412
+
413
+ ## 🚀 开始使用
414
+
415
+ ### 步骤 1:安装
416
+
417
+ ```bash
418
+ npm i data-structure-typed
419
+ ```
420
+
421
+ ### 步骤 2:导入
422
+
423
+ ```typescript
424
+ import { RedBlackTree, Deque, MaxPriorityQueue } from 'data-structure-typed';
425
+ ```
426
+
427
+ ### 步骤 3:使用
428
+
429
+ ```typescript
430
+ const tree = new RedBlackTree([5, 2, 8]);
431
+ console.log([...tree]); // [2, 5, 8] - 自动排序!
432
+ ```
433
+
434
+ ### 步骤 4:了解更多
435
+
436
+ 👉 查看 [CONCEPTS_CN.md](./docs/CONCEPTS_CN.md) 了解核心概念
437
+ 👉 查看 [GUIDES_CN.md](./docs/GUIDES_CN.md) 获取生产示例
438
+ 👉 阅读 [REFERENCE_CN.md](./docs/REFERENCE_CN.md) 获取完整 API
439
+
440
+ ---
441
+
442
+ ## 📊 对比表
443
+
444
+ ```
445
+ 需要频繁的头尾操作?
446
+ → Deque (O(1) shift/unshift/push/pop)
447
+
448
+ 需要排序 + 快速查询?
449
+ → RedBlackTree (O(log n) 保证)
450
+
451
+ 需要最高/最低优先级?
452
+ → Heap/PriorityQueue (O(log n) add/remove)
453
+
454
+ 需要前缀/文本匹配?
455
+ → Trie (O(m+k) 其中 m=前缀)
456
+
457
+ 需要图操作?
458
+ → DirectedGraph/UndirectedGraph
459
+
460
+ 否则?
461
+ → 使用 Array(最简单的情况)
462
+ ```
463
+
464
+ ---
465
+
466
+ ## 🤝 贡献
467
+
468
+ 发现 bug?有建议?[开启 issue](https://github.com/zrwusa/data-structure-typed/issues)
469
+
470
+ ---
471
+
472
+ ## 📄 许可证
473
+
474
+ MIT
475
+
476
+ ---
477
+
478
+ ## 📚 完整文档结构
479
+
480
+ ```
481
+ docs/
482
+ ├── README_CN.md (本文件)
483
+ ├── CONCEPTS_CN.md (理论和基础)
484
+ ├── REFERENCE_CN.md (API 文档)
485
+ ├── ARCHITECTURE_CN.md (设计原则)
486
+ ├── PERFORMANCE_CN.md (基准测试)
487
+ ├── GUIDES_CN.md (真实示例)
488
+ └── INTEGRATIONS_CN.md (框架指南)
489
+ ```
490
+
491
+ ---
492
+
493
+ ## 🎓 了解更多
494
+
495
+ **刚入门?** → [快速开始](#-快速开始30秒)
496
+
497
+ **需要概念?** → [CONCEPTS_CN.md](./docs/CONCEPTS_CN.md)
498
+
499
+ **想要构建?** → [GUIDES_CN.md](./docs/GUIDES_CN.md)
500
+
501
+ **需要 API?** → [REFERENCE_CN.md](./docs/REFERENCE_CN.md)
502
+
503
+ **好奇性能?** → [PERFORMANCE_CN.md](./docs/PERFORMANCE_CN.md)
504
+
505
+ **框架问题?** → [INTEGRATIONS_CN.md](./docs/INTEGRATIONS_CN.md)
506
+
507
+ ---
508
+
509
+ **准备好提升您的 TypeScript 数据结构了吗?[现在开始 →](#-快速开始30秒)**