data-structure-typed 1.46.7 → 1.46.9
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 +140 -110
- package/benchmark/report.html +1 -46
- package/benchmark/report.json +11 -422
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +4 -2
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +10 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +19 -13
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +121 -55
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +10 -9
- package/dist/cjs/data-structures/binary-tree/bst.js +16 -14
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +7 -5
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +32 -23
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +5 -3
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js +11 -2
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +3 -3
- package/dist/cjs/types/common.d.ts +5 -4
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +2 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +3 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js +0 -6
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +2 -1
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +2 -1
- package/dist/cjs/types/data-structures/binary-tree/tree-multimap.d.ts +2 -1
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +4 -2
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +11 -0
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +19 -13
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +122 -55
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +10 -9
- package/dist/mjs/data-structures/binary-tree/bst.js +17 -14
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +7 -5
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +34 -24
- package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +5 -3
- package/dist/mjs/data-structures/binary-tree/tree-multimap.js +12 -2
- package/dist/mjs/interfaces/binary-tree.d.ts +3 -3
- package/dist/mjs/types/common.d.ts +5 -4
- package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +2 -1
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +3 -1
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.js +0 -6
- package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +2 -1
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +2 -1
- package/dist/mjs/types/data-structures/binary-tree/tree-multimap.d.ts +2 -1
- package/dist/umd/data-structure-typed.js +198 -103
- package/dist/umd/data-structure-typed.min.js +4 -1
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +7 -6
- package/src/data-structures/binary-tree/avl-tree.ts +17 -5
- package/src/data-structures/binary-tree/binary-tree.ts +143 -62
- package/src/data-structures/binary-tree/bst.ts +23 -19
- package/src/data-structures/binary-tree/rb-tree.ts +38 -27
- package/src/data-structures/binary-tree/tree-multimap.ts +19 -6
- package/src/interfaces/binary-tree.ts +3 -3
- package/src/types/common.ts +2 -5
- package/src/types/data-structures/binary-tree/avl-tree.ts +5 -1
- package/src/types/data-structures/binary-tree/binary-tree.ts +5 -7
- package/src/types/data-structures/binary-tree/bst.ts +3 -1
- package/src/types/data-structures/binary-tree/rb-tree.ts +3 -1
- package/src/types/data-structures/binary-tree/tree-multimap.ts +3 -1
- package/test/integration/index.html +30 -28
- package/test/performance/data-structures/binary-tree/rb-tree.test.ts +7 -0
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +57 -1
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +62 -7
- package/test/unit/data-structures/binary-tree/bst.test.ts +56 -1
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +98 -42
- package/tsconfig-base.json +2 -1
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.46.
|
|
11
|
+
## [v1.46.9](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
|
|
12
12
|
|
|
13
13
|
### Changes
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
Data Structures of Javascript & TypeScript.
|
|
13
13
|
|
|
14
|
-
Do you envy C++ with [STL](), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
|
|
14
|
+
Do you envy C++ with [STL]() (std::), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
|
|
15
15
|
|
|
16
16
|
Now you can use this library in Node.js and browser environments in CommonJS(require export.modules = ), ESModule(import export), Typescript(import export), UMD(var Queue = dataStructureTyped.Queue)
|
|
17
17
|
|
|
@@ -24,13 +24,12 @@ Now you can use this library in Node.js and browser environments in CommonJS(req
|
|
|
24
24
|
|
|
25
25
|
[//]: # ()
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
## Installation and Usage
|
|
29
28
|
|
|
30
29
|
### npm
|
|
31
30
|
|
|
32
31
|
```bash
|
|
33
|
-
npm i data-structure-typed
|
|
32
|
+
npm i --save data-structure-typed
|
|
34
33
|
```
|
|
35
34
|
|
|
36
35
|
### yarn
|
|
@@ -117,8 +116,6 @@ const {
|
|
|
117
116
|
|
|
118
117
|

|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
119
|
## Code Snippets
|
|
123
120
|
|
|
124
121
|
### Binary Search Tree (BST) snippet
|
|
@@ -275,107 +272,6 @@ const dijkstraResult = graph.dijkstra('A');
|
|
|
275
272
|
Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', 'D']
|
|
276
273
|
```
|
|
277
274
|
|
|
278
|
-
## Built-in classic algorithms
|
|
279
|
-
|
|
280
|
-
<table>
|
|
281
|
-
<thead>
|
|
282
|
-
<tr>
|
|
283
|
-
<th>Algorithm</th>
|
|
284
|
-
<th>Function Description</th>
|
|
285
|
-
<th>Iteration Type</th>
|
|
286
|
-
</tr>
|
|
287
|
-
</thead>
|
|
288
|
-
<tbody>
|
|
289
|
-
<tr>
|
|
290
|
-
<td>Binary Tree DFS</td>
|
|
291
|
-
<td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
|
|
292
|
-
and then the right subtree, using recursion.
|
|
293
|
-
</td>
|
|
294
|
-
<td>Recursion + Iteration</td>
|
|
295
|
-
</tr>
|
|
296
|
-
<tr>
|
|
297
|
-
<td>Binary Tree BFS</td>
|
|
298
|
-
<td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
|
|
299
|
-
from left to right.
|
|
300
|
-
</td>
|
|
301
|
-
<td>Iteration</td>
|
|
302
|
-
</tr>
|
|
303
|
-
<tr>
|
|
304
|
-
<td>Graph DFS</td>
|
|
305
|
-
<td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
|
|
306
|
-
possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
|
|
307
|
-
</td>
|
|
308
|
-
<td>Recursion + Iteration</td>
|
|
309
|
-
</tr>
|
|
310
|
-
<tr>
|
|
311
|
-
<td>Binary Tree Morris</td>
|
|
312
|
-
<td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
|
|
313
|
-
traversal without additional stack or recursion.
|
|
314
|
-
</td>
|
|
315
|
-
<td>Iteration</td>
|
|
316
|
-
</tr>
|
|
317
|
-
<tr>
|
|
318
|
-
<td>Graph BFS</td>
|
|
319
|
-
<td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
|
|
320
|
-
to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
|
|
321
|
-
</td>
|
|
322
|
-
<td>Recursion + Iteration</td>
|
|
323
|
-
</tr>
|
|
324
|
-
<tr>
|
|
325
|
-
<td>Graph Tarjan's Algorithm</td>
|
|
326
|
-
<td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
|
|
327
|
-
<td>Recursion</td>
|
|
328
|
-
</tr>
|
|
329
|
-
<tr>
|
|
330
|
-
<td>Graph Bellman-Ford Algorithm</td>
|
|
331
|
-
<td>Finding the shortest paths from a single source, can handle negative weight edges</td>
|
|
332
|
-
<td>Iteration</td>
|
|
333
|
-
</tr>
|
|
334
|
-
<tr>
|
|
335
|
-
<td>Graph Dijkstra's Algorithm</td>
|
|
336
|
-
<td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
|
|
337
|
-
<td>Iteration</td>
|
|
338
|
-
</tr>
|
|
339
|
-
<tr>
|
|
340
|
-
<td>Graph Floyd-Warshall Algorithm</td>
|
|
341
|
-
<td>Finding the shortest paths between all pairs of nodes</td>
|
|
342
|
-
<td>Iteration</td>
|
|
343
|
-
</tr>
|
|
344
|
-
<tr>
|
|
345
|
-
<td>Graph getCycles</td>
|
|
346
|
-
<td>Find all cycles in a graph or detect the presence of cycles.</td>
|
|
347
|
-
<td>Recursion</td>
|
|
348
|
-
</tr>
|
|
349
|
-
<tr>
|
|
350
|
-
<td>Graph getCutVertexes</td>
|
|
351
|
-
<td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
|
|
352
|
-
the graph.
|
|
353
|
-
</td>
|
|
354
|
-
<td>Recursion</td>
|
|
355
|
-
</tr>
|
|
356
|
-
<tr>
|
|
357
|
-
<td>Graph getSCCs</td>
|
|
358
|
-
<td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
|
|
359
|
-
</td>
|
|
360
|
-
<td>Recursion</td>
|
|
361
|
-
</tr>
|
|
362
|
-
<tr>
|
|
363
|
-
<td>Graph getBridges</td>
|
|
364
|
-
<td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
|
|
365
|
-
graph.
|
|
366
|
-
</td>
|
|
367
|
-
<td>Recursion</td>
|
|
368
|
-
</tr>
|
|
369
|
-
<tr>
|
|
370
|
-
<td>Graph topologicalSort</td>
|
|
371
|
-
<td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
|
|
372
|
-
directed edges go from earlier nodes to later nodes.
|
|
373
|
-
</td>
|
|
374
|
-
<td>Recursion</td>
|
|
375
|
-
</tr>
|
|
376
|
-
</tbody>
|
|
377
|
-
</table>
|
|
378
|
-
|
|
379
275
|
## API docs & Examples
|
|
380
276
|
|
|
381
277
|
[API Docs](https://data-structure-typed-docs.vercel.app)
|
|
@@ -568,11 +464,8 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
|
|
|
568
464
|
</tbody>
|
|
569
465
|
</table>
|
|
570
466
|
|
|
571
|
-
|
|
572
|
-
|
|
573
467
|
## Standard library data structure comparison
|
|
574
468
|
|
|
575
|
-
|
|
576
469
|
<table>
|
|
577
470
|
<thead>
|
|
578
471
|
<tr>
|
|
@@ -754,7 +647,6 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
|
|
|
754
647
|
</tbody>
|
|
755
648
|
</table>
|
|
756
649
|
|
|
757
|
-
|
|
758
650
|
## Benchmark
|
|
759
651
|
|
|
760
652
|
[//]: # (No deletion!!! Start of Replace Section)
|
|
@@ -810,6 +702,106 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
|
|
|
810
702
|
|
|
811
703
|
[//]: # (No deletion!!! End of Replace Section)
|
|
812
704
|
|
|
705
|
+
## Built-in classic algorithms
|
|
706
|
+
|
|
707
|
+
<table>
|
|
708
|
+
<thead>
|
|
709
|
+
<tr>
|
|
710
|
+
<th>Algorithm</th>
|
|
711
|
+
<th>Function Description</th>
|
|
712
|
+
<th>Iteration Type</th>
|
|
713
|
+
</tr>
|
|
714
|
+
</thead>
|
|
715
|
+
<tbody>
|
|
716
|
+
<tr>
|
|
717
|
+
<td>Binary Tree DFS</td>
|
|
718
|
+
<td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
|
|
719
|
+
and then the right subtree, using recursion.
|
|
720
|
+
</td>
|
|
721
|
+
<td>Recursion + Iteration</td>
|
|
722
|
+
</tr>
|
|
723
|
+
<tr>
|
|
724
|
+
<td>Binary Tree BFS</td>
|
|
725
|
+
<td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
|
|
726
|
+
from left to right.
|
|
727
|
+
</td>
|
|
728
|
+
<td>Iteration</td>
|
|
729
|
+
</tr>
|
|
730
|
+
<tr>
|
|
731
|
+
<td>Graph DFS</td>
|
|
732
|
+
<td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
|
|
733
|
+
possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
|
|
734
|
+
</td>
|
|
735
|
+
<td>Recursion + Iteration</td>
|
|
736
|
+
</tr>
|
|
737
|
+
<tr>
|
|
738
|
+
<td>Binary Tree Morris</td>
|
|
739
|
+
<td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
|
|
740
|
+
traversal without additional stack or recursion.
|
|
741
|
+
</td>
|
|
742
|
+
<td>Iteration</td>
|
|
743
|
+
</tr>
|
|
744
|
+
<tr>
|
|
745
|
+
<td>Graph BFS</td>
|
|
746
|
+
<td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
|
|
747
|
+
to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
|
|
748
|
+
</td>
|
|
749
|
+
<td>Recursion + Iteration</td>
|
|
750
|
+
</tr>
|
|
751
|
+
<tr>
|
|
752
|
+
<td>Graph Tarjan's Algorithm</td>
|
|
753
|
+
<td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
|
|
754
|
+
<td>Recursion</td>
|
|
755
|
+
</tr>
|
|
756
|
+
<tr>
|
|
757
|
+
<td>Graph Bellman-Ford Algorithm</td>
|
|
758
|
+
<td>Finding the shortest paths from a single source, can handle negative weight edges</td>
|
|
759
|
+
<td>Iteration</td>
|
|
760
|
+
</tr>
|
|
761
|
+
<tr>
|
|
762
|
+
<td>Graph Dijkstra's Algorithm</td>
|
|
763
|
+
<td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
|
|
764
|
+
<td>Iteration</td>
|
|
765
|
+
</tr>
|
|
766
|
+
<tr>
|
|
767
|
+
<td>Graph Floyd-Warshall Algorithm</td>
|
|
768
|
+
<td>Finding the shortest paths between all pairs of nodes</td>
|
|
769
|
+
<td>Iteration</td>
|
|
770
|
+
</tr>
|
|
771
|
+
<tr>
|
|
772
|
+
<td>Graph getCycles</td>
|
|
773
|
+
<td>Find all cycles in a graph or detect the presence of cycles.</td>
|
|
774
|
+
<td>Recursion</td>
|
|
775
|
+
</tr>
|
|
776
|
+
<tr>
|
|
777
|
+
<td>Graph getCutVertexes</td>
|
|
778
|
+
<td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
|
|
779
|
+
the graph.
|
|
780
|
+
</td>
|
|
781
|
+
<td>Recursion</td>
|
|
782
|
+
</tr>
|
|
783
|
+
<tr>
|
|
784
|
+
<td>Graph getSCCs</td>
|
|
785
|
+
<td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
|
|
786
|
+
</td>
|
|
787
|
+
<td>Recursion</td>
|
|
788
|
+
</tr>
|
|
789
|
+
<tr>
|
|
790
|
+
<td>Graph getBridges</td>
|
|
791
|
+
<td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
|
|
792
|
+
graph.
|
|
793
|
+
</td>
|
|
794
|
+
<td>Recursion</td>
|
|
795
|
+
</tr>
|
|
796
|
+
<tr>
|
|
797
|
+
<td>Graph topologicalSort</td>
|
|
798
|
+
<td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
|
|
799
|
+
directed edges go from earlier nodes to later nodes.
|
|
800
|
+
</td>
|
|
801
|
+
<td>Recursion</td>
|
|
802
|
+
</tr>
|
|
803
|
+
</tbody>
|
|
804
|
+
</table>
|
|
813
805
|
|
|
814
806
|
## Software Engineering Design Standards
|
|
815
807
|
<table>
|
|
@@ -858,3 +850,41 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
|
|
|
858
850
|
<td>Data structure software does not involve load issues.</td>
|
|
859
851
|
</tr>
|
|
860
852
|
</table>
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
856
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
857
|
+
|
|
858
|
+
- [Installation and Usage](#installation-and-usage)
|
|
859
|
+
- [npm](#npm)
|
|
860
|
+
- [yarn](#yarn)
|
|
861
|
+
- [CDN](#cdn)
|
|
862
|
+
- [development](#development)
|
|
863
|
+
- [production](#production)
|
|
864
|
+
- [Vivid Examples](#vivid-examples)
|
|
865
|
+
- [Binary Tree](#binary-tree)
|
|
866
|
+
- [Binary Tree DFS](#binary-tree-dfs)
|
|
867
|
+
- [AVL Tree](#avl-tree)
|
|
868
|
+
- [Tree Multi Map](#tree-multi-map)
|
|
869
|
+
- [Matrix](#matrix)
|
|
870
|
+
- [Directed Graph](#directed-graph)
|
|
871
|
+
- [Map Graph](#map-graph)
|
|
872
|
+
- [Code Snippets](#code-snippets)
|
|
873
|
+
- [Binary Search Tree (BST) snippet](#binary-search-tree-bst-snippet)
|
|
874
|
+
- [TS](#ts)
|
|
875
|
+
- [JS](#js)
|
|
876
|
+
- [AVLTree snippet](#avltree-snippet)
|
|
877
|
+
- [TS](#ts-1)
|
|
878
|
+
- [JS](#js-1)
|
|
879
|
+
- [Directed Graph simple snippet](#directed-graph-simple-snippet)
|
|
880
|
+
- [TS or JS](#ts-or-js)
|
|
881
|
+
- [Undirected Graph snippet](#undirected-graph-snippet)
|
|
882
|
+
- [TS or JS](#ts-or-js-1)
|
|
883
|
+
- [API docs & Examples](#api-docs--examples)
|
|
884
|
+
- [Data Structures](#data-structures)
|
|
885
|
+
- [Standard library data structure comparison](#standard-library-data-structure-comparison)
|
|
886
|
+
- [Benchmark](#benchmark)
|
|
887
|
+
- [Built-in classic algorithms](#built-in-classic-algorithms)
|
|
888
|
+
- [Software Engineering Design Standards](#software-engineering-design-standards)
|
|
889
|
+
|
|
890
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
package/benchmark/report.html
CHANGED
|
@@ -42,53 +42,8 @@
|
|
|
42
42
|
</head>
|
|
43
43
|
<body>
|
|
44
44
|
<div id="json-to-html"><div class="json-to-html-collapse clearfix 0">
|
|
45
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
46
|
-
<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>
|
|
47
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
48
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
49
|
-
<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>
|
|
50
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
51
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
52
|
-
<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>
|
|
53
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
54
45
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
55
|
-
<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>
|
|
56
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
57
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>comparison</span></div>
|
|
58
|
-
<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>
|
|
59
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
60
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
61
|
-
<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>
|
|
62
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
63
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
64
|
-
<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>
|
|
65
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
66
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
67
|
-
<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>
|
|
68
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
69
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
70
|
-
<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>
|
|
71
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
72
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
73
|
-
<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>
|
|
74
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
75
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
76
|
-
<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>
|
|
77
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
78
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
79
|
-
<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>
|
|
80
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
81
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
82
|
-
<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>
|
|
83
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
84
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
85
|
-
<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>
|
|
86
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
87
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
88
|
-
<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>
|
|
89
|
-
</div><div class="json-to-html-collapse clearfix 0">
|
|
90
|
-
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
91
|
-
<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>
|
|
46
|
+
<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>77.77</td><td>12.86</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>210.72</td><td>4.75</td><td>0.01</td></tr><tr><td>100,000 getNode</td><td>68.17</td><td>14.67</td><td>0.00</td></tr><tr><td>100,000 add && iterator</td><td>113.76</td><td>8.79</td><td>0.01</td></tr></table></div>
|
|
92
47
|
</div>
|
|
93
48
|
|
|
94
49
|
</div>
|