data-structure-typed 1.52.6 → 1.52.8
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 +33 -30
- package/benchmark/report.html +13 -13
- package/benchmark/report.json +156 -156
- package/dist/cjs/constants/index.d.ts +4 -0
- package/dist/cjs/constants/index.js +9 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/data-structures/base/iterable-element-base.d.ts +8 -1
- package/dist/cjs/data-structures/base/iterable-element-base.js +10 -1
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.d.ts +8 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.js +10 -10
- package/dist/cjs/data-structures/base/iterable-entry-base.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +31 -32
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +43 -44
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +23 -24
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +71 -64
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +2 -2
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +534 -402
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +668 -597
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +72 -65
- package/dist/cjs/data-structures/binary-tree/bst.js +115 -113
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +21 -24
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +40 -39
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/segment-tree.d.ts +2 -2
- package/dist/cjs/data-structures/binary-tree/segment-tree.js +2 -2
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +28 -31
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +44 -43
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +2 -2
- package/dist/cjs/data-structures/graph/abstract-graph.js +7 -4
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +2 -2
- package/dist/cjs/data-structures/graph/directed-graph.js +4 -2
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +2 -2
- package/dist/cjs/data-structures/hash/hash-map.d.ts +2 -2
- package/dist/cjs/data-structures/hash/hash-map.js +1 -1
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.js +3 -3
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +7 -7
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +2 -2
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +6 -6
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +2 -2
- package/dist/cjs/data-structures/matrix/matrix.d.ts +2 -2
- package/dist/cjs/data-structures/matrix/navigator.d.ts +2 -2
- package/dist/cjs/data-structures/matrix/navigator.js +4 -2
- package/dist/cjs/data-structures/matrix/navigator.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +3 -3
- package/dist/cjs/data-structures/queue/deque.js +29 -29
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +1 -1
- package/dist/cjs/data-structures/stack/stack.d.ts +2 -2
- package/dist/cjs/data-structures/trie/trie.d.ts +2 -2
- package/dist/cjs/data-structures/trie/trie.js +1 -1
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +2 -2
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -4
- 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/mjs/constants/index.d.ts +4 -0
- package/dist/mjs/constants/index.js +5 -0
- package/dist/mjs/data-structures/base/iterable-element-base.d.ts +8 -1
- package/dist/mjs/data-structures/base/iterable-element-base.js +10 -1
- package/dist/mjs/data-structures/base/iterable-entry-base.d.ts +8 -1
- package/dist/mjs/data-structures/base/iterable-entry-base.js +10 -10
- package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +31 -32
- package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.js +44 -44
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +23 -24
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +72 -64
- package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.js +2 -2
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +534 -402
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +667 -591
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +72 -65
- package/dist/mjs/data-structures/binary-tree/bst.js +116 -112
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +21 -24
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +41 -38
- package/dist/mjs/data-structures/binary-tree/segment-tree.d.ts +2 -2
- package/dist/mjs/data-structures/binary-tree/segment-tree.js +2 -2
- package/dist/mjs/data-structures/binary-tree/tree-multi-map.d.ts +28 -31
- package/dist/mjs/data-structures/binary-tree/tree-multi-map.js +45 -42
- package/dist/mjs/data-structures/graph/abstract-graph.d.ts +2 -2
- package/dist/mjs/data-structures/graph/abstract-graph.js +7 -4
- package/dist/mjs/data-structures/graph/directed-graph.d.ts +2 -2
- package/dist/mjs/data-structures/graph/directed-graph.js +4 -2
- package/dist/mjs/data-structures/graph/undirected-graph.d.ts +2 -2
- package/dist/mjs/data-structures/hash/hash-map.d.ts +2 -2
- package/dist/mjs/data-structures/hash/hash-map.js +1 -1
- package/dist/mjs/data-structures/heap/heap.js +3 -3
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +7 -7
- package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +2 -2
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js +6 -6
- package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +2 -2
- package/dist/mjs/data-structures/matrix/matrix.d.ts +2 -2
- package/dist/mjs/data-structures/matrix/navigator.d.ts +2 -2
- package/dist/mjs/data-structures/matrix/navigator.js +4 -2
- package/dist/mjs/data-structures/queue/deque.d.ts +3 -3
- package/dist/mjs/data-structures/queue/deque.js +29 -29
- package/dist/mjs/data-structures/queue/queue.d.ts +1 -1
- package/dist/mjs/data-structures/stack/stack.d.ts +2 -2
- package/dist/mjs/data-structures/trie/trie.d.ts +2 -2
- package/dist/mjs/data-structures/trie/trie.js +1 -1
- package/dist/mjs/index.d.ts +1 -0
- package/dist/mjs/index.js +1 -0
- package/dist/mjs/interfaces/binary-tree.d.ts +2 -2
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -4
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.js +1 -5
- package/dist/umd/data-structure-typed.js +1343 -1615
- package/dist/umd/data-structure-typed.min.js +10 -3
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/eslint.config.mjs +69 -0
- package/package.json +30 -28
- package/src/constants/index.ts +4 -0
- package/src/data-structures/base/iterable-element-base.ts +11 -1
- package/src/data-structures/base/iterable-entry-base.ts +11 -19
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +47 -50
- package/src/data-structures/binary-tree/avl-tree.ts +69 -71
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +2 -2
- package/src/data-structures/binary-tree/binary-tree.ts +697 -725
- package/src/data-structures/binary-tree/bst.ts +123 -129
- package/src/data-structures/binary-tree/rb-tree.ts +44 -46
- package/src/data-structures/binary-tree/segment-tree.ts +2 -2
- package/src/data-structures/binary-tree/tree-multi-map.ts +48 -49
- package/src/data-structures/graph/abstract-graph.ts +6 -6
- package/src/data-structures/graph/directed-graph.ts +4 -4
- package/src/data-structures/graph/undirected-graph.ts +2 -2
- package/src/data-structures/hash/hash-map.ts +3 -3
- package/src/data-structures/heap/heap.ts +3 -3
- package/src/data-structures/linked-list/doubly-linked-list.ts +9 -9
- package/src/data-structures/linked-list/singly-linked-list.ts +8 -8
- package/src/data-structures/linked-list/skip-linked-list.ts +2 -2
- package/src/data-structures/matrix/matrix.ts +2 -2
- package/src/data-structures/matrix/navigator.ts +4 -4
- package/src/data-structures/queue/deque.ts +31 -31
- package/src/data-structures/queue/queue.ts +1 -1
- package/src/data-structures/stack/stack.ts +2 -2
- package/src/data-structures/trie/trie.ts +3 -3
- package/src/index.ts +1 -0
- package/src/interfaces/binary-tree.ts +3 -3
- package/src/types/data-structures/binary-tree/binary-tree.ts +3 -5
- package/test/config.ts +1 -7
- package/test/integration/all-in-one.test.ts +2 -2
- package/test/integration/avl-tree.test.ts +2 -2
- package/test/integration/bst.test.ts +17 -16
- package/test/integration/heap.test.js +6 -1
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +39 -39
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +51 -26
- package/test/unit/data-structures/binary-tree/bst.test.ts +41 -13
- package/test/unit/data-structures/binary-tree/overall.test.ts +0 -6
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +6 -6
- package/test/unit/data-structures/binary-tree/segment-tree.test.ts +88 -34
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +42 -42
- package/test/unit/data-structures/graph/abstract-graph.test.ts +1 -1
- package/test/unit/data-structures/graph/directed-graph.test.ts +4 -4
- package/test/unit/data-structures/graph/undirected-graph.test.ts +14 -2
- package/test/unit/data-structures/hash/hash-map.test.ts +1 -1
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +1 -1
- package/test/unit/data-structures/matrix/navigator.test.ts +2 -2
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +4 -4
- package/test/unit/data-structures/stack/stack.test.ts +6 -0
- package/test/unit/unrestricted-interconversion.test.ts +24 -24
- package/test/utils/big-o.ts +5 -4
- package/.eslintrc.js +0 -64
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.52.
|
|
11
|
+
## [v1.52.8](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)
|
|
12
12
|
|
|
13
13
|
### Changes
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
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
16
|
|
|
17
|
+
> ***Our goal is to make every data structure as convenient and efficient as JavaScript's Array.***
|
|
18
|
+
|
|
17
19
|
## Installation and Usage
|
|
18
20
|
|
|
19
21
|
### npm
|
|
@@ -212,6 +214,7 @@ Performance surpasses that of native JS/TS
|
|
|
212
214
|
|
|
213
215
|
|
|
214
216
|
### Conciseness and uniformity
|
|
217
|
+
|
|
215
218
|
In [java.utils](), you need to memorize a table for all sequential data structures(Queue, Deque, LinkedList),
|
|
216
219
|
|
|
217
220
|
<table style="display: table; width:100%; table-layout: fixed;">
|
|
@@ -710,24 +713,24 @@ bst.print()
|
|
|
710
713
|
|
|
711
714
|
const objBST = new BST<number, { height: number, age: number }>();
|
|
712
715
|
|
|
713
|
-
objBST.add(11, { "name": "Pablo", "
|
|
714
|
-
objBST.add(3, { "name": "Kirk", "
|
|
716
|
+
objBST.add(11, { "name": "Pablo", "size": 15 });
|
|
717
|
+
objBST.add(3, { "name": "Kirk", "size": 1 });
|
|
715
718
|
|
|
716
719
|
objBST.addMany([15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5], [
|
|
717
|
-
{ "name": "Alice", "
|
|
718
|
-
{ "name": "Bob", "
|
|
719
|
-
{ "name": "Charlie", "
|
|
720
|
-
{ "name": "David", "
|
|
721
|
-
{ "name": "Emma", "
|
|
722
|
-
{ "name": "Frank", "
|
|
723
|
-
{ "name": "Grace", "
|
|
724
|
-
{ "name": "Hannah", "
|
|
725
|
-
{ "name": "Isaac", "
|
|
726
|
-
{ "name": "Jack", "
|
|
727
|
-
{ "name": "Katie", "
|
|
728
|
-
{ "name": "Liam", "
|
|
729
|
-
{ "name": "Mia", "
|
|
730
|
-
{ "name": "Noah", "
|
|
720
|
+
{ "name": "Alice", "size": 15 },
|
|
721
|
+
{ "name": "Bob", "size": 1 },
|
|
722
|
+
{ "name": "Charlie", "size": 8 },
|
|
723
|
+
{ "name": "David", "size": 13 },
|
|
724
|
+
{ "name": "Emma", "size": 16 },
|
|
725
|
+
{ "name": "Frank", "size": 2 },
|
|
726
|
+
{ "name": "Grace", "size": 6 },
|
|
727
|
+
{ "name": "Hannah", "size": 9 },
|
|
728
|
+
{ "name": "Isaac", "size": 12 },
|
|
729
|
+
{ "name": "Jack", "size": 14 },
|
|
730
|
+
{ "name": "Katie", "size": 4 },
|
|
731
|
+
{ "name": "Liam", "size": 7 },
|
|
732
|
+
{ "name": "Mia", "size": 10 },
|
|
733
|
+
{ "name": "Noah", "size": 5 }
|
|
731
734
|
]
|
|
732
735
|
);
|
|
733
736
|
|
|
@@ -823,43 +826,43 @@ Version 11.7.9
|
|
|
823
826
|
[//]: # (No deletion!!! Start of Replace Section)
|
|
824
827
|
<div class="json-to-html-collapse clearfix 0">
|
|
825
828
|
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
826
|
-
<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>
|
|
829
|
+
<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>6.49</td><td>154.00</td><td>1.90e-4</td></tr><tr><td>100,000 add & poll</td><td>35.79</td><td>27.94</td><td>0.01</td></tr></table></div>
|
|
827
830
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
828
831
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
829
|
-
<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>
|
|
832
|
+
<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.30</td><td>11.72</td><td>7.38e-4</td></tr><tr><td>100,000 add randomly</td><td>84.77</td><td>11.80</td><td>0.00</td></tr><tr><td>100,000 get</td><td>113.74</td><td>8.79</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>24.51</td><td>40.80</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>152.17</td><td>6.57</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>240.78</td><td>4.15</td><td>0.01</td></tr></table></div>
|
|
830
833
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
831
834
|
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
832
|
-
<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>
|
|
835
|
+
<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>44.16</td><td>22.64</td><td>0.01</td></tr><tr><td>100,000 push & shift</td><td>6.08</td><td>164.58</td><td>0.00</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2240.74</td><td>0.45</td><td>0.17</td></tr></table></div>
|
|
833
836
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
834
837
|
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
835
|
-
<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>
|
|
838
|
+
<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>20.75</td><td>48.19</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>26.85</td><td>37.24</td><td>0.00</td></tr><tr><td>1,000,000 push & shift</td><td>27.56</td><td>36.28</td><td>0.00</td></tr><tr><td>100,000 push & shift</td><td>2.61</td><td>382.75</td><td>4.11e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2388.65</td><td>0.42</td><td>0.15</td></tr><tr><td>100,000 unshift & shift</td><td>2.50</td><td>399.53</td><td>3.59e-4</td></tr><tr><td>Native JS Array 100,000 unshift & shift</td><td>4343.52</td><td>0.23</td><td>0.30</td></tr></table></div>
|
|
836
839
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
837
840
|
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
838
|
-
<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>
|
|
841
|
+
<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>87.12</td><td>11.48</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set</td><td>211.63</td><td>4.73</td><td>0.03</td></tr><tr><td>Native JS Set 1,000,000 add</td><td>167.62</td><td>5.97</td><td>0.01</td></tr><tr><td>1,000,000 set & get</td><td>78.91</td><td>12.67</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set & get</td><td>295.47</td><td>3.38</td><td>0.03</td></tr><tr><td>Native JS Set 1,000,000 add & has</td><td>267.22</td><td>3.74</td><td>0.07</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>378.26</td><td>2.64</td><td>0.06</td></tr><tr><td>Native JS Map 1,000,000 ObjKey set & get</td><td>344.04</td><td>2.91</td><td>0.06</td></tr><tr><td>Native JS Set 1,000,000 ObjKey add & has</td><td>277.87</td><td>3.60</td><td>0.04</td></tr></table></div>
|
|
839
842
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
840
843
|
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
841
|
-
<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>
|
|
844
|
+
<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>42.67</td><td>23.44</td><td>8.55e-4</td></tr><tr><td>100,000 getWords</td><td>82.51</td><td>12.12</td><td>0.00</td></tr></table></div>
|
|
842
845
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
843
846
|
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
844
|
-
<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>
|
|
847
|
+
<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>307.42</td><td>3.25</td><td>9.13e-4</td></tr><tr><td>100,000 add randomly</td><td>373.75</td><td>2.68</td><td>0.01</td></tr><tr><td>100,000 get</td><td>172.23</td><td>5.81</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>25.90</td><td>38.61</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>509.58</td><td>1.96</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>690.44</td><td>1.45</td><td>0.02</td></tr></table></div>
|
|
845
848
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
846
849
|
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree-overall</span></div>
|
|
847
|
-
<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 RBTree add randomly</td><td>
|
|
850
|
+
<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 RBTree add randomly</td><td>7.45</td><td>134.14</td><td>0.00</td></tr><tr><td>10,000 RBTree get randomly</td><td>13.03</td><td>76.74</td><td>1.43e-4</td></tr><tr><td>10,000 RBTree add & delete randomly</td><td>22.62</td><td>44.21</td><td>1.83e-4</td></tr><tr><td>10,000 AVLTree add randomly</td><td>28.44</td><td>35.16</td><td>2.71e-4</td></tr><tr><td>10,000 AVLTree get randomly</td><td>13.02</td><td>76.81</td><td>1.05e-4</td></tr><tr><td>10,000 AVLTree add & delete randomly</td><td>54.46</td><td>18.36</td><td>0.00</td></tr></table></div>
|
|
848
851
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
849
852
|
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
850
|
-
<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>
|
|
853
|
+
<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>1.01e+4</td><td>8.01e-7</td></tr><tr><td>1,000 addEdge</td><td>6.06</td><td>165.03</td><td>2.89e-4</td></tr><tr><td>1,000 getVertex</td><td>0.10</td><td>1.05e+4</td><td>9.35e-7</td></tr><tr><td>1,000 getEdge</td><td>23.80</td><td>42.02</td><td>0.00</td></tr><tr><td>tarjan</td><td>193.59</td><td>5.17</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>148.99</td><td>6.71</td><td>0.01</td></tr></table></div>
|
|
851
854
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
852
855
|
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
853
|
-
<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>
|
|
856
|
+
<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>191.05</td><td>5.23</td><td>0.04</td></tr><tr><td>1,000,000 unshift</td><td>186.38</td><td>5.37</td><td>0.06</td></tr><tr><td>1,000,000 unshift & shift</td><td>151.27</td><td>6.61</td><td>0.00</td></tr><tr><td>1,000,000 addBefore</td><td>267.57</td><td>3.74</td><td>0.07</td></tr></table></div>
|
|
854
857
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
855
858
|
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
856
|
-
<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 & shift</td><td>
|
|
859
|
+
<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 & shift</td><td>163.01</td><td>6.13</td><td>0.03</td></tr><tr><td>10,000 push & pop</td><td>246.05</td><td>4.06</td><td>0.04</td></tr><tr><td>10,000 addBefore</td><td>275.54</td><td>3.63</td><td>0.01</td></tr></table></div>
|
|
857
860
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
858
861
|
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
859
|
-
<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>
|
|
862
|
+
<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>30.54</td><td>32.75</td><td>0.00</td></tr><tr><td>100,000 add & poll</td><td>89.20</td><td>11.21</td><td>0.00</td></tr></table></div>
|
|
860
863
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
861
864
|
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
862
|
-
<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>
|
|
865
|
+
<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>40.42</td><td>24.74</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>47.90</td><td>20.88</td><td>0.01</td></tr></table></div>
|
|
863
866
|
</div>
|
|
864
867
|
|
|
865
868
|
[//]: # (No deletion!!! End of Replace Section)
|
|
@@ -1218,4 +1221,4 @@ const {
|
|
|
1218
1221
|
AVLTree, MinHeap, SinglyLinkedList, DirectedGraph, TreeMultiMap,
|
|
1219
1222
|
DirectedVertex, AVLTreeNode
|
|
1220
1223
|
} = dataStructureTyped;
|
|
1221
|
-
```
|
|
1224
|
+
```
|
package/benchmark/report.html
CHANGED
|
@@ -43,43 +43,43 @@
|
|
|
43
43
|
<body>
|
|
44
44
|
<div id="json-to-html"><div class="json-to-html-collapse clearfix 0">
|
|
45
45
|
<div class='collapsible level0' ><span class='json-to-html-label'>heap</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>100,000 add</td><td>
|
|
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>6.49</td><td>154.00</td><td>1.90e-4</td></tr><tr><td>100,000 add & poll</td><td>35.79</td><td>27.94</td><td>0.01</td></tr></table></div>
|
|
47
47
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
48
48
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-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>100,000 add</td><td>
|
|
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>100,000 add</td><td>85.30</td><td>11.72</td><td>7.38e-4</td></tr><tr><td>100,000 add randomly</td><td>84.77</td><td>11.80</td><td>0.00</td></tr><tr><td>100,000 get</td><td>113.74</td><td>8.79</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>24.51</td><td>40.80</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>152.17</td><td>6.57</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>240.78</td><td>4.15</td><td>0.01</td></tr></table></div>
|
|
50
50
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
51
51
|
<div class='collapsible level0' ><span class='json-to-html-label'>queue</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>1,000,000 push</td><td>
|
|
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>1,000,000 push</td><td>44.16</td><td>22.64</td><td>0.01</td></tr><tr><td>100,000 push & shift</td><td>6.08</td><td>164.58</td><td>0.00</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2240.74</td><td>0.45</td><td>0.17</td></tr></table></div>
|
|
53
53
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
54
54
|
<div class='collapsible level0' ><span class='json-to-html-label'>deque</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>1,000,000 push</td><td>
|
|
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>1,000,000 push</td><td>20.75</td><td>48.19</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>26.85</td><td>37.24</td><td>0.00</td></tr><tr><td>1,000,000 push & shift</td><td>27.56</td><td>36.28</td><td>0.00</td></tr><tr><td>100,000 push & shift</td><td>2.61</td><td>382.75</td><td>4.11e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2388.65</td><td>0.42</td><td>0.15</td></tr><tr><td>100,000 unshift & shift</td><td>2.50</td><td>399.53</td><td>3.59e-4</td></tr><tr><td>Native JS Array 100,000 unshift & shift</td><td>4343.52</td><td>0.23</td><td>0.30</td></tr></table></div>
|
|
56
56
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
57
57
|
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</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>1,000,000 set</td><td>
|
|
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>1,000,000 set</td><td>87.12</td><td>11.48</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set</td><td>211.63</td><td>4.73</td><td>0.03</td></tr><tr><td>Native JS Set 1,000,000 add</td><td>167.62</td><td>5.97</td><td>0.01</td></tr><tr><td>1,000,000 set & get</td><td>78.91</td><td>12.67</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set & get</td><td>295.47</td><td>3.38</td><td>0.03</td></tr><tr><td>Native JS Set 1,000,000 add & has</td><td>267.22</td><td>3.74</td><td>0.07</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>378.26</td><td>2.64</td><td>0.06</td></tr><tr><td>Native JS Map 1,000,000 ObjKey set & get</td><td>344.04</td><td>2.91</td><td>0.06</td></tr><tr><td>Native JS Set 1,000,000 ObjKey add & has</td><td>277.87</td><td>3.60</td><td>0.04</td></tr></table></div>
|
|
59
59
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
60
60
|
<div class='collapsible level0' ><span class='json-to-html-label'>trie</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>100,000 push</td><td>
|
|
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>100,000 push</td><td>42.67</td><td>23.44</td><td>8.55e-4</td></tr><tr><td>100,000 getWords</td><td>82.51</td><td>12.12</td><td>0.00</td></tr></table></div>
|
|
62
62
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
63
63
|
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</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>100,000 add</td><td>
|
|
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>100,000 add</td><td>307.42</td><td>3.25</td><td>9.13e-4</td></tr><tr><td>100,000 add randomly</td><td>373.75</td><td>2.68</td><td>0.01</td></tr><tr><td>100,000 get</td><td>172.23</td><td>5.81</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>25.90</td><td>38.61</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>509.58</td><td>1.96</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>690.44</td><td>1.45</td><td>0.02</td></tr></table></div>
|
|
65
65
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
66
66
|
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree-overall</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 RBTree add randomly</td><td>
|
|
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 RBTree add randomly</td><td>7.45</td><td>134.14</td><td>0.00</td></tr><tr><td>10,000 RBTree get randomly</td><td>13.03</td><td>76.74</td><td>1.43e-4</td></tr><tr><td>10,000 RBTree add & delete randomly</td><td>22.62</td><td>44.21</td><td>1.83e-4</td></tr><tr><td>10,000 AVLTree add randomly</td><td>28.44</td><td>35.16</td><td>2.71e-4</td></tr><tr><td>10,000 AVLTree get randomly</td><td>13.02</td><td>76.81</td><td>1.05e-4</td></tr><tr><td>10,000 AVLTree add & delete randomly</td><td>54.46</td><td>18.36</td><td>0.00</td></tr></table></div>
|
|
68
68
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
69
69
|
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</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 addVertex</td><td>0.10</td><td>
|
|
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 addVertex</td><td>0.10</td><td>1.01e+4</td><td>8.01e-7</td></tr><tr><td>1,000 addEdge</td><td>6.06</td><td>165.03</td><td>2.89e-4</td></tr><tr><td>1,000 getVertex</td><td>0.10</td><td>1.05e+4</td><td>9.35e-7</td></tr><tr><td>1,000 getEdge</td><td>23.80</td><td>42.02</td><td>0.00</td></tr><tr><td>tarjan</td><td>193.59</td><td>5.17</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>148.99</td><td>6.71</td><td>0.01</td></tr></table></div>
|
|
71
71
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
72
72
|
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-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>1,000,000 push</td><td>
|
|
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>1,000,000 push</td><td>191.05</td><td>5.23</td><td>0.04</td></tr><tr><td>1,000,000 unshift</td><td>186.38</td><td>5.37</td><td>0.06</td></tr><tr><td>1,000,000 unshift & shift</td><td>151.27</td><td>6.61</td><td>0.00</td></tr><tr><td>1,000,000 addBefore</td><td>267.57</td><td>3.74</td><td>0.07</td></tr></table></div>
|
|
74
74
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
75
75
|
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</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>1,000,000 push & shift</td><td>
|
|
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>1,000,000 push & shift</td><td>163.01</td><td>6.13</td><td>0.03</td></tr><tr><td>10,000 push & pop</td><td>246.05</td><td>4.06</td><td>0.04</td></tr><tr><td>10,000 addBefore</td><td>275.54</td><td>3.63</td><td>0.01</td></tr></table></div>
|
|
77
77
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
78
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</td><td>
|
|
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</td><td>30.54</td><td>32.75</td><td>0.00</td></tr><tr><td>100,000 add & poll</td><td>89.20</td><td>11.21</td><td>0.00</td></tr></table></div>
|
|
80
80
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
81
81
|
<div class='collapsible level0' ><span class='json-to-html-label'>stack</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>
|
|
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>40.42</td><td>24.74</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>47.90</td><td>20.88</td><td>0.01</td></tr></table></div>
|
|
83
83
|
</div>
|
|
84
84
|
|
|
85
85
|
</div>
|