heap-typed 1.47.3 → 1.47.4
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/README.md +410 -354
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -155,13 +155,14 @@ Max Heap
|
|
|
155
155
|
}
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
+
|
|
158
159
|
## API docs & Examples
|
|
159
160
|
|
|
160
161
|
[API Docs](https://data-structure-typed-docs.vercel.app)
|
|
161
162
|
|
|
162
|
-
[Live Examples](https://
|
|
163
|
+
[Live Examples](https://vivid-algorithm.vercel.app)
|
|
163
164
|
|
|
164
|
-
<a href="https://github.com/zrwusa/
|
|
165
|
+
<a href="https://github.com/zrwusa/vivid-algorithm" target="_blank">Examples Repository</a>
|
|
165
166
|
|
|
166
167
|
## Data Structures
|
|
167
168
|
|
|
@@ -171,464 +172,519 @@ Max Heap
|
|
|
171
172
|
<th>Data Structure</th>
|
|
172
173
|
<th>Unit Test</th>
|
|
173
174
|
<th>Performance Test</th>
|
|
174
|
-
<th>API
|
|
175
|
-
<th>Implemented</th>
|
|
175
|
+
<th>API Docs</th>
|
|
176
176
|
</tr>
|
|
177
177
|
</thead>
|
|
178
178
|
<tbody>
|
|
179
179
|
<tr>
|
|
180
180
|
<td>Binary Tree</td>
|
|
181
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
182
|
-
</td>
|
|
183
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
184
|
-
</td>
|
|
185
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
186
181
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
182
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
183
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
187
184
|
</tr>
|
|
188
185
|
<tr>
|
|
189
186
|
<td>Binary Search Tree (BST)</td>
|
|
190
187
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
191
188
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
192
189
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html"><span>BST</span></a></td>
|
|
193
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
194
190
|
</tr>
|
|
195
191
|
<tr>
|
|
196
192
|
<td>AVL Tree</td>
|
|
197
193
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
198
194
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
199
195
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html"><span>AVLTree</span></a></td>
|
|
196
|
+
</tr>
|
|
197
|
+
<tr>
|
|
198
|
+
<td>Red Black Tree</td>
|
|
200
199
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
200
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
201
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/RedBlackTree.html"><span>RedBlackTree</span></a></td>
|
|
201
202
|
</tr>
|
|
202
203
|
<tr>
|
|
203
204
|
<td>Tree Multiset</td>
|
|
204
205
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
205
206
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
206
207
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultimap.html"><span>TreeMultimap</span></a></td>
|
|
207
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
208
208
|
</tr>
|
|
209
209
|
<tr>
|
|
210
210
|
<td>Segment Tree</td>
|
|
211
|
-
<td></td>
|
|
211
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
212
212
|
<td></td>
|
|
213
213
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html"><span>SegmentTree</span></a></td>
|
|
214
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
215
214
|
</tr>
|
|
216
215
|
<tr>
|
|
217
216
|
<td>Binary Indexed Tree</td>
|
|
218
217
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
219
218
|
<td></td>
|
|
220
219
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html"><span>BinaryIndexedTree</span></a></td>
|
|
221
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
222
220
|
</tr>
|
|
223
221
|
<tr>
|
|
224
|
-
<td>
|
|
225
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
226
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
227
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>AbstractGraph</span></a></td>
|
|
228
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
229
|
-
</tr>
|
|
230
|
-
<tr>
|
|
231
|
-
<td>Directed Graph</td>
|
|
232
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
233
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
234
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>DirectedGraph</span></a></td>
|
|
235
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
236
|
-
</tr>
|
|
237
|
-
<tr>
|
|
238
|
-
<td>Undirected Graph</td>
|
|
239
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
222
|
+
<td>Heap</td>
|
|
240
223
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
241
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>UndirectedGraph</span></a></td>
|
|
242
224
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
225
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html"><span>Heap</span></a></td>
|
|
243
226
|
</tr>
|
|
244
227
|
<tr>
|
|
245
|
-
<td>
|
|
246
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
228
|
+
<td>Priority Queue</td>
|
|
247
229
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
248
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
249
230
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
231
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>PriorityQueue</span></a></td>
|
|
250
232
|
</tr>
|
|
251
233
|
<tr>
|
|
252
|
-
<td>
|
|
253
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
234
|
+
<td>Max Priority Queue</td>
|
|
254
235
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
255
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
256
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>MaxPriorityQueue</span></a></td>
|
|
257
238
|
</tr>
|
|
258
239
|
<tr>
|
|
259
|
-
<td>
|
|
260
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
240
|
+
<td>Min Priority Queue</td>
|
|
261
241
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
262
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>DoublyLinkedList</span></a></td>
|
|
263
242
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
243
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>MinPriorityQueue</span></a></td>
|
|
264
244
|
</tr>
|
|
265
245
|
<tr>
|
|
266
|
-
<td>
|
|
267
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
246
|
+
<td>Trie</td>
|
|
268
247
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
269
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>Queue</span></a></td>
|
|
270
248
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
249
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>Trie</span></a></td>
|
|
271
250
|
</tr>
|
|
272
251
|
<tr>
|
|
273
|
-
<td>
|
|
274
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
252
|
+
<td>Graph</td>
|
|
275
253
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
276
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ObjectDeque.html"><span>ObjectDeque</span></a></td>
|
|
277
254
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
255
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>AbstractGraph</span></a></td>
|
|
278
256
|
</tr>
|
|
279
257
|
<tr>
|
|
280
|
-
<td>
|
|
281
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
258
|
+
<td>Directed Graph</td>
|
|
282
259
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
283
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ArrayDeque.html"><span>ArrayDeque</span></a></td>
|
|
284
260
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
261
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>DirectedGraph</span></a></td>
|
|
285
262
|
</tr>
|
|
286
263
|
<tr>
|
|
287
|
-
<td>
|
|
264
|
+
<td>Undirected Graph</td>
|
|
288
265
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
289
|
-
<td></td>
|
|
290
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
|
|
291
266
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
267
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>UndirectedGraph</span></a></td>
|
|
292
268
|
</tr>
|
|
293
|
-
|
|
294
|
-
[//]: # (<tr>)
|
|
295
|
-
|
|
296
|
-
[//]: # (<td>Hash</td>)
|
|
297
|
-
|
|
298
|
-
[//]: # (<td></td>)
|
|
299
|
-
|
|
300
|
-
[//]: # (<td></td>)
|
|
301
|
-
|
|
302
|
-
[//]: # (<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashTable.html"><span>HashTable</span></a></td>)
|
|
303
|
-
|
|
304
|
-
[//]: # (<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>)
|
|
305
|
-
|
|
306
|
-
[//]: # (</tr>)
|
|
307
269
|
<tr>
|
|
308
|
-
<td>
|
|
309
|
-
<td></td>
|
|
310
|
-
<td></td>
|
|
311
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateSet.html"><span>CoordinateSet</span></a></td>
|
|
270
|
+
<td>Queue</td>
|
|
312
271
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
313
|
-
</tr>
|
|
314
|
-
<tr>
|
|
315
|
-
<td>Coordinate Map</td>
|
|
316
|
-
<td></td>
|
|
317
|
-
<td></td>
|
|
318
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateMap.html"><span>CoordinateMap</span></a></td>
|
|
319
272
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
273
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>Queue</span></a></td>
|
|
320
274
|
</tr>
|
|
321
275
|
<tr>
|
|
322
|
-
<td>
|
|
276
|
+
<td>Deque</td>
|
|
323
277
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
324
278
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
325
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/
|
|
326
|
-
<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/Deque.html"><span>Deque</span></a></td>
|
|
327
280
|
</tr>
|
|
328
281
|
<tr>
|
|
329
|
-
<td>
|
|
330
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
282
|
+
<td>Linked List</td>
|
|
331
283
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
332
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>PriorityQueue</span></a></td>
|
|
333
284
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
285
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
334
286
|
</tr>
|
|
335
287
|
<tr>
|
|
336
|
-
<td>
|
|
337
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
288
|
+
<td>Singly Linked List</td>
|
|
338
289
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
339
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>MaxPriorityQueue</span></a></td>
|
|
340
290
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
291
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
341
292
|
</tr>
|
|
342
293
|
<tr>
|
|
343
|
-
<td>
|
|
344
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
294
|
+
<td>Doubly Linked List</td>
|
|
345
295
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
346
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>MinPriorityQueue</span></a></td>
|
|
347
296
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
297
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>DoublyLinkedList</span></a></td>
|
|
348
298
|
</tr>
|
|
349
299
|
<tr>
|
|
350
|
-
<td>
|
|
300
|
+
<td>Stack</td>
|
|
351
301
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
352
|
-
<td></td>
|
|
353
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>Trie</span></a></td>
|
|
354
302
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
303
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
|
|
355
304
|
</tr>
|
|
356
305
|
</tbody>
|
|
357
306
|
</table>
|
|
358
307
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
## Complexities
|
|
362
|
-
|
|
363
|
-
### performance of Big O
|
|
308
|
+
## Standard library data structure comparison
|
|
364
309
|
|
|
365
310
|
<table>
|
|
366
|
-
<thead>
|
|
367
|
-
<tr>
|
|
368
|
-
<th>
|
|
369
|
-
<th>
|
|
370
|
-
<th>
|
|
371
|
-
<th>
|
|
372
|
-
|
|
373
|
-
</
|
|
374
|
-
|
|
375
|
-
<
|
|
376
|
-
<
|
|
377
|
-
<td
|
|
378
|
-
<td>
|
|
379
|
-
<td>
|
|
380
|
-
|
|
381
|
-
<
|
|
382
|
-
|
|
383
|
-
<
|
|
384
|
-
<td
|
|
385
|
-
<td>
|
|
386
|
-
|
|
387
|
-
<
|
|
388
|
-
<td>
|
|
389
|
-
|
|
390
|
-
<
|
|
391
|
-
<td
|
|
392
|
-
|
|
393
|
-
<
|
|
394
|
-
<td>
|
|
395
|
-
<td>
|
|
396
|
-
|
|
397
|
-
<
|
|
398
|
-
|
|
399
|
-
<
|
|
400
|
-
<td>
|
|
401
|
-
<td>
|
|
402
|
-
<td>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
<
|
|
406
|
-
<td>
|
|
407
|
-
<td
|
|
408
|
-
<td
|
|
409
|
-
<td
|
|
410
|
-
</tr>
|
|
411
|
-
<tr>
|
|
412
|
-
<td
|
|
413
|
-
<td
|
|
414
|
-
<td
|
|
415
|
-
<td
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
<
|
|
419
|
-
<td
|
|
420
|
-
<td
|
|
421
|
-
<td
|
|
422
|
-
|
|
423
|
-
<
|
|
424
|
-
|
|
425
|
-
|
|
311
|
+
<thead>
|
|
312
|
+
<tr>
|
|
313
|
+
<th>Data Structure Typed</th>
|
|
314
|
+
<th>C++ STL</th>
|
|
315
|
+
<th>java.util</th>
|
|
316
|
+
<th>Python collections</th>
|
|
317
|
+
</tr>
|
|
318
|
+
</thead>
|
|
319
|
+
<tbody>
|
|
320
|
+
<tr>
|
|
321
|
+
<td>Heap<E></td>
|
|
322
|
+
<td>priority_queue<T></td>
|
|
323
|
+
<td>PriorityQueue<E></td>
|
|
324
|
+
<td>heapq</td>
|
|
325
|
+
</tr>
|
|
326
|
+
<tr>
|
|
327
|
+
<td>Deque<E></td>
|
|
328
|
+
<td>deque<T></td>
|
|
329
|
+
<td>ArrayDeque<E></td>
|
|
330
|
+
<td>deque</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr>
|
|
333
|
+
<td>Queue<E></td>
|
|
334
|
+
<td>queue<T></td>
|
|
335
|
+
<td>Queue<E></td>
|
|
336
|
+
<td>-</td>
|
|
337
|
+
</tr>
|
|
338
|
+
<tr>
|
|
339
|
+
<td>HashMap<K, V></td>
|
|
340
|
+
<td>unordered_map<K, V></td>
|
|
341
|
+
<td>HashMap<K, V></td>
|
|
342
|
+
<td>defaultdict</td>
|
|
343
|
+
</tr>
|
|
344
|
+
<tr>
|
|
345
|
+
<td>DoublyLinkedList<E></td>
|
|
346
|
+
<td>list<T></td>
|
|
347
|
+
<td>LinkedList<E></td>
|
|
348
|
+
<td>-</td>
|
|
349
|
+
</tr>
|
|
350
|
+
<tr>
|
|
351
|
+
<td>SinglyLinkedList<E></td>
|
|
352
|
+
<td>-</td>
|
|
353
|
+
<td>-</td>
|
|
354
|
+
<td>-</td>
|
|
355
|
+
</tr>
|
|
356
|
+
<tr>
|
|
357
|
+
<td>BinaryTree<K, V></td>
|
|
358
|
+
<td>-</td>
|
|
359
|
+
<td>-</td>
|
|
360
|
+
<td>-</td>
|
|
361
|
+
</tr>
|
|
362
|
+
<tr>
|
|
363
|
+
<td>BST<K, V></td>
|
|
364
|
+
<td>-</td>
|
|
365
|
+
<td>-</td>
|
|
366
|
+
<td>-</td>
|
|
367
|
+
</tr>
|
|
368
|
+
<tr>
|
|
369
|
+
<td>RedBlackTree<E></td>
|
|
370
|
+
<td>set<T></td>
|
|
371
|
+
<td>TreeSet<E></td>
|
|
372
|
+
<td>-</td>
|
|
373
|
+
</tr>
|
|
374
|
+
<tr>
|
|
375
|
+
<td>RedBlackTree<K, V></td>
|
|
376
|
+
<td>map<K, V></td>
|
|
377
|
+
<td>TreeMap<K, V></td>
|
|
378
|
+
<td>-</td>
|
|
379
|
+
</tr>
|
|
380
|
+
<tr>
|
|
381
|
+
<td>TreeMultimap<K, V></td>
|
|
382
|
+
<td>multimap<K, V></td>
|
|
383
|
+
<td>-</td>
|
|
384
|
+
<td>-</td>
|
|
385
|
+
</tr>
|
|
386
|
+
<tr>
|
|
387
|
+
<td>-</td>
|
|
388
|
+
<td>multiset<T></td>
|
|
389
|
+
<td>-</td>
|
|
390
|
+
<td>-</td>
|
|
391
|
+
</tr>
|
|
392
|
+
<tr>
|
|
393
|
+
<td>Trie</td>
|
|
394
|
+
<td>-</td>
|
|
395
|
+
<td>-</td>
|
|
396
|
+
<td>-</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr>
|
|
399
|
+
<td>DirectedGraph<V, E></td>
|
|
400
|
+
<td>-</td>
|
|
401
|
+
<td>-</td>
|
|
402
|
+
<td>-</td>
|
|
403
|
+
</tr>
|
|
404
|
+
<tr>
|
|
405
|
+
<td>UndirectedGraph<V, E></td>
|
|
406
|
+
<td>-</td>
|
|
407
|
+
<td>-</td>
|
|
408
|
+
<td>-</td>
|
|
409
|
+
</tr>
|
|
410
|
+
<tr>
|
|
411
|
+
<td>PriorityQueue<E></td>
|
|
412
|
+
<td>priority_queue<T></td>
|
|
413
|
+
<td>PriorityQueue<E></td>
|
|
414
|
+
<td>-</td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr>
|
|
417
|
+
<td>Array<E></td>
|
|
418
|
+
<td>vector<T></td>
|
|
419
|
+
<td>ArrayList<E></td>
|
|
420
|
+
<td>list</td>
|
|
421
|
+
</tr>
|
|
422
|
+
<tr>
|
|
423
|
+
<td>Stack<E></td>
|
|
424
|
+
<td>stack<T></td>
|
|
425
|
+
<td>Stack<E></td>
|
|
426
|
+
<td>-</td>
|
|
427
|
+
</tr>
|
|
428
|
+
<tr>
|
|
429
|
+
<td>Set<E></td>
|
|
430
|
+
<td>-</td>
|
|
431
|
+
<td>HashSet<E></td>
|
|
432
|
+
<td>set</td>
|
|
433
|
+
</tr>
|
|
434
|
+
<tr>
|
|
435
|
+
<td>Map<K, V></td>
|
|
436
|
+
<td>-</td>
|
|
437
|
+
<td>HashMap<K, V></td>
|
|
438
|
+
<td>dict</td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td>-</td>
|
|
442
|
+
<td>unordered_set<T></td>
|
|
443
|
+
<td>HashSet<E></td>
|
|
444
|
+
<td>-</td>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td>Map<K, V></td>
|
|
448
|
+
<td>-</td>
|
|
449
|
+
<td>-</td>
|
|
450
|
+
<td>OrderedDict</td>
|
|
451
|
+
</tr>
|
|
452
|
+
<tr>
|
|
453
|
+
<td>-</td>
|
|
454
|
+
<td>unordered_multiset</td>
|
|
455
|
+
<td>-</td>
|
|
456
|
+
<td>Counter</td>
|
|
457
|
+
</tr>
|
|
458
|
+
<tr>
|
|
459
|
+
<td>-</td>
|
|
460
|
+
<td>-</td>
|
|
461
|
+
<td>LinkedHashSet<E></td>
|
|
462
|
+
<td>-</td>
|
|
463
|
+
</tr>
|
|
464
|
+
<tr>
|
|
465
|
+
<td>HashMap<K, V></td>
|
|
466
|
+
<td>-</td>
|
|
467
|
+
<td>LinkedHashMap<K, V></td>
|
|
468
|
+
<td>-</td>
|
|
469
|
+
</tr>
|
|
470
|
+
<tr>
|
|
471
|
+
<td>-</td>
|
|
472
|
+
<td>unordered_multimap<K, V></td>
|
|
473
|
+
<td>-</td>
|
|
474
|
+
<td>-</td>
|
|
475
|
+
</tr>
|
|
476
|
+
<tr>
|
|
477
|
+
<td>-</td>
|
|
478
|
+
<td>bitset<N></td>
|
|
479
|
+
<td>-</td>
|
|
480
|
+
<td>-</td>
|
|
481
|
+
</tr>
|
|
482
|
+
</tbody>
|
|
426
483
|
</table>
|
|
427
484
|
|
|
428
|
-
|
|
485
|
+
## Benchmark
|
|
486
|
+
|
|
487
|
+
[//]: # (No deletion!!! Start of Replace Section)
|
|
488
|
+
<div class="json-to-html-collapse clearfix 0">
|
|
489
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
490
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.32</td><td>31.93</td><td>3.67e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>70.90</td><td>14.10</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>40.58</td><td>24.64</td><td>4.87e-4</td></tr><tr><td>10,000 get</td><td>27.31</td><td>36.62</td><td>2.00e-4</td></tr></table></div>
|
|
491
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
492
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
493
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>12.35</td><td>80.99</td><td>7.17e-5</td></tr><tr><td>1,000 add & delete randomly</td><td>15.98</td><td>62.58</td><td>7.98e-4</td></tr><tr><td>1,000 addMany</td><td>10.96</td><td>91.27</td><td>0.00</td></tr><tr><td>1,000 get</td><td>18.61</td><td>53.73</td><td>0.00</td></tr><tr><td>1,000 dfs</td><td>164.20</td><td>6.09</td><td>0.04</td></tr><tr><td>1,000 bfs</td><td>58.84</td><td>17.00</td><td>0.01</td></tr><tr><td>1,000 morris</td><td>256.66</td><td>3.90</td><td>7.70e-4</td></tr></table></div>
|
|
494
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
495
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
496
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.59</td><td>31.66</td><td>2.74e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>74.56</td><td>13.41</td><td>8.32e-4</td></tr><tr><td>10,000 addMany</td><td>29.16</td><td>34.30</td><td>0.00</td></tr><tr><td>10,000 get</td><td>29.24</td><td>34.21</td><td>0.00</td></tr></table></div>
|
|
497
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
498
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
499
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add</td><td>85.85</td><td>11.65</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>211.54</td><td>4.73</td><td>0.00</td></tr><tr><td>100,000 getNode</td><td>37.92</td><td>26.37</td><td>1.65e-4</td></tr></table></div>
|
|
500
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
501
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>comparison</span></div>
|
|
502
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>SRC PQ 10,000 add</td><td>0.57</td><td>1748.73</td><td>4.96e-6</td></tr><tr><td>CJS PQ 10,000 add</td><td>0.57</td><td>1746.69</td><td>4.91e-6</td></tr><tr><td>MJS PQ 10,000 add</td><td>0.57</td><td>1749.68</td><td>4.43e-6</td></tr><tr><td>SRC PQ 10,000 add & pop</td><td>3.47</td><td>288.14</td><td>6.38e-4</td></tr><tr><td>CJS PQ 10,000 add & pop</td><td>3.39</td><td>295.36</td><td>3.90e-5</td></tr><tr><td>MJS PQ 10,000 add & pop</td><td>3.37</td><td>297.17</td><td>3.03e-5</td></tr></table></div>
|
|
503
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
504
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
505
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.10</td><td>9534.93</td><td>8.72e-7</td></tr><tr><td>1,000 addEdge</td><td>6.30</td><td>158.67</td><td>0.00</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.16e+4</td><td>3.03e-7</td></tr><tr><td>1,000 getEdge</td><td>22.31</td><td>44.82</td><td>0.00</td></tr><tr><td>tarjan</td><td>210.90</td><td>4.74</td><td>0.01</td></tr><tr><td>tarjan all</td><td>214.72</td><td>4.66</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>172.52</td><td>5.80</td><td>0.00</td></tr></table></div>
|
|
506
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
507
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
508
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 set</td><td>275.88</td><td>3.62</td><td>0.12</td></tr><tr><td>1,000,000 Map set</td><td>211.66</td><td>4.72</td><td>0.01</td></tr><tr><td>1,000,000 Set add</td><td>177.72</td><td>5.63</td><td>0.02</td></tr><tr><td>1,000,000 set & get</td><td>317.60</td><td>3.15</td><td>0.02</td></tr><tr><td>1,000,000 Map set & get</td><td>274.99</td><td>3.64</td><td>0.03</td></tr><tr><td>1,000,000 Set add & has</td><td>172.23</td><td>5.81</td><td>0.02</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>929.40</td><td>1.08</td><td>0.07</td></tr><tr><td>1,000,000 Map ObjKey set & get</td><td>310.02</td><td>3.23</td><td>0.05</td></tr><tr><td>1,000,000 Set ObjKey add & has</td><td>283.28</td><td>3.53</td><td>0.04</td></tr></table></div>
|
|
509
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
510
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
511
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>5.80</td><td>172.35</td><td>8.78e-5</td></tr><tr><td>10,000 fib add & pop</td><td>357.92</td><td>2.79</td><td>0.00</td></tr></table></div>
|
|
512
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
513
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
514
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>221.57</td><td>4.51</td><td>0.03</td></tr><tr><td>1,000,000 unshift</td><td>229.02</td><td>4.37</td><td>0.07</td></tr><tr><td>1,000,000 unshift & shift</td><td>169.21</td><td>5.91</td><td>0.02</td></tr><tr><td>1,000,000 insertBefore</td><td>314.48</td><td>3.18</td><td>0.07</td></tr></table></div>
|
|
515
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
516
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
517
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>212.98</td><td>4.70</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>250.68</td><td>3.99</td><td>0.01</td></tr></table></div>
|
|
518
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
519
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
520
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>8.91</td><td>112.29</td><td>2.26e-4</td></tr></table></div>
|
|
521
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
522
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
523
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add & pop</td><td>103.59</td><td>9.65</td><td>0.00</td></tr></table></div>
|
|
524
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
525
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
526
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>14.55</td><td>68.72</td><td>6.91e-4</td></tr><tr><td>1,000,000 push & pop</td><td>23.40</td><td>42.73</td><td>5.94e-4</td></tr><tr><td>1,000,000 push & shift</td><td>24.41</td><td>40.97</td><td>1.45e-4</td></tr><tr><td>1,000,000 unshift & shift</td><td>22.56</td><td>44.32</td><td>1.30e-4</td></tr></table></div>
|
|
527
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
528
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
529
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>39.90</td><td>25.07</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>81.79</td><td>12.23</td><td>0.00</td></tr></table></div>
|
|
530
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
531
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
532
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>37.60</td><td>26.60</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>47.01</td><td>21.27</td><td>0.00</td></tr></table></div>
|
|
533
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
534
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
535
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>45.97</td><td>21.76</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>66.20</td><td>15.11</td><td>0.00</td></tr></table></div>
|
|
536
|
+
</div>
|
|
537
|
+
|
|
538
|
+
[//]: # (No deletion!!! End of Replace Section)
|
|
539
|
+
|
|
540
|
+
## Built-in classic algorithms
|
|
429
541
|
|
|
430
542
|
<table>
|
|
431
|
-
<thead>
|
|
432
|
-
<tr>
|
|
433
|
-
<th>
|
|
434
|
-
<th>
|
|
435
|
-
<th>
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
<
|
|
439
|
-
|
|
440
|
-
</
|
|
441
|
-
<
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
<td>
|
|
445
|
-
|
|
446
|
-
<
|
|
447
|
-
<td>
|
|
448
|
-
<td
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
<td
|
|
452
|
-
|
|
453
|
-
<
|
|
454
|
-
<td>
|
|
455
|
-
<td>
|
|
456
|
-
|
|
457
|
-
</
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
<
|
|
461
|
-
<td>
|
|
462
|
-
<td>1
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
</
|
|
466
|
-
|
|
467
|
-
<
|
|
468
|
-
<td>
|
|
469
|
-
<td>
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
<td
|
|
473
|
-
</tr>
|
|
474
|
-
<tr>
|
|
475
|
-
<td
|
|
476
|
-
<td
|
|
477
|
-
<td>
|
|
478
|
-
|
|
479
|
-
<
|
|
480
|
-
<td>
|
|
481
|
-
</
|
|
482
|
-
<
|
|
483
|
-
|
|
484
|
-
<
|
|
485
|
-
<td>
|
|
486
|
-
<td>
|
|
487
|
-
<td>
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
<
|
|
491
|
-
<td
|
|
492
|
-
<td>
|
|
493
|
-
|
|
494
|
-
<
|
|
495
|
-
<td>
|
|
496
|
-
<td
|
|
497
|
-
</
|
|
498
|
-
|
|
499
|
-
<
|
|
500
|
-
<td>
|
|
501
|
-
<td>
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
<td
|
|
505
|
-
</tr>
|
|
506
|
-
<tr>
|
|
507
|
-
<td
|
|
508
|
-
<td>
|
|
509
|
-
|
|
510
|
-
<td>
|
|
511
|
-
|
|
512
|
-
<
|
|
513
|
-
</
|
|
514
|
-
<
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
<td>
|
|
518
|
-
|
|
519
|
-
<
|
|
520
|
-
<td>
|
|
521
|
-
|
|
522
|
-
|
|
543
|
+
<thead>
|
|
544
|
+
<tr>
|
|
545
|
+
<th>Algorithm</th>
|
|
546
|
+
<th>Function Description</th>
|
|
547
|
+
<th>Iteration Type</th>
|
|
548
|
+
</tr>
|
|
549
|
+
</thead>
|
|
550
|
+
<tbody>
|
|
551
|
+
<tr>
|
|
552
|
+
<td>Binary Tree DFS</td>
|
|
553
|
+
<td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
|
|
554
|
+
and then the right subtree, using recursion.
|
|
555
|
+
</td>
|
|
556
|
+
<td>Recursion + Iteration</td>
|
|
557
|
+
</tr>
|
|
558
|
+
<tr>
|
|
559
|
+
<td>Binary Tree BFS</td>
|
|
560
|
+
<td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
|
|
561
|
+
from left to right.
|
|
562
|
+
</td>
|
|
563
|
+
<td>Iteration</td>
|
|
564
|
+
</tr>
|
|
565
|
+
<tr>
|
|
566
|
+
<td>Graph DFS</td>
|
|
567
|
+
<td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
|
|
568
|
+
possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
|
|
569
|
+
</td>
|
|
570
|
+
<td>Recursion + Iteration</td>
|
|
571
|
+
</tr>
|
|
572
|
+
<tr>
|
|
573
|
+
<td>Binary Tree Morris</td>
|
|
574
|
+
<td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
|
|
575
|
+
traversal without additional stack or recursion.
|
|
576
|
+
</td>
|
|
577
|
+
<td>Iteration</td>
|
|
578
|
+
</tr>
|
|
579
|
+
<tr>
|
|
580
|
+
<td>Graph BFS</td>
|
|
581
|
+
<td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
|
|
582
|
+
to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
|
|
583
|
+
</td>
|
|
584
|
+
<td>Recursion + Iteration</td>
|
|
585
|
+
</tr>
|
|
586
|
+
<tr>
|
|
587
|
+
<td>Graph Tarjan's Algorithm</td>
|
|
588
|
+
<td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
|
|
589
|
+
<td>Recursion</td>
|
|
590
|
+
</tr>
|
|
591
|
+
<tr>
|
|
592
|
+
<td>Graph Bellman-Ford Algorithm</td>
|
|
593
|
+
<td>Finding the shortest paths from a single source, can handle negative weight edges</td>
|
|
594
|
+
<td>Iteration</td>
|
|
595
|
+
</tr>
|
|
596
|
+
<tr>
|
|
597
|
+
<td>Graph Dijkstra's Algorithm</td>
|
|
598
|
+
<td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
|
|
599
|
+
<td>Iteration</td>
|
|
600
|
+
</tr>
|
|
601
|
+
<tr>
|
|
602
|
+
<td>Graph Floyd-Warshall Algorithm</td>
|
|
603
|
+
<td>Finding the shortest paths between all pairs of nodes</td>
|
|
604
|
+
<td>Iteration</td>
|
|
605
|
+
</tr>
|
|
606
|
+
<tr>
|
|
607
|
+
<td>Graph getCycles</td>
|
|
608
|
+
<td>Find all cycles in a graph or detect the presence of cycles.</td>
|
|
609
|
+
<td>Recursion</td>
|
|
610
|
+
</tr>
|
|
611
|
+
<tr>
|
|
612
|
+
<td>Graph getCutVertexes</td>
|
|
613
|
+
<td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
|
|
614
|
+
the graph.
|
|
615
|
+
</td>
|
|
616
|
+
<td>Recursion</td>
|
|
617
|
+
</tr>
|
|
618
|
+
<tr>
|
|
619
|
+
<td>Graph getSCCs</td>
|
|
620
|
+
<td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
|
|
621
|
+
</td>
|
|
622
|
+
<td>Recursion</td>
|
|
623
|
+
</tr>
|
|
624
|
+
<tr>
|
|
625
|
+
<td>Graph getBridges</td>
|
|
626
|
+
<td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
|
|
627
|
+
graph.
|
|
628
|
+
</td>
|
|
629
|
+
<td>Recursion</td>
|
|
630
|
+
</tr>
|
|
631
|
+
<tr>
|
|
632
|
+
<td>Graph topologicalSort</td>
|
|
633
|
+
<td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
|
|
634
|
+
directed edges go from earlier nodes to later nodes.
|
|
635
|
+
</td>
|
|
636
|
+
<td>Recursion</td>
|
|
637
|
+
</tr>
|
|
638
|
+
</tbody>
|
|
523
639
|
</table>
|
|
524
640
|
|
|
525
|
-
|
|
526
|
-
|
|
641
|
+
## Software Engineering Design Standards
|
|
527
642
|
<table>
|
|
528
|
-
<
|
|
529
|
-
<
|
|
530
|
-
<th>
|
|
531
|
-
|
|
532
|
-
<
|
|
533
|
-
<
|
|
534
|
-
<
|
|
535
|
-
|
|
536
|
-
<
|
|
537
|
-
</
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
<tr>
|
|
541
|
-
<td
|
|
542
|
-
<td>
|
|
543
|
-
|
|
544
|
-
<
|
|
545
|
-
<td>
|
|
546
|
-
<td>
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
<
|
|
550
|
-
<td
|
|
551
|
-
|
|
552
|
-
<
|
|
553
|
-
<td>
|
|
554
|
-
<td>
|
|
555
|
-
|
|
556
|
-
<
|
|
557
|
-
</
|
|
558
|
-
<
|
|
559
|
-
|
|
560
|
-
<
|
|
561
|
-
<td>
|
|
562
|
-
<td>
|
|
563
|
-
|
|
564
|
-
<
|
|
565
|
-
<td
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
<
|
|
569
|
-
<td>
|
|
570
|
-
<td>
|
|
571
|
-
|
|
572
|
-
<td>1</td>
|
|
573
|
-
<td>No</td>
|
|
574
|
-
<td></td>
|
|
575
|
-
</tr>
|
|
576
|
-
<tr>
|
|
577
|
-
<td><strong>Merge sort</strong></td>
|
|
578
|
-
<td>n log(n)</td>
|
|
579
|
-
<td>n log(n)</td>
|
|
580
|
-
<td>n log(n)</td>
|
|
581
|
-
<td>n</td>
|
|
582
|
-
<td>Yes</td>
|
|
583
|
-
<td></td>
|
|
584
|
-
</tr>
|
|
585
|
-
<tr>
|
|
586
|
-
<td><strong>Quick sort</strong></td>
|
|
587
|
-
<td>n log(n)</td>
|
|
588
|
-
<td>n log(n)</td>
|
|
589
|
-
<td>n<sup>2</sup></td>
|
|
590
|
-
<td>log(n)</td>
|
|
591
|
-
<td>No</td>
|
|
592
|
-
<td>Quicksort is usually done in-place with O(log(n)) stack space</td>
|
|
593
|
-
</tr>
|
|
594
|
-
<tr>
|
|
595
|
-
<td><strong>Shell sort</strong></td>
|
|
596
|
-
<td>n log(n)</td>
|
|
597
|
-
<td>depends on gap sequence</td>
|
|
598
|
-
<td>n (log(n))<sup>2</sup></td>
|
|
599
|
-
<td>1</td>
|
|
600
|
-
<td>No</td>
|
|
601
|
-
<td></td>
|
|
602
|
-
</tr>
|
|
603
|
-
<tr>
|
|
604
|
-
<td><strong>Counting sort</strong></td>
|
|
605
|
-
<td>n + r</td>
|
|
606
|
-
<td>n + r</td>
|
|
607
|
-
<td>n + r</td>
|
|
608
|
-
<td>n + r</td>
|
|
609
|
-
<td>Yes</td>
|
|
610
|
-
<td>r - biggest number in array</td>
|
|
611
|
-
</tr>
|
|
612
|
-
<tr>
|
|
613
|
-
<td><strong>Radix sort</strong></td>
|
|
614
|
-
<td>n * k</td>
|
|
615
|
-
<td>n * k</td>
|
|
616
|
-
<td>n * k</td>
|
|
617
|
-
<td>n + k</td>
|
|
618
|
-
<td>Yes</td>
|
|
619
|
-
<td>k - length of longest key</td>
|
|
620
|
-
</tr>
|
|
621
|
-
</tbody>
|
|
643
|
+
<tr>
|
|
644
|
+
<th>Principle</th>
|
|
645
|
+
<th>Description</th>
|
|
646
|
+
</tr>
|
|
647
|
+
<tr>
|
|
648
|
+
<td>Practicality</td>
|
|
649
|
+
<td>Follows ES6 and ESNext standards, offering unified and considerate optional parameters, and simplifies method names.</td>
|
|
650
|
+
</tr>
|
|
651
|
+
<tr>
|
|
652
|
+
<td>Extensibility</td>
|
|
653
|
+
<td>Adheres to OOP (Object-Oriented Programming) principles, allowing inheritance for all data structures.</td>
|
|
654
|
+
</tr>
|
|
655
|
+
<tr>
|
|
656
|
+
<td>Modularization</td>
|
|
657
|
+
<td>Includes data structure modularization and independent NPM packages.</td>
|
|
658
|
+
</tr>
|
|
659
|
+
<tr>
|
|
660
|
+
<td>Efficiency</td>
|
|
661
|
+
<td>All methods provide time and space complexity, comparable to native JS performance.</td>
|
|
662
|
+
</tr>
|
|
663
|
+
<tr>
|
|
664
|
+
<td>Maintainability</td>
|
|
665
|
+
<td>Follows open-source community development standards, complete documentation, continuous integration, and adheres to TDD (Test-Driven Development) patterns.</td>
|
|
666
|
+
</tr>
|
|
667
|
+
<tr>
|
|
668
|
+
<td>Testability</td>
|
|
669
|
+
<td>Automated and customized unit testing, performance testing, and integration testing.</td>
|
|
670
|
+
</tr>
|
|
671
|
+
<tr>
|
|
672
|
+
<td>Portability</td>
|
|
673
|
+
<td>Plans for porting to Java, Python, and C++, currently achieved to 80%.</td>
|
|
674
|
+
</tr>
|
|
675
|
+
<tr>
|
|
676
|
+
<td>Reusability</td>
|
|
677
|
+
<td>Fully decoupled, minimized side effects, and adheres to OOP.</td>
|
|
678
|
+
</tr>
|
|
679
|
+
<tr>
|
|
680
|
+
<td>Security</td>
|
|
681
|
+
<td>Carefully designed security for member variables and methods. Read-write separation. Data structure software does not need to consider other security aspects.</td>
|
|
682
|
+
</tr>
|
|
683
|
+
<tr>
|
|
684
|
+
<td>Scalability</td>
|
|
685
|
+
<td>Data structure software does not involve load issues.</td>
|
|
686
|
+
</tr>
|
|
622
687
|
</table>
|
|
623
688
|
|
|
624
|
-

|
|
625
|
-
|
|
626
|
-

|
|
627
|
-
|
|
628
|
-

|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
689
|
|
|
634
690
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heap-typed",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.4",
|
|
4
4
|
"description": "Heap. Javascript & Typescript Data Structure.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -131,6 +131,6 @@
|
|
|
131
131
|
"typescript": "^4.9.5"
|
|
132
132
|
},
|
|
133
133
|
"dependencies": {
|
|
134
|
-
"data-structure-typed": "^1.47.
|
|
134
|
+
"data-structure-typed": "^1.47.4"
|
|
135
135
|
}
|
|
136
136
|
}
|