data-structure-typed 1.51.2 → 1.51.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.
- package/CHANGELOG.md +1 -1
- package/README.md +195 -172
- package/package.json +92 -69
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
9
9
|
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
|
|
10
10
|
|
|
11
|
-
## [v1.51.
|
|
11
|
+
## [v1.51.3](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
|
|
12
12
|
|
|
13
13
|
### Changes
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -13,6 +13,35 @@
|
|
|
13
13
|
|
|
14
14
|
[//]: # (<p><a href="https://github.com/zrwusa/data-structure-typed/blob/main/README.md">English</a> | <a href="https://github.com/zrwusa/data-structure-typed/blob/main/README_zh-CN.md">简体中文</a></p>)
|
|
15
15
|
|
|
16
|
+
|
|
17
|
+
## Installation and Usage
|
|
18
|
+
|
|
19
|
+
### npm
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm i data-structure-typed --save
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### yarn
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add data-structure-typed
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import {
|
|
33
|
+
Heap, Graph, Queue, Deque, PriorityQueue, BST, Trie, DoublyLinkedList,
|
|
34
|
+
AVLTree, SinglyLinkedList, DirectedGraph, RedBlackTree, TreeMultiMap,
|
|
35
|
+
DirectedVertex, Stack, AVLTreeNode
|
|
36
|
+
} from 'data-structure-typed';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you only want to use a specific data structure independently, you can install it separately, for example, by running
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm i heap-typed --save
|
|
43
|
+
```
|
|
44
|
+
|
|
16
45
|
## Why
|
|
17
46
|
|
|
18
47
|
Do you envy C++ with [STL]() (std::), Python with [collections](), and Java with [java.util]() ? Well, no need to envy
|
|
@@ -28,12 +57,6 @@ anymore! JavaScript and TypeScript now have [data-structure-typed]().**`Benchmar
|
|
|
28
57
|
|
|
29
58
|
[//]: # ()
|
|
30
59
|
|
|
31
|
-
### Data structures available
|
|
32
|
-
|
|
33
|
-
We provide data structures that are not available in JS/TS
|
|
34
|
-
Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, Directed Graph, Undirected Graph, BST, AVL Tree, Priority
|
|
35
|
-
Queue, Queue, Tree Multiset.
|
|
36
|
-
|
|
37
60
|
### Performance
|
|
38
61
|
|
|
39
62
|
Performance surpasses that of native JS/TS
|
|
@@ -143,27 +166,174 @@ In [java.utils](), you need to memorize a table for all sequential data structur
|
|
|
143
166
|
|
|
144
167
|
whereas in our [data-structure-typed](), you **only** need to remember four methods: `push`, `pop`, `shift`, and `unshift` for all sequential data structures(Queue, Deque, DoublyLinkedList, SinglyLinkedList and Array).
|
|
145
168
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
### npm
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
npm i data-structure-typed --save
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### yarn
|
|
169
|
+
### Data structures available
|
|
155
170
|
|
|
156
|
-
|
|
157
|
-
yarn add data-structure-typed
|
|
158
|
-
```
|
|
171
|
+
We provide data structures that are not available in JS/TS
|
|
159
172
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
<table style="display: table; width:100%; table-layout: fixed;">
|
|
174
|
+
<thead>
|
|
175
|
+
<tr>
|
|
176
|
+
<th>Data Structure</th>
|
|
177
|
+
<th>Unit Test</th>
|
|
178
|
+
<th>Perf Test</th>
|
|
179
|
+
<th>API Doc</th>
|
|
180
|
+
<th>NPM</th>
|
|
181
|
+
</tr>
|
|
182
|
+
</thead>
|
|
183
|
+
<tbody>
|
|
184
|
+
<tr>
|
|
185
|
+
<td>Binary Tree</td>
|
|
186
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
187
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
188
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>View</span></a></td>
|
|
189
|
+
<td><a href="https://www.npmjs.com/package/binary-tree-typed"><span>View</span></a></td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr>
|
|
192
|
+
<td>Binary Search Tree (BST)</td>
|
|
193
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
194
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
195
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html"><span>View</span></a></td>
|
|
196
|
+
<td><a href="https://www.npmjs.com/package/bst-typed"><span>View</span></a></td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td>AVL Tree</td>
|
|
200
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
201
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
202
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html"><span>View</span></a></td>
|
|
203
|
+
<td><a href="https://www.npmjs.com/package/avl-tree-typed"><span>View</span></a></td>
|
|
204
|
+
</tr>
|
|
205
|
+
<tr>
|
|
206
|
+
<td>Red Black Tree</td>
|
|
207
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
208
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
209
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/RedBlackTree.html"><span>View</span></a></td>
|
|
210
|
+
<td><a href="https://www.npmjs.com/package/red-black-tree-typed"><span>View</span></a></td>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr>
|
|
213
|
+
<td>Tree Multimap</td>
|
|
214
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
215
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
216
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultiMap.html"><span>View</span></a></td>
|
|
217
|
+
<td><a href="https://www.npmjs.com/package/tree-multimap-typed"><span>View</span></a></td>
|
|
218
|
+
</tr>
|
|
219
|
+
<tr>
|
|
220
|
+
<td>Heap</td>
|
|
221
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
222
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
223
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html"><span>View</span></a></td>
|
|
224
|
+
<td><a href="https://www.npmjs.com/package/heap-typed"><span>View</span></a></td>
|
|
225
|
+
</tr>
|
|
226
|
+
<tr>
|
|
227
|
+
<td>Priority Queue</td>
|
|
228
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
229
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
230
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>View</span></a></td>
|
|
231
|
+
<td><a href="https://www.npmjs.com/package/priority-queue-typed"><span>View</span></a></td>
|
|
232
|
+
</tr>
|
|
233
|
+
<tr>
|
|
234
|
+
<td>Max Priority Queue</td>
|
|
235
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
236
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
237
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>View</span></a></td>
|
|
238
|
+
<td><a href="https://www.npmjs.com/package/max-priority-queue-typed"><span>View</span></a></td>
|
|
239
|
+
</tr>
|
|
240
|
+
<tr>
|
|
241
|
+
<td>Min Priority Queue</td>
|
|
242
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
243
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
244
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>View</span></a></td>
|
|
245
|
+
<td><a href="https://www.npmjs.com/package/min-priority-queue-typed"><span>View</span></a></td>
|
|
246
|
+
</tr>
|
|
247
|
+
<tr>
|
|
248
|
+
<td>Trie</td>
|
|
249
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
250
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
251
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>View</span></a></td>
|
|
252
|
+
<td><a href="https://www.npmjs.com/package/trie-typed"><span>View</span></a></td>
|
|
253
|
+
</tr>
|
|
254
|
+
<tr>
|
|
255
|
+
<td>Graph</td>
|
|
256
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
257
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
258
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>View</span></a></td>
|
|
259
|
+
<td><a href="https://www.npmjs.com/package/graph-typed"><span>View</span></a></td>
|
|
260
|
+
</tr>
|
|
261
|
+
<tr>
|
|
262
|
+
<td>Directed Graph</td>
|
|
263
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
264
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
265
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>View</span></a></td>
|
|
266
|
+
<td><a href="https://www.npmjs.com/package/directed-graph-typed"><span>View</span></a></td>
|
|
267
|
+
</tr>
|
|
268
|
+
<tr>
|
|
269
|
+
<td>Undirected Graph</td>
|
|
270
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
271
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
272
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>View</span></a></td>
|
|
273
|
+
<td><a href="https://www.npmjs.com/package/undirected-graph-typed"><span>View</span></a></td>
|
|
274
|
+
</tr>
|
|
275
|
+
<tr>
|
|
276
|
+
<td>Queue</td>
|
|
277
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
278
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
279
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>View</span></a></td>
|
|
280
|
+
<td><a href="https://www.npmjs.com/package/queue-graph-typed"><span>View</span></a></td>
|
|
281
|
+
</tr>
|
|
282
|
+
<tr>
|
|
283
|
+
<td>Deque</td>
|
|
284
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
285
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
286
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Deque.html"><span>View</span></a></td>
|
|
287
|
+
<td><a href="https://www.npmjs.com/package/deque-graph-typed"><span>View</span></a></td>
|
|
288
|
+
</tr>
|
|
289
|
+
<tr>
|
|
290
|
+
<td>Hash Map</td>
|
|
291
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
292
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
293
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashMap.html"><span>View</span></a></td>
|
|
294
|
+
</tr>
|
|
295
|
+
<tr>
|
|
296
|
+
<td>Linked List</td>
|
|
297
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
298
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
299
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>View</span></a></td>
|
|
300
|
+
<td><a href="https://www.npmjs.com/package/linked-list-typed"><span>View</span></a></td>
|
|
301
|
+
</tr>
|
|
302
|
+
<tr>
|
|
303
|
+
<td>Singly Linked List</td>
|
|
304
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
305
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
306
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>View</span></a></td>
|
|
307
|
+
<td><a href="https://www.npmjs.com/package/singly-linked-list-typed"><span>View</span></a></td>
|
|
308
|
+
</tr>
|
|
309
|
+
<tr>
|
|
310
|
+
<td>Doubly Linked List</td>
|
|
311
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
312
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
313
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>View</span></a></td>
|
|
314
|
+
<td><a href="https://www.npmjs.com/package/doubly-linked-list-typed"><span>View</span></a></td>
|
|
315
|
+
</tr>
|
|
316
|
+
<tr>
|
|
317
|
+
<td>Stack</td>
|
|
318
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
319
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
320
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>View</span></a></td>
|
|
321
|
+
<td><a href="https://www.npmjs.com/package/stack-typed"><span>View</span></a></td>
|
|
322
|
+
</tr>
|
|
323
|
+
<tr>
|
|
324
|
+
<td>Segment Tree</td>
|
|
325
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
326
|
+
<td></td>
|
|
327
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html"><span>View</span></a></td>
|
|
328
|
+
</tr>
|
|
329
|
+
<tr>
|
|
330
|
+
<td>Binary Indexed Tree</td>
|
|
331
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
332
|
+
<td></td>
|
|
333
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html"><span>View</span></a></td>
|
|
334
|
+
</tr>
|
|
335
|
+
</tbody>
|
|
336
|
+
</table>
|
|
167
337
|
|
|
168
338
|
## Vivid Examples
|
|
169
339
|
|
|
@@ -520,153 +690,6 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
|
|
|
520
690
|
|
|
521
691
|
<a href="https://github.com/zrwusa/vivid-algorithm" target="_blank">Examples Repository</a>
|
|
522
692
|
|
|
523
|
-
## Data Structures
|
|
524
|
-
|
|
525
|
-
<table style="display: table; width:100%; table-layout: fixed;">
|
|
526
|
-
<thead>
|
|
527
|
-
<tr>
|
|
528
|
-
<th>Data Structure</th>
|
|
529
|
-
<th>Unit Test</th>
|
|
530
|
-
<th>Performance Test</th>
|
|
531
|
-
<th>API Docs</th>
|
|
532
|
-
</tr>
|
|
533
|
-
</thead>
|
|
534
|
-
<tbody>
|
|
535
|
-
<tr>
|
|
536
|
-
<td>Binary Tree</td>
|
|
537
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
538
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
539
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>View</span></a></td>
|
|
540
|
-
</tr>
|
|
541
|
-
<tr>
|
|
542
|
-
<td>Binary Search Tree (BST)</td>
|
|
543
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
544
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
545
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html"><span>View</span></a></td>
|
|
546
|
-
</tr>
|
|
547
|
-
<tr>
|
|
548
|
-
<td>AVL Tree</td>
|
|
549
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
550
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
551
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html"><span>View</span></a></td>
|
|
552
|
-
</tr>
|
|
553
|
-
<tr>
|
|
554
|
-
<td>Red Black Tree</td>
|
|
555
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
556
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
557
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/RedBlackTree.html"><span>View</span></a></td>
|
|
558
|
-
</tr>
|
|
559
|
-
<tr>
|
|
560
|
-
<td>Tree Multimap</td>
|
|
561
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
562
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
563
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultiMap.html"><span>View</span></a></td>
|
|
564
|
-
</tr>
|
|
565
|
-
<tr>
|
|
566
|
-
<td>Heap</td>
|
|
567
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
568
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
569
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html"><span>View</span></a></td>
|
|
570
|
-
</tr>
|
|
571
|
-
<tr>
|
|
572
|
-
<td>Priority Queue</td>
|
|
573
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
574
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
575
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>View</span></a></td>
|
|
576
|
-
</tr>
|
|
577
|
-
<tr>
|
|
578
|
-
<td>Max Priority Queue</td>
|
|
579
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
580
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
581
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>View</span></a></td>
|
|
582
|
-
</tr>
|
|
583
|
-
<tr>
|
|
584
|
-
<td>Min Priority Queue</td>
|
|
585
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
586
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
587
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>View</span></a></td>
|
|
588
|
-
</tr>
|
|
589
|
-
<tr>
|
|
590
|
-
<td>Trie</td>
|
|
591
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
592
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
593
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>View</span></a></td>
|
|
594
|
-
</tr>
|
|
595
|
-
<tr>
|
|
596
|
-
<td>Graph</td>
|
|
597
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
598
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
599
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>View</span></a></td>
|
|
600
|
-
</tr>
|
|
601
|
-
<tr>
|
|
602
|
-
<td>Directed Graph</td>
|
|
603
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
604
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
605
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>View</span></a></td>
|
|
606
|
-
</tr>
|
|
607
|
-
<tr>
|
|
608
|
-
<td>Undirected Graph</td>
|
|
609
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
610
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
611
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>View</span></a></td>
|
|
612
|
-
</tr>
|
|
613
|
-
<tr>
|
|
614
|
-
<td>Queue</td>
|
|
615
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
616
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
617
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>View</span></a></td>
|
|
618
|
-
</tr>
|
|
619
|
-
<tr>
|
|
620
|
-
<td>Deque</td>
|
|
621
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
622
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
623
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Deque.html"><span>View</span></a></td>
|
|
624
|
-
</tr>
|
|
625
|
-
<tr>
|
|
626
|
-
<td>Hash Map</td>
|
|
627
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
628
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
629
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashMap.html"><span>View</span></a></td>
|
|
630
|
-
</tr>
|
|
631
|
-
<tr>
|
|
632
|
-
<td>Linked List</td>
|
|
633
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
634
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
635
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>View</span></a></td>
|
|
636
|
-
</tr>
|
|
637
|
-
<tr>
|
|
638
|
-
<td>Singly Linked List</td>
|
|
639
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
640
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
641
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>View</span></a></td>
|
|
642
|
-
</tr>
|
|
643
|
-
<tr>
|
|
644
|
-
<td>Doubly Linked List</td>
|
|
645
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
646
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
647
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>View</span></a></td>
|
|
648
|
-
</tr>
|
|
649
|
-
<tr>
|
|
650
|
-
<td>Stack</td>
|
|
651
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
652
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
653
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>View</span></a></td>
|
|
654
|
-
</tr>
|
|
655
|
-
<tr>
|
|
656
|
-
<td>Segment Tree</td>
|
|
657
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
658
|
-
<td></td>
|
|
659
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html"><span>View</span></a></td>
|
|
660
|
-
</tr>
|
|
661
|
-
<tr>
|
|
662
|
-
<td>Binary Indexed Tree</td>
|
|
663
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
664
|
-
<td></td>
|
|
665
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html"><span>View</span></a></td>
|
|
666
|
-
</tr>
|
|
667
|
-
</tbody>
|
|
668
|
-
</table>
|
|
669
|
-
|
|
670
693
|
## Benchmark
|
|
671
694
|
|
|
672
695
|
MacBook Pro (15-inch, 2018)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-structure-typed",
|
|
3
|
-
"version": "1.51.
|
|
3
|
+
"version": "1.51.3",
|
|
4
4
|
"description": "Javascript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/mjs/index.js",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
|
67
67
|
"@typescript-eslint/parser": "^6.7.4",
|
|
68
68
|
"auto-changelog": "^2.4.0",
|
|
69
|
-
"avl-tree-typed": "^1.51.
|
|
69
|
+
"avl-tree-typed": "^1.51.2",
|
|
70
70
|
"benchmark": "^2.1.4",
|
|
71
|
-
"binary-tree-typed": "^1.51.
|
|
72
|
-
"bst-typed": "^1.51.
|
|
73
|
-
"data-structure-typed": "^1.51.
|
|
71
|
+
"binary-tree-typed": "^1.51.2",
|
|
72
|
+
"bst-typed": "^1.51.2",
|
|
73
|
+
"data-structure-typed": "^1.51.2",
|
|
74
74
|
"dependency-cruiser": "^14.1.0",
|
|
75
75
|
"doctoc": "^2.2.1",
|
|
76
76
|
"eslint": "^8.50.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
80
80
|
"eslint-plugin-import": "^2.28.1",
|
|
81
81
|
"fast-glob": "^3.3.1",
|
|
82
|
-
"heap-typed": "^1.51.
|
|
82
|
+
"heap-typed": "^1.51.2",
|
|
83
83
|
"istanbul-badges-readme": "^1.8.5",
|
|
84
84
|
"jest": "^29.7.0",
|
|
85
85
|
"js-sdsl": "^4.4.2",
|
|
@@ -92,54 +92,17 @@
|
|
|
92
92
|
"typescript": "^5.3.2"
|
|
93
93
|
},
|
|
94
94
|
"keywords": [
|
|
95
|
-
"data structure",
|
|
96
|
-
"data structures",
|
|
97
|
-
"datastructure",
|
|
98
|
-
"datastructures",
|
|
99
95
|
"data",
|
|
100
96
|
"structure",
|
|
101
97
|
"structures",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"max-heap",
|
|
111
|
-
"priority queue",
|
|
112
|
-
"priority-queue",
|
|
113
|
-
"max priority queue",
|
|
114
|
-
"max-priority-queue",
|
|
115
|
-
"min priority queue",
|
|
116
|
-
"min-priority-queue",
|
|
117
|
-
"binary search tree",
|
|
118
|
-
"binary-search-tree",
|
|
119
|
-
"BST",
|
|
120
|
-
"binary tree",
|
|
121
|
-
"binary-tree",
|
|
122
|
-
"red black tree",
|
|
123
|
-
"red black tree",
|
|
124
|
-
"red-black-tree",
|
|
125
|
-
"rb tree",
|
|
126
|
-
"trie",
|
|
127
|
-
"prefix tree",
|
|
128
|
-
"prefix-tree",
|
|
129
|
-
"avl tree",
|
|
130
|
-
"avl-tree",
|
|
131
|
-
"tree set",
|
|
132
|
-
"tree-set",
|
|
133
|
-
"tree multiset",
|
|
134
|
-
"tree-multiset",
|
|
135
|
-
"tree map",
|
|
136
|
-
"tree-map",
|
|
137
|
-
"tree multimap",
|
|
138
|
-
"tree-multimap",
|
|
139
|
-
"binary indexed tree",
|
|
140
|
-
"binary-indexed-tree",
|
|
141
|
-
"segment tree",
|
|
142
|
-
"segment-tree",
|
|
98
|
+
"data structure",
|
|
99
|
+
"datastructure",
|
|
100
|
+
"data-structure",
|
|
101
|
+
"data structures",
|
|
102
|
+
"datastructures",
|
|
103
|
+
"data-structures",
|
|
104
|
+
"in data structures",
|
|
105
|
+
"in data structure",
|
|
143
106
|
"binary",
|
|
144
107
|
"depth",
|
|
145
108
|
"breadth",
|
|
@@ -149,7 +112,7 @@
|
|
|
149
112
|
"avl",
|
|
150
113
|
"red",
|
|
151
114
|
"black",
|
|
152
|
-
"
|
|
115
|
+
"redblack",
|
|
153
116
|
"RB",
|
|
154
117
|
"segment",
|
|
155
118
|
"prefix",
|
|
@@ -159,26 +122,18 @@
|
|
|
159
122
|
"set",
|
|
160
123
|
"multiset",
|
|
161
124
|
"multimap",
|
|
125
|
+
"directed",
|
|
126
|
+
"undirected",
|
|
127
|
+
"graph",
|
|
128
|
+
"min",
|
|
129
|
+
"max",
|
|
130
|
+
"heap",
|
|
131
|
+
"priority",
|
|
132
|
+
"queue",
|
|
162
133
|
"singly",
|
|
163
134
|
"doubly",
|
|
164
135
|
"linked",
|
|
165
136
|
"list",
|
|
166
|
-
"linked list",
|
|
167
|
-
"linked-list",
|
|
168
|
-
"singly linked list",
|
|
169
|
-
"singly-linked-list",
|
|
170
|
-
"doubly linked list",
|
|
171
|
-
"doubly-linked-list",
|
|
172
|
-
"javascript data structure",
|
|
173
|
-
"javascript data structures",
|
|
174
|
-
"typescript data structures",
|
|
175
|
-
"js data structure",
|
|
176
|
-
"js data structures",
|
|
177
|
-
"data-structure",
|
|
178
|
-
"data-structures",
|
|
179
|
-
"directed",
|
|
180
|
-
"undirected",
|
|
181
|
-
"graph",
|
|
182
137
|
"js",
|
|
183
138
|
"ts",
|
|
184
139
|
"javascript",
|
|
@@ -195,6 +150,7 @@
|
|
|
195
150
|
"Python",
|
|
196
151
|
"collections",
|
|
197
152
|
"Python Collections",
|
|
153
|
+
"pythoncollections",
|
|
198
154
|
"python-collections",
|
|
199
155
|
"C#",
|
|
200
156
|
"System.Collections.Generic",
|
|
@@ -202,6 +158,43 @@
|
|
|
202
158
|
"java.util",
|
|
203
159
|
"Java",
|
|
204
160
|
"util",
|
|
161
|
+
"binary search tree",
|
|
162
|
+
"binarysearchtree",
|
|
163
|
+
"binary-search-tree",
|
|
164
|
+
"BST",
|
|
165
|
+
"binary tree",
|
|
166
|
+
"binarytree",
|
|
167
|
+
"binary-tree",
|
|
168
|
+
"red black tree",
|
|
169
|
+
"redblacktree",
|
|
170
|
+
"redblack tree",
|
|
171
|
+
"red-black-tree",
|
|
172
|
+
"redblack-tree",
|
|
173
|
+
"trie",
|
|
174
|
+
"prefix tree",
|
|
175
|
+
"prefixtree",
|
|
176
|
+
"prefix-tree",
|
|
177
|
+
"avl tree",
|
|
178
|
+
"avltree",
|
|
179
|
+
"avl-tree",
|
|
180
|
+
"tree set",
|
|
181
|
+
"treeset",
|
|
182
|
+
"tree-set",
|
|
183
|
+
"tree multiset",
|
|
184
|
+
"treemultiset",
|
|
185
|
+
"tree-multiset",
|
|
186
|
+
"tree map",
|
|
187
|
+
"treemap",
|
|
188
|
+
"tree-map",
|
|
189
|
+
"tree multimap",
|
|
190
|
+
"treemultimap",
|
|
191
|
+
"tree-multimap",
|
|
192
|
+
"binary indexed tree",
|
|
193
|
+
"binaryindexedtree",
|
|
194
|
+
"binary-indexed-tree",
|
|
195
|
+
"segment tree",
|
|
196
|
+
"segmenttree",
|
|
197
|
+
"segment-tree",
|
|
205
198
|
"sort",
|
|
206
199
|
"sorted",
|
|
207
200
|
"order",
|
|
@@ -210,31 +203,61 @@
|
|
|
210
203
|
"morris",
|
|
211
204
|
"Morris",
|
|
212
205
|
"bellman ford",
|
|
206
|
+
"bellmanford",
|
|
213
207
|
"bellman-ford",
|
|
214
208
|
"dijkstra",
|
|
215
209
|
"Dijkstra",
|
|
216
210
|
"floyd warshall",
|
|
211
|
+
"floydwarshall",
|
|
217
212
|
"floyd-warshall",
|
|
218
213
|
"tarjan",
|
|
219
214
|
"tarjan's",
|
|
220
215
|
"dfs",
|
|
221
216
|
"depth first Search",
|
|
217
|
+
"depthfirstSearch",
|
|
222
218
|
"depth-first-Search",
|
|
223
219
|
"bfs",
|
|
224
220
|
"breadth first search",
|
|
221
|
+
"breadthfirstsearch",
|
|
225
222
|
"dfs iterative",
|
|
226
223
|
"recursive",
|
|
227
224
|
"iterative",
|
|
228
225
|
"directed graph",
|
|
226
|
+
"directedgraph",
|
|
229
227
|
"directed-graph",
|
|
230
228
|
"undirected graph",
|
|
229
|
+
"undirectedgraph",
|
|
231
230
|
"undirected-graph",
|
|
231
|
+
"min heap",
|
|
232
|
+
"minheap",
|
|
233
|
+
"min-heap",
|
|
234
|
+
"max heap",
|
|
235
|
+
"maxheap",
|
|
236
|
+
"max-heap",
|
|
237
|
+
"priority queue",
|
|
238
|
+
"priorityqueue",
|
|
239
|
+
"priority-queue",
|
|
240
|
+
"max priority queue",
|
|
241
|
+
"maxpriorityqueue",
|
|
242
|
+
"max-priority-queue",
|
|
243
|
+
"min priority queue",
|
|
244
|
+
"minpriorityqueue",
|
|
245
|
+
"min-priority-queue",
|
|
232
246
|
"hash",
|
|
233
247
|
"map",
|
|
234
|
-
"hashmap",
|
|
235
248
|
"hash map",
|
|
249
|
+
"hashmap",
|
|
236
250
|
"hash-map",
|
|
237
251
|
"deque",
|
|
252
|
+
"linked list",
|
|
253
|
+
"linkedlist",
|
|
254
|
+
"linked-list",
|
|
255
|
+
"singly linked list",
|
|
256
|
+
"singlylinkedlist",
|
|
257
|
+
"singly-linked-list",
|
|
258
|
+
"doubly linked list",
|
|
259
|
+
"doublylinkedlist",
|
|
260
|
+
"doubly-linked-list",
|
|
238
261
|
"stack",
|
|
239
262
|
"CommonJS",
|
|
240
263
|
"ES6",
|