data-structure-typed 1.49.2 → 1.49.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/CHANGELOG.md +1 -1
- package/README.md +69 -66
- package/README_zh-CN.md +43 -48
- package/benchmark/report.html +16 -16
- package/benchmark/report.json +187 -187
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +8 -17
- package/dist/cjs/data-structures/graph/abstract-graph.js +43 -29
- 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 +6 -2
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.js +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +43 -43
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +49 -49
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- 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 +25 -25
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +36 -36
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +33 -33
- package/dist/cjs/data-structures/queue/queue.js +40 -40
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +1 -1
- package/dist/mjs/data-structures/graph/abstract-graph.d.ts +8 -17
- package/dist/mjs/data-structures/graph/abstract-graph.js +43 -29
- package/dist/mjs/data-structures/graph/directed-graph.d.ts +2 -2
- package/dist/mjs/data-structures/graph/directed-graph.js +6 -2
- package/dist/mjs/data-structures/graph/undirected-graph.d.ts +1 -1
- package/dist/mjs/data-structures/graph/undirected-graph.js +1 -1
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +43 -43
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +47 -47
- package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +25 -25
- package/dist/mjs/data-structures/linked-list/skip-linked-list.js +36 -36
- package/dist/mjs/data-structures/queue/queue.d.ts +33 -33
- package/dist/mjs/data-structures/queue/queue.js +39 -39
- package/dist/umd/data-structure-typed.js +176 -158
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +1 -1
- package/src/data-structures/binary-tree/binary-tree.ts +1 -1
- package/src/data-structures/graph/abstract-graph.ts +56 -27
- package/src/data-structures/graph/directed-graph.ts +10 -5
- package/src/data-structures/graph/undirected-graph.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +53 -53
- package/src/data-structures/linked-list/singly-linked-list.ts +2 -3
- package/src/data-structures/linked-list/skip-linked-list.ts +40 -40
- package/src/data-structures/queue/queue.ts +45 -45
- package/test/performance/data-structures/comparison/comparison.test.ts +12 -12
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +16 -27
- package/test/performance/data-structures/linked-list/singly-linked-list.test.ts +4 -12
- package/test/performance/data-structures/queue/deque.test.ts +8 -8
- package/test/performance/data-structures/queue/queue.test.ts +5 -5
- package/test/performance/data-structures/stack/stack.test.ts +11 -11
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +15 -0
- package/test/unit/data-structures/graph/abstract-graph.test.ts +12 -1
- package/test/unit/data-structures/graph/directed-graph.test.ts +63 -5
- package/test/unit/data-structures/graph/undirected-graph.test.ts +61 -4
- package/test/unit/data-structures/hash/hash-map.test.ts +21 -0
- package/test/unit/data-structures/heap/heap.test.ts +6 -1
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +27 -0
- package/test/utils/big-o.ts +14 -14
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.49.
|
|
11
|
+
## [v1.49.4](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
|
|
12
12
|
|
|
13
13
|
### Changes
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -196,10 +196,54 @@ our [visual tool](https://github.com/zrwusa/vivid-algorithm)
|
|
|
196
196
|
|
|
197
197
|
## Code Snippets
|
|
198
198
|
|
|
199
|
-
###
|
|
199
|
+
### RedBlackTree snippet
|
|
200
200
|
|
|
201
201
|
#### TS
|
|
202
202
|
|
|
203
|
+
```ts
|
|
204
|
+
import {RedBlackTree} from 'data-structure-typed';
|
|
205
|
+
|
|
206
|
+
const rbTree = new RedBlackTree<number>();
|
|
207
|
+
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
208
|
+
rbTree.isAVLBalanced(); // true
|
|
209
|
+
rbTree.delete(10);
|
|
210
|
+
rbTree.isAVLBalanced(); // true
|
|
211
|
+
rbTree.print()
|
|
212
|
+
// ___6________
|
|
213
|
+
// / \
|
|
214
|
+
// ___4_ ___11________
|
|
215
|
+
// / \ / \
|
|
216
|
+
// _2_ 5 _8_ ____14__
|
|
217
|
+
// / \ / \ / \
|
|
218
|
+
// 1 3 7 9 12__ 15__
|
|
219
|
+
// \ \
|
|
220
|
+
// 13 16
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### JS
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
import {RedBlackTree} from 'data-structure-typed';
|
|
227
|
+
|
|
228
|
+
const rbTree = new RedBlackTree();
|
|
229
|
+
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
230
|
+
rbTree.isAVLBalanced(); // true
|
|
231
|
+
rbTree.delete(10);
|
|
232
|
+
rbTree.isAVLBalanced(); // true
|
|
233
|
+
rbTree.print()
|
|
234
|
+
// ___6________
|
|
235
|
+
// / \
|
|
236
|
+
// ___4_ ___11________
|
|
237
|
+
// / \ / \
|
|
238
|
+
// _2_ 5 _8_ ____14__
|
|
239
|
+
// / \ / \ / \
|
|
240
|
+
// 1 3 7 9 12__ 15__
|
|
241
|
+
// \ \
|
|
242
|
+
// 13 16
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Binary Search Tree (BST) snippet
|
|
246
|
+
|
|
203
247
|
```ts
|
|
204
248
|
import {BST, BSTNode} from 'data-structure-typed';
|
|
205
249
|
|
|
@@ -259,31 +303,6 @@ objBST.addMany([15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5], [
|
|
|
259
303
|
objBST.delete(11);
|
|
260
304
|
```
|
|
261
305
|
|
|
262
|
-
#### JS
|
|
263
|
-
|
|
264
|
-
```js
|
|
265
|
-
const {BST, BSTNode} = require('data-structure-typed');
|
|
266
|
-
|
|
267
|
-
const bst = new BST();
|
|
268
|
-
bst.add(11);
|
|
269
|
-
bst.add(3);
|
|
270
|
-
bst.addMany([15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5]);
|
|
271
|
-
bst.size === 16; // true
|
|
272
|
-
bst.has(6); // true
|
|
273
|
-
const node6 = bst.getNode(6);
|
|
274
|
-
bst.getHeight(6) === 2; // true
|
|
275
|
-
bst.getHeight() === 5; // true
|
|
276
|
-
bst.getDepth(6) === 3; // true
|
|
277
|
-
const leftMost = bst.getLeftMost();
|
|
278
|
-
leftMost?.key === 1; // true
|
|
279
|
-
|
|
280
|
-
bst.delete(6);
|
|
281
|
-
bst.get(6); // undefined
|
|
282
|
-
bst.isAVLBalanced(); // true or false
|
|
283
|
-
const bfsIDs = bst.bfs();
|
|
284
|
-
bfsIDs[0] === 11; // true
|
|
285
|
-
```
|
|
286
|
-
|
|
287
306
|
### AVLTree snippet
|
|
288
307
|
|
|
289
308
|
```ts
|
|
@@ -296,28 +315,6 @@ avlTree.delete(10);
|
|
|
296
315
|
avlTree.isAVLBalanced(); // true
|
|
297
316
|
```
|
|
298
317
|
|
|
299
|
-
### RedBlackTree snippet
|
|
300
|
-
|
|
301
|
-
```ts
|
|
302
|
-
import {RedBlackTree} from 'data-structure-typed';
|
|
303
|
-
|
|
304
|
-
const rbTree = new RedBlackTree<number>();
|
|
305
|
-
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
306
|
-
rbTree.isAVLBalanced(); // true
|
|
307
|
-
rbTree.delete(10);
|
|
308
|
-
rbTree.isAVLBalanced(); // true
|
|
309
|
-
rbTree.print()
|
|
310
|
-
// ___6________
|
|
311
|
-
// / \
|
|
312
|
-
// ___4_ ___11________
|
|
313
|
-
// / \ / \
|
|
314
|
-
// _2_ 5 _8_ ____14__
|
|
315
|
-
// / \ / \ / \
|
|
316
|
-
// 1 3 7 9 12__ 15__
|
|
317
|
-
// \ \
|
|
318
|
-
// 13 16
|
|
319
|
-
```
|
|
320
|
-
|
|
321
318
|
### Directed Graph simple snippet
|
|
322
319
|
|
|
323
320
|
```ts
|
|
@@ -672,7 +669,7 @@ avl2.print();
|
|
|
672
669
|
</tbody>
|
|
673
670
|
</table>
|
|
674
671
|
|
|
675
|
-
##
|
|
672
|
+
## The corresponding relationships between data structures in different language standard libraries.
|
|
676
673
|
|
|
677
674
|
<table style="display: table; width:100%; table-layout: fixed;">
|
|
678
675
|
<thead>
|
|
@@ -686,9 +683,15 @@ avl2.print();
|
|
|
686
683
|
<tbody>
|
|
687
684
|
<tr>
|
|
688
685
|
<td>Heap<E></td>
|
|
686
|
+
<td>-</td>
|
|
687
|
+
<td>-</td>
|
|
688
|
+
<td>heapq</td>
|
|
689
|
+
</tr>
|
|
690
|
+
<tr>
|
|
691
|
+
<td>PriorityQueue<E></td>
|
|
689
692
|
<td>priority_queue<T></td>
|
|
690
693
|
<td>PriorityQueue<E></td>
|
|
691
|
-
<td
|
|
694
|
+
<td>-</td>
|
|
692
695
|
</tr>
|
|
693
696
|
<tr>
|
|
694
697
|
<td>Deque<E></td>
|
|
@@ -981,52 +984,52 @@ avl2.print();
|
|
|
981
984
|
[//]: # (No deletion!!! Start of Replace Section)
|
|
982
985
|
<div class="json-to-html-collapse clearfix 0">
|
|
983
986
|
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
984
|
-
<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>
|
|
987
|
+
<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>48.42</td><td>20.65</td><td>0.00</td></tr><tr><td>10,000 add & delete randomly</td><td>107.72</td><td>9.28</td><td>0.02</td></tr><tr><td>10,000 addMany</td><td>55.40</td><td>18.05</td><td>6.22e-4</td></tr><tr><td>10,000 get</td><td>53.89</td><td>18.56</td><td>0.02</td></tr></table></div>
|
|
985
988
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
986
989
|
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
987
|
-
<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>
|
|
990
|
+
<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>17.75</td><td>56.35</td><td>2.23e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>25.58</td><td>39.10</td><td>0.01</td></tr><tr><td>1,000 addMany</td><td>19.65</td><td>50.89</td><td>0.00</td></tr><tr><td>1,000 get</td><td>21.03</td><td>47.55</td><td>0.01</td></tr><tr><td>1,000 has</td><td>19.81</td><td>50.48</td><td>0.01</td></tr><tr><td>1,000 dfs</td><td>183.37</td><td>5.45</td><td>0.03</td></tr><tr><td>1,000 bfs</td><td>65.61</td><td>15.24</td><td>0.02</td></tr><tr><td>1,000 morris</td><td>231.00</td><td>4.33</td><td>0.06</td></tr></table></div>
|
|
988
991
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
989
992
|
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
990
|
-
<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>
|
|
993
|
+
<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>49.96</td><td>20.02</td><td>7.65e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>116.77</td><td>8.56</td><td>0.02</td></tr><tr><td>10,000 addMany</td><td>49.06</td><td>20.38</td><td>0.01</td></tr><tr><td>10,000 get</td><td>49.06</td><td>20.38</td><td>7.13e-4</td></tr></table></div>
|
|
991
994
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
992
995
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
993
|
-
<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>
|
|
996
|
+
<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>83.42</td><td>11.99</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>243.05</td><td>4.11</td><td>0.07</td></tr><tr><td>100,000 getNode</td><td>218.87</td><td>4.57</td><td>0.05</td></tr><tr><td>100,000 add & iterator</td><td>124.22</td><td>8.05</td><td>0.01</td></tr></table></div>
|
|
994
997
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
995
998
|
<div class='collapsible level0' ><span class='json-to-html-label'>comparison</span></div>
|
|
996
|
-
<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.
|
|
999
|
+
<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.15</td><td>6710.40</td><td>1.90e-5</td></tr><tr><td>CJS PQ 10,000 add</td><td>0.16</td><td>6407.42</td><td>4.25e-5</td></tr><tr><td>MJS PQ 10,000 add</td><td>0.62</td><td>1602.37</td><td>1.51e-4</td></tr><tr><td>SRC PQ 10,000 add & poll</td><td>3.67</td><td>272.42</td><td>0.00</td></tr><tr><td>CJS PQ 10,000 add & poll</td><td>3.95</td><td>252.90</td><td>0.00</td></tr><tr><td>MJS PQ 10,000 add & poll</td><td>3.33</td><td>300.28</td><td>8.65e-5</td></tr></table></div>
|
|
997
1000
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
998
1001
|
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
999
|
-
<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.
|
|
1002
|
+
<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.11</td><td>8958.10</td><td>3.30e-5</td></tr><tr><td>1,000 addEdge</td><td>6.37</td><td>156.98</td><td>1.96e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.04e+4</td><td>8.22e-6</td></tr><tr><td>1,000 getEdge</td><td>24.49</td><td>40.83</td><td>0.00</td></tr><tr><td>tarjan</td><td>235.54</td><td>4.25</td><td>0.04</td></tr><tr><td>tarjan all</td><td>6766.74</td><td>0.15</td><td>0.32</td></tr><tr><td>topologicalSort</td><td>197.52</td><td>5.06</td><td>0.04</td></tr></table></div>
|
|
1000
1003
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1001
1004
|
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
1002
|
-
<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>
|
|
1005
|
+
<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>117.82</td><td>8.49</td><td>0.05</td></tr><tr><td>Native Map 1,000,000 set</td><td>220.92</td><td>4.53</td><td>0.03</td></tr><tr><td>Native Set 1,000,000 add</td><td>187.44</td><td>5.34</td><td>0.02</td></tr><tr><td>1,000,000 set & get</td><td>125.44</td><td>7.97</td><td>0.04</td></tr><tr><td>Native Map 1,000,000 set & get</td><td>300.10</td><td>3.33</td><td>0.06</td></tr><tr><td>Native Set 1,000,000 add & has</td><td>200.88</td><td>4.98</td><td>0.02</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>361.00</td><td>2.77</td><td>0.06</td></tr><tr><td>Native Map 1,000,000 ObjKey set & get</td><td>335.34</td><td>2.98</td><td>0.09</td></tr><tr><td>Native Set 1,000,000 ObjKey add & has</td><td>261.28</td><td>3.83</td><td>0.07</td></tr></table></div>
|
|
1003
1006
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1004
1007
|
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
1005
|
-
<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 & poll</td><td>80.
|
|
1008
|
+
<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 & poll</td><td>80.43</td><td>12.43</td><td>0.00</td></tr><tr><td>100,000 add & dfs</td><td>36.95</td><td>27.07</td><td>0.00</td></tr><tr><td>10,000 fib add & pop</td><td>386.63</td><td>2.59</td><td>0.05</td></tr></table></div>
|
|
1006
1009
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1007
1010
|
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
1008
|
-
<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>
|
|
1011
|
+
<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>235.15</td><td>4.25</td><td>0.07</td></tr><tr><td>1,000,000 unshift</td><td>245.36</td><td>4.08</td><td>0.08</td></tr><tr><td>1,000,000 unshift & shift</td><td>175.53</td><td>5.70</td><td>0.03</td></tr><tr><td>1,000,000 addBefore</td><td>319.21</td><td>3.13</td><td>0.06</td></tr></table></div>
|
|
1009
1012
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1010
1013
|
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
1011
|
-
<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>
|
|
1014
|
+
<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>202.02</td><td>4.95</td><td>0.04</td></tr><tr><td>10,000 push & pop</td><td>228.77</td><td>4.37</td><td>0.04</td></tr><tr><td>10,000 addBefore</td><td>274.25</td><td>3.65</td><td>0.05</td></tr></table></div>
|
|
1012
1015
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1013
1016
|
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
1014
|
-
<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>
|
|
1017
|
+
<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>9.39</td><td>106.51</td><td>0.00</td></tr></table></div>
|
|
1015
1018
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1016
1019
|
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
1017
|
-
<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 & poll</td><td>
|
|
1020
|
+
<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 & poll</td><td>114.36</td><td>8.74</td><td>0.02</td></tr></table></div>
|
|
1018
1021
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1019
1022
|
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
1020
|
-
<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>
|
|
1023
|
+
<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.81</td><td>67.51</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>25.34</td><td>39.47</td><td>0.01</td></tr><tr><td>100,000 push & shift</td><td>2.49</td><td>400.86</td><td>7.97e-4</td></tr><tr><td>Native Array 100,000 push & shift</td><td>2390.92</td><td>0.42</td><td>0.17</td></tr><tr><td>100,000 unshift & shift</td><td>2.48</td><td>403.14</td><td>6.46e-4</td></tr><tr><td>Native Array 100,000 unshift & shift</td><td>4462.41</td><td>0.22</td><td>0.34</td></tr></table></div>
|
|
1021
1024
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1022
1025
|
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
1023
|
-
<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>
|
|
1026
|
+
<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>51.99</td><td>19.24</td><td>0.03</td></tr><tr><td>100,000 push & shift</td><td>5.23</td><td>191.34</td><td>7.00e-4</td></tr><tr><td>Native Array 100,000 push & shift</td><td>2400.96</td><td>0.42</td><td>0.28</td></tr><tr><td>Native Array 100,000 push & pop</td><td>4.36</td><td>229.52</td><td>1.14e-4</td></tr></table></div>
|
|
1024
1027
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1025
1028
|
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
1026
|
-
<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>
|
|
1029
|
+
<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>43.55</td><td>22.96</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>55.29</td><td>18.09</td><td>0.01</td></tr></table></div>
|
|
1027
1030
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
1028
1031
|
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
1029
|
-
<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>
|
|
1032
|
+
<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>48.66</td><td>20.55</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>95.09</td><td>10.52</td><td>0.01</td></tr></table></div>
|
|
1030
1033
|
</div>
|
|
1031
1034
|
|
|
1032
1035
|
[//]: # (No deletion!!! End of Replace Section)
|
package/README_zh-CN.md
CHANGED
|
@@ -199,9 +199,51 @@ const {
|
|
|
199
199
|
|
|
200
200
|
## 代码片段
|
|
201
201
|
|
|
202
|
-
###
|
|
202
|
+
### 红黑树 代码示例
|
|
203
203
|
|
|
204
204
|
#### TS
|
|
205
|
+
```ts
|
|
206
|
+
import {RedBlackTree} from 'data-structure-typed';
|
|
207
|
+
|
|
208
|
+
const rbTree = new RedBlackTree<number>();
|
|
209
|
+
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
210
|
+
rbTree.isAVLBalanced(); // true
|
|
211
|
+
rbTree.delete(10);
|
|
212
|
+
rbTree.isAVLBalanced(); // true
|
|
213
|
+
rbTree.print()
|
|
214
|
+
// ___6________
|
|
215
|
+
// / \
|
|
216
|
+
// ___4_ ___11________
|
|
217
|
+
// / \ / \
|
|
218
|
+
// _2_ 5 _8_ ____14__
|
|
219
|
+
// / \ / \ / \
|
|
220
|
+
// 1 3 7 9 12__ 15__
|
|
221
|
+
// \ \
|
|
222
|
+
// 13 16
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### JS
|
|
226
|
+
```js
|
|
227
|
+
import {RedBlackTree} from 'data-structure-typed';
|
|
228
|
+
|
|
229
|
+
const rbTree = new RedBlackTree();
|
|
230
|
+
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
231
|
+
rbTree.isAVLBalanced(); // true
|
|
232
|
+
rbTree.delete(10);
|
|
233
|
+
rbTree.isAVLBalanced(); // true
|
|
234
|
+
rbTree.print()
|
|
235
|
+
// ___6________
|
|
236
|
+
// / \
|
|
237
|
+
// ___4_ ___11________
|
|
238
|
+
// / \ / \
|
|
239
|
+
// _2_ 5 _8_ ____14__
|
|
240
|
+
// / \ / \ / \
|
|
241
|
+
// 1 3 7 9 12__ 15__
|
|
242
|
+
// \ \
|
|
243
|
+
// 13 16
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 二叉搜索树 (BST) 代码示例
|
|
205
247
|
|
|
206
248
|
```ts
|
|
207
249
|
import {BST, BSTNode} from 'data-structure-typed';
|
|
@@ -262,31 +304,6 @@ objBST.addMany([15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5], [
|
|
|
262
304
|
objBST.delete(11);
|
|
263
305
|
```
|
|
264
306
|
|
|
265
|
-
#### JS
|
|
266
|
-
|
|
267
|
-
```js
|
|
268
|
-
const {BST, BSTNode} = require('data-structure-typed');
|
|
269
|
-
|
|
270
|
-
const bst = new BST();
|
|
271
|
-
bst.add(11);
|
|
272
|
-
bst.add(3);
|
|
273
|
-
bst.addMany([15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5]);
|
|
274
|
-
bst.size === 16; // true
|
|
275
|
-
bst.has(6); // true
|
|
276
|
-
const node6 = bst.getNode(6);
|
|
277
|
-
bst.getHeight(6) === 2; // true
|
|
278
|
-
bst.getHeight() === 5; // true
|
|
279
|
-
bst.getDepth(6) === 3; // true
|
|
280
|
-
const leftMost = bst.getLeftMost();
|
|
281
|
-
leftMost?.key === 1; // true
|
|
282
|
-
|
|
283
|
-
bst.delete(6);
|
|
284
|
-
bst.get(6); // undefined
|
|
285
|
-
bst.isAVLBalanced(); // true or false
|
|
286
|
-
const bfsIDs = bst.bfs();
|
|
287
|
-
bfsIDs[0] === 11; // true
|
|
288
|
-
```
|
|
289
|
-
|
|
290
307
|
### AVL树 代码示例
|
|
291
308
|
|
|
292
309
|
```ts
|
|
@@ -299,28 +316,6 @@ avlTree.delete(10);
|
|
|
299
316
|
avlTree.isAVLBalanced(); // true
|
|
300
317
|
```
|
|
301
318
|
|
|
302
|
-
### 红黑树 代码示例
|
|
303
|
-
|
|
304
|
-
```ts
|
|
305
|
-
import {RedBlackTree} from 'data-structure-typed';
|
|
306
|
-
|
|
307
|
-
const rbTree = new RedBlackTree<number>();
|
|
308
|
-
rbTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
|
|
309
|
-
rbTree.isAVLBalanced(); // true
|
|
310
|
-
rbTree.delete(10);
|
|
311
|
-
rbTree.isAVLBalanced(); // true
|
|
312
|
-
rbTree.print()
|
|
313
|
-
// ___6________
|
|
314
|
-
// / \
|
|
315
|
-
// ___4_ ___11________
|
|
316
|
-
// / \ / \
|
|
317
|
-
// _2_ 5 _8_ ____14__
|
|
318
|
-
// / \ / \ / \
|
|
319
|
-
// 1 3 7 9 12__ 15__
|
|
320
|
-
// \ \
|
|
321
|
-
// 13 16
|
|
322
|
-
```
|
|
323
|
-
|
|
324
319
|
### 有向图代码示例
|
|
325
320
|
|
|
326
321
|
```ts
|
package/benchmark/report.html
CHANGED
|
@@ -43,52 +43,52 @@
|
|
|
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'>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>
|
|
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>48.42</td><td>20.65</td><td>0.00</td></tr><tr><td>10,000 add & delete randomly</td><td>107.72</td><td>9.28</td><td>0.02</td></tr><tr><td>10,000 addMany</td><td>55.40</td><td>18.05</td><td>6.22e-4</td></tr><tr><td>10,000 get</td><td>53.89</td><td>18.56</td><td>0.02</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'>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>
|
|
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>17.75</td><td>56.35</td><td>2.23e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>25.58</td><td>39.10</td><td>0.01</td></tr><tr><td>1,000 addMany</td><td>19.65</td><td>50.89</td><td>0.00</td></tr><tr><td>1,000 get</td><td>21.03</td><td>47.55</td><td>0.01</td></tr><tr><td>1,000 has</td><td>19.81</td><td>50.48</td><td>0.01</td></tr><tr><td>1,000 dfs</td><td>183.37</td><td>5.45</td><td>0.03</td></tr><tr><td>1,000 bfs</td><td>65.61</td><td>15.24</td><td>0.02</td></tr><tr><td>1,000 morris</td><td>231.00</td><td>4.33</td><td>0.06</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'>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>
|
|
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>49.96</td><td>20.02</td><td>7.65e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>116.77</td><td>8.56</td><td>0.02</td></tr><tr><td>10,000 addMany</td><td>49.06</td><td>20.38</td><td>0.01</td></tr><tr><td>10,000 get</td><td>49.06</td><td>20.38</td><td>7.13e-4</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'>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>
|
|
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>83.42</td><td>11.99</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>243.05</td><td>4.11</td><td>0.07</td></tr><tr><td>100,000 getNode</td><td>218.87</td><td>4.57</td><td>0.05</td></tr><tr><td>100,000 add & iterator</td><td>124.22</td><td>8.05</td><td>0.01</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'>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.
|
|
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.15</td><td>6710.40</td><td>1.90e-5</td></tr><tr><td>CJS PQ 10,000 add</td><td>0.16</td><td>6407.42</td><td>4.25e-5</td></tr><tr><td>MJS PQ 10,000 add</td><td>0.62</td><td>1602.37</td><td>1.51e-4</td></tr><tr><td>SRC PQ 10,000 add & poll</td><td>3.67</td><td>272.42</td><td>0.00</td></tr><tr><td>CJS PQ 10,000 add & poll</td><td>3.95</td><td>252.90</td><td>0.00</td></tr><tr><td>MJS PQ 10,000 add & poll</td><td>3.33</td><td>300.28</td><td>8.65e-5</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'>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.
|
|
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.11</td><td>8958.10</td><td>3.30e-5</td></tr><tr><td>1,000 addEdge</td><td>6.37</td><td>156.98</td><td>1.96e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.04e+4</td><td>8.22e-6</td></tr><tr><td>1,000 getEdge</td><td>24.49</td><td>40.83</td><td>0.00</td></tr><tr><td>tarjan</td><td>235.54</td><td>4.25</td><td>0.04</td></tr><tr><td>tarjan all</td><td>6766.74</td><td>0.15</td><td>0.32</td></tr><tr><td>topologicalSort</td><td>197.52</td><td>5.06</td><td>0.04</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'>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>
|
|
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>117.82</td><td>8.49</td><td>0.05</td></tr><tr><td>Native Map 1,000,000 set</td><td>220.92</td><td>4.53</td><td>0.03</td></tr><tr><td>Native Set 1,000,000 add</td><td>187.44</td><td>5.34</td><td>0.02</td></tr><tr><td>1,000,000 set & get</td><td>125.44</td><td>7.97</td><td>0.04</td></tr><tr><td>Native Map 1,000,000 set & get</td><td>300.10</td><td>3.33</td><td>0.06</td></tr><tr><td>Native Set 1,000,000 add & has</td><td>200.88</td><td>4.98</td><td>0.02</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>361.00</td><td>2.77</td><td>0.06</td></tr><tr><td>Native Map 1,000,000 ObjKey set & get</td><td>335.34</td><td>2.98</td><td>0.09</td></tr><tr><td>Native Set 1,000,000 ObjKey add & has</td><td>261.28</td><td>3.83</td><td>0.07</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'>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>100,000 add & poll</td><td>80.
|
|
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>100,000 add & poll</td><td>80.43</td><td>12.43</td><td>0.00</td></tr><tr><td>100,000 add & dfs</td><td>36.95</td><td>27.07</td><td>0.00</td></tr><tr><td>10,000 fib add & pop</td><td>386.63</td><td>2.59</td><td>0.05</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'>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>
|
|
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>235.15</td><td>4.25</td><td>0.07</td></tr><tr><td>1,000,000 unshift</td><td>245.36</td><td>4.08</td><td>0.08</td></tr><tr><td>1,000,000 unshift & shift</td><td>175.53</td><td>5.70</td><td>0.03</td></tr><tr><td>1,000,000 addBefore</td><td>319.21</td><td>3.13</td><td>0.06</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'>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>1,000,000 push & shift</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 & shift</td><td>202.02</td><td>4.95</td><td>0.04</td></tr><tr><td>10,000 push & pop</td><td>228.77</td><td>4.37</td><td>0.04</td></tr><tr><td>10,000 addBefore</td><td>274.25</td><td>3.65</td><td>0.05</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'>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>
|
|
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>9.39</td><td>106.51</td><td>0.00</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 & poll</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 & poll</td><td>114.36</td><td>8.74</td><td>0.02</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'>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>
|
|
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.81</td><td>67.51</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>25.34</td><td>39.47</td><td>0.01</td></tr><tr><td>100,000 push & shift</td><td>2.49</td><td>400.86</td><td>7.97e-4</td></tr><tr><td>Native Array 100,000 push & shift</td><td>2390.92</td><td>0.42</td><td>0.17</td></tr><tr><td>100,000 unshift & shift</td><td>2.48</td><td>403.14</td><td>6.46e-4</td></tr><tr><td>Native Array 100,000 unshift & shift</td><td>4462.41</td><td>0.22</td><td>0.34</td></tr></table></div>
|
|
83
83
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
84
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>
|
|
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>51.99</td><td>19.24</td><td>0.03</td></tr><tr><td>100,000 push & shift</td><td>5.23</td><td>191.34</td><td>7.00e-4</td></tr><tr><td>Native Array 100,000 push & shift</td><td>2400.96</td><td>0.42</td><td>0.28</td></tr><tr><td>Native Array 100,000 push & pop</td><td>4.36</td><td>229.52</td><td>1.14e-4</td></tr></table></div>
|
|
86
86
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
87
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>
|
|
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>43.55</td><td>22.96</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>55.29</td><td>18.09</td><td>0.01</td></tr></table></div>
|
|
89
89
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
90
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>
|
|
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>48.66</td><td>20.55</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>95.09</td><td>10.52</td><td>0.01</td></tr></table></div>
|
|
92
92
|
</div>
|
|
93
93
|
|
|
94
94
|
</div>
|