diff --git a/CHANGELOG.md b/CHANGELOG.md
index b9bddf1..4882235 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
-## [v1.48.7](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
+## [v1.48.8](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
### Changes
diff --git a/README.md b/README.md
index e7eb12c..db8ef67 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
![npm](https://img.shields.io/npm/dm/data-structure-typed)
![npm package minimized gzipped size (select exports)](https://img.shields.io/bundlejs/size/data-structure-typed)
![GitHub top language](https://img.shields.io/github/languages/top/zrwusa/data-structure-typed)
+![GITHUB Star](https://img.shields.io/github/stars/zrwusa/data-structure-typed)
![eslint](https://aleen42.github.io/badges/src/eslint.svg)
![NPM](https://img.shields.io/npm/l/data-structure-typed)
@@ -824,61 +825,6 @@ avl2.print();
-## Benchmark
-
-[//]: # (No deletion!!! Start of Replace Section)
-
-
avl-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 51.22 | 19.52 | 0.00 |
10,000 add & delete randomly | 110.40 | 9.06 | 0.00 |
10,000 addMany | 58.39 | 17.13 | 6.35e-4 |
10,000 get | 50.59 | 19.77 | 3.87e-4 |
-
-
binary-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 add randomly | 13.83 | 72.29 | 1.19e-4 |
1,000 add & delete randomly | 21.49 | 46.54 | 2.34e-4 |
1,000 addMany | 15.93 | 62.78 | 1.27e-4 |
1,000 get | 18.19 | 54.98 | 1.79e-4 |
1,000 has | 18.20 | 54.93 | 1.71e-4 |
1,000 dfs | 161.79 | 6.18 | 7.45e-4 |
1,000 bfs | 56.68 | 17.64 | 4.77e-4 |
1,000 morris | 262.64 | 3.81 | 0.00 |
-
-
bst
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 51.51 | 19.41 | 8.70e-4 |
10,000 add & delete randomly | 114.09 | 8.76 | 9.66e-4 |
10,000 addMany | 47.86 | 20.90 | 2.77e-4 |
10,000 get | 51.93 | 19.26 | 6.56e-4 |
-
-
rb-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add | 86.63 | 11.54 | 0.00 |
100,000 add & delete randomly | 218.88 | 4.57 | 0.01 |
100,000 getNode | 261.16 | 3.83 | 0.00 |
100,000 add & iterator | 117.64 | 8.50 | 0.00 |
-
-
comparison
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
SRC PQ 10,000 add | 0.14 | 6949.20 | 1.53e-6 |
CJS PQ 10,000 add | 0.14 | 6943.68 | 1.74e-6 |
MJS PQ 10,000 add | 0.57 | 1758.40 | 6.26e-6 |
SRC PQ 10,000 add & pop | 3.40 | 293.94 | 3.50e-5 |
CJS PQ 10,000 add & pop | 3.42 | 292.69 | 5.34e-5 |
MJS PQ 10,000 add & pop | 3.30 | 303.01 | 3.97e-5 |
-
-
directed-graph
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 addVertex | 0.10 | 9930.74 | 1.11e-6 |
1,000 addEdge | 6.13 | 163.19 | 1.84e-4 |
1,000 getVertex | 0.05 | 2.15e+4 | 5.00e-7 |
1,000 getEdge | 23.57 | 42.43 | 0.00 |
tarjan | 252.05 | 3.97 | 0.03 |
tarjan all | 221.15 | 4.52 | 0.00 |
topologicalSort | 181.07 | 5.52 | 0.00 |
-
-
hash-map
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 set | 122.90 | 8.14 | 0.04 |
Native Map 1,000,000 set | 215.97 | 4.63 | 0.02 |
Native Set 1,000,000 add | 179.11 | 5.58 | 0.02 |
1,000,000 set & get | 123.10 | 8.12 | 0.04 |
Native Map 1,000,000 set & get | 271.80 | 3.68 | 0.02 |
Native Set 1,000,000 add & has | 176.65 | 5.66 | 0.02 |
1,000,000 ObjKey set & get | 341.97 | 2.92 | 0.07 |
Native Map 1,000,000 ObjKey set & get | 316.86 | 3.16 | 0.04 |
Native Set 1,000,000 ObjKey add & has | 285.14 | 3.51 | 0.06 |
-
-
heap
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 80.37 | 12.44 | 0.00 |
100,000 add & dfs | 36.20 | 27.63 | 0.00 |
10,000 fib add & pop | 362.24 | 2.76 | 0.00 |
-
-
doubly-linked-list
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 216.09 | 4.63 | 0.06 |
1,000,000 unshift | 220.68 | 4.53 | 0.02 |
1,000,000 unshift & shift | 172.93 | 5.78 | 0.04 |
1,000,000 insertBefore | 332.25 | 3.01 | 0.08 |
-
-
singly-linked-list
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push & shift | 222.99 | 4.48 | 0.10 |
10,000 push & pop | 214.82 | 4.66 | 0.01 |
10,000 insertBefore | 251.24 | 3.98 | 0.01 |
-
-
max-priority-queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 refill & poll | 8.91 | 112.19 | 1.57e-4 |
-
-
priority-queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 101.70 | 9.83 | 0.00 |
-
-
deque
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 13.80 | 72.47 | 1.56e-4 |
1,000,000 push & pop | 22.72 | 44.02 | 2.02e-4 |
100,000 push & shift | 2.35 | 425.67 | 5.80e-5 |
Native Array 100,000 push & shift | 2511.14 | 0.40 | 0.36 |
100,000 unshift & shift | 2.23 | 447.89 | 3.30e-4 |
Native Array 100,000 unshift & shift | 4140.23 | 0.24 | 0.33 |
-
-
queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 43.65 | 22.91 | 0.01 |
100,000 push & shift | 4.99 | 200.28 | 9.54e-5 |
Native Array 100,000 push & shift | 2335.63 | 0.43 | 0.33 |
Native Array 100,000 push & pop | 4.39 | 227.81 | 0.00 |
-
-
stack
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 45.38 | 22.04 | 0.01 |
1,000,000 push & pop | 49.52 | 20.19 | 0.01 |
-
-
trie
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 push | 42.99 | 23.26 | 0.00 |
100,000 getWords | 89.78 | 11.14 | 0.00 |
-
-
-[//]: # (No deletion!!! End of Replace Section)
-
## Built-in classic algorithms
@@ -1029,3 +975,60 @@ avl2.print();
+
+## Benchmark
+
+[//]: # (No deletion!!! Start of Replace Section)
+
+
avl-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 51.22 | 19.52 | 0.00 |
10,000 add & delete randomly | 110.40 | 9.06 | 0.00 |
10,000 addMany | 58.39 | 17.13 | 6.35e-4 |
10,000 get | 50.59 | 19.77 | 3.87e-4 |
+
+
binary-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 add randomly | 13.83 | 72.29 | 1.19e-4 |
1,000 add & delete randomly | 21.49 | 46.54 | 2.34e-4 |
1,000 addMany | 15.93 | 62.78 | 1.27e-4 |
1,000 get | 18.19 | 54.98 | 1.79e-4 |
1,000 has | 18.20 | 54.93 | 1.71e-4 |
1,000 dfs | 161.79 | 6.18 | 7.45e-4 |
1,000 bfs | 56.68 | 17.64 | 4.77e-4 |
1,000 morris | 262.64 | 3.81 | 0.00 |
+
+
bst
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 51.51 | 19.41 | 8.70e-4 |
10,000 add & delete randomly | 114.09 | 8.76 | 9.66e-4 |
10,000 addMany | 47.86 | 20.90 | 2.77e-4 |
10,000 get | 51.93 | 19.26 | 6.56e-4 |
+
+
rb-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add | 86.63 | 11.54 | 0.00 |
100,000 add & delete randomly | 218.88 | 4.57 | 0.01 |
100,000 getNode | 261.16 | 3.83 | 0.00 |
100,000 add & iterator | 117.64 | 8.50 | 0.00 |
+
+
comparison
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
SRC PQ 10,000 add | 0.14 | 6949.20 | 1.53e-6 |
CJS PQ 10,000 add | 0.14 | 6943.68 | 1.74e-6 |
MJS PQ 10,000 add | 0.57 | 1758.40 | 6.26e-6 |
SRC PQ 10,000 add & pop | 3.40 | 293.94 | 3.50e-5 |
CJS PQ 10,000 add & pop | 3.42 | 292.69 | 5.34e-5 |
MJS PQ 10,000 add & pop | 3.30 | 303.01 | 3.97e-5 |
+
+
directed-graph
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 addVertex | 0.10 | 9930.74 | 1.11e-6 |
1,000 addEdge | 6.13 | 163.19 | 1.84e-4 |
1,000 getVertex | 0.05 | 2.15e+4 | 5.00e-7 |
1,000 getEdge | 23.57 | 42.43 | 0.00 |
tarjan | 252.05 | 3.97 | 0.03 |
tarjan all | 221.15 | 4.52 | 0.00 |
topologicalSort | 181.07 | 5.52 | 0.00 |
+
+
hash-map
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 set | 122.90 | 8.14 | 0.04 |
Native Map 1,000,000 set | 215.97 | 4.63 | 0.02 |
Native Set 1,000,000 add | 179.11 | 5.58 | 0.02 |
1,000,000 set & get | 123.10 | 8.12 | 0.04 |
Native Map 1,000,000 set & get | 271.80 | 3.68 | 0.02 |
Native Set 1,000,000 add & has | 176.65 | 5.66 | 0.02 |
1,000,000 ObjKey set & get | 341.97 | 2.92 | 0.07 |
Native Map 1,000,000 ObjKey set & get | 316.86 | 3.16 | 0.04 |
Native Set 1,000,000 ObjKey add & has | 285.14 | 3.51 | 0.06 |
+
+
heap
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 80.37 | 12.44 | 0.00 |
100,000 add & dfs | 36.20 | 27.63 | 0.00 |
10,000 fib add & pop | 362.24 | 2.76 | 0.00 |
+
+
doubly-linked-list
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 216.09 | 4.63 | 0.06 |
1,000,000 unshift | 220.68 | 4.53 | 0.02 |
1,000,000 unshift & shift | 172.93 | 5.78 | 0.04 |
1,000,000 insertBefore | 332.25 | 3.01 | 0.08 |
+
+
singly-linked-list
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push & shift | 222.99 | 4.48 | 0.10 |
10,000 push & pop | 214.82 | 4.66 | 0.01 |
10,000 insertBefore | 251.24 | 3.98 | 0.01 |
+
+
max-priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 refill & poll | 8.91 | 112.19 | 1.57e-4 |
+
+
priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 101.70 | 9.83 | 0.00 |
+
+
deque
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 13.80 | 72.47 | 1.56e-4 |
1,000,000 push & pop | 22.72 | 44.02 | 2.02e-4 |
100,000 push & shift | 2.35 | 425.67 | 5.80e-5 |
Native Array 100,000 push & shift | 2511.14 | 0.40 | 0.36 |
100,000 unshift & shift | 2.23 | 447.89 | 3.30e-4 |
Native Array 100,000 unshift & shift | 4140.23 | 0.24 | 0.33 |
+
+
queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 43.65 | 22.91 | 0.01 |
100,000 push & shift | 4.99 | 200.28 | 9.54e-5 |
Native Array 100,000 push & shift | 2335.63 | 0.43 | 0.33 |
Native Array 100,000 push & pop | 4.39 | 227.81 | 0.00 |
+
+
stack
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 45.38 | 22.04 | 0.01 |
1,000,000 push & pop | 49.52 | 20.19 | 0.01 |
+
+
trie
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 push | 42.99 | 23.26 | 0.00 |
100,000 getWords | 89.78 | 11.14 | 0.00 |
+
+
+[//]: # (No deletion!!! End of Replace Section)
+
+
diff --git a/README_zh-CN.md b/README_zh-CN.md
index 582cbe3..131d899 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -4,6 +4,7 @@
![npm](https://img.shields.io/npm/dm/data-structure-typed)
![npm package minimized gzipped size (select exports)](https://img.shields.io/bundlejs/size/data-structure-typed)
![GitHub top language](https://img.shields.io/github/languages/top/zrwusa/data-structure-typed)
+![GITHUB Star](https://img.shields.io/github/stars/zrwusa/data-structure-typed)
![eslint](https://aleen42.github.io/badges/src/eslint.svg)
![NPM](https://img.shields.io/npm/l/data-structure-typed)
@@ -827,61 +828,6 @@ avl2.print();
-## 基准测试
-
-[//]: # (No deletion!!! Start of Replace Section)
-
-
avl-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 72.48 | 13.80 | 0.03 |
10,000 add & delete randomly | 144.14 | 6.94 | 0.03 |
10,000 addMany | 69.71 | 14.35 | 0.02 |
10,000 get | 54.21 | 18.45 | 0.01 |
-
-
binary-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 add randomly | 15.84 | 63.14 | 0.00 |
1,000 add & delete randomly | 24.62 | 40.62 | 0.00 |
1,000 addMany | 17.85 | 56.01 | 0.00 |
1,000 get | 20.83 | 48.00 | 0.00 |
1,000 has | 20.78 | 48.13 | 0.00 |
1,000 dfs | 186.06 | 5.37 | 0.02 |
1,000 bfs | 66.58 | 15.02 | 0.02 |
1,000 morris | 298.23 | 3.35 | 0.02 |
-
-
bst
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 55.04 | 18.17 | 0.01 |
10,000 add & delete randomly | 129.85 | 7.70 | 0.01 |
10,000 addMany | 50.40 | 19.84 | 0.01 |
10,000 get | 63.39 | 15.78 | 0.01 |
-
-
rb-tree
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add | 113.25 | 8.83 | 0.02 |
100,000 add & delete randomly | 305.28 | 3.28 | 0.03 |
100,000 getNode | 73.20 | 13.66 | 0.03 |
100,000 add & iterator | 159.80 | 6.26 | 0.06 |
-
-
comparison
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
SRC PQ 10,000 add | 0.17 | 5872.02 | 4.08e-5 |
CJS PQ 10,000 add | 0.20 | 4961.22 | 1.14e-4 |
MJS PQ 10,000 add | 0.74 | 1351.47 | 2.98e-4 |
SRC PQ 10,000 add & pop | 4.62 | 216.49 | 0.00 |
CJS PQ 10,000 add & pop | 4.36 | 229.40 | 0.00 |
MJS PQ 10,000 add & pop | 3.92 | 255.23 | 0.00 |
-
-
directed-graph
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 addVertex | 0.12 | 8557.70 | 2.46e-5 |
1,000 addEdge | 7.37 | 135.70 | 0.00 |
1,000 getVertex | 0.05 | 1.91e+4 | 1.12e-5 |
1,000 getEdge | 22.75 | 43.96 | 0.00 |
tarjan | 196.98 | 5.08 | 0.01 |
tarjan all | 217.25 | 4.60 | 0.03 |
topologicalSort | 177.30 | 5.64 | 0.02 |
-
-
hash-map
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 set | 153.74 | 6.50 | 0.07 |
1,000,000 Map set | 330.02 | 3.03 | 0.16 |
1,000,000 Set add | 258.64 | 3.87 | 0.06 |
1,000,000 set & get | 138.80 | 7.20 | 0.06 |
1,000,000 Map set & get | 352.63 | 2.84 | 0.05 |
1,000,000 Set add & has | 217.97 | 4.59 | 0.02 |
1,000,000 ObjKey set & get | 414.87 | 2.41 | 0.06 |
1,000,000 Map ObjKey set & get | 389.17 | 2.57 | 0.07 |
1,000,000 Set ObjKey add & has | 352.67 | 2.84 | 0.03 |
-
-
heap
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 90.67 | 11.03 | 0.02 |
100,000 add & dfs | 40.30 | 24.81 | 0.01 |
10,000 fib add & pop | 414.94 | 2.41 | 0.02 |
-
-
doubly-linked-list
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 290.62 | 3.44 | 0.10 |
1,000,000 unshift | 253.88 | 3.94 | 0.10 |
1,000,000 unshift & shift | 259.65 | 3.85 | 0.14 |
1,000,000 insertBefore | 463.16 | 2.16 | 0.10 |
-
-
singly-linked-list
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push & shift | 250.27 | 4.00 | 0.08 |
10,000 push & pop | 261.13 | 3.83 | 0.03 |
10,000 insertBefore | 282.46 | 3.54 | 0.02 |
-
-
max-priority-queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 refill & poll | 10.49 | 95.29 | 0.00 |
-
-
priority-queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 110.63 | 9.04 | 0.01 |
-
-
deque
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 15.89 | 62.92 | 0.00 |
1,000,000 push & pop | 26.45 | 37.81 | 0.01 |
1,000,000 push & shift | 27.52 | 36.34 | 0.00 |
1,000,000 unshift & shift | 28.82 | 34.70 | 0.01 |
-
-
queue
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 51.21 | 19.53 | 0.02 |
1,000,000 push & shift | 105.56 | 9.47 | 0.05 |
-
-
stack
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 43.57 | 22.95 | 0.01 |
1,000,000 push & pop | 55.18 | 18.12 | 0.01 |
-
-
trie
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 push | 54.08 | 18.49 | 0.01 |
100,000 getWords | 77.77 | 12.86 | 0.02 |
-
-
-[//]: # (No deletion!!! End of Replace Section)
-
## 内建的经典算法
@@ -966,7 +912,6 @@ avl2.print();
-
## 软件工程标准
@@ -1016,4 +961,61 @@ avl2.print();
+## 基准测试
+
+[//]: # (No deletion!!! Start of Replace Section)
+
+
avl-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 72.48 | 13.80 | 0.03 |
10,000 add & delete randomly | 144.14 | 6.94 | 0.03 |
10,000 addMany | 69.71 | 14.35 | 0.02 |
10,000 get | 54.21 | 18.45 | 0.01 |
+
+
binary-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 add randomly | 15.84 | 63.14 | 0.00 |
1,000 add & delete randomly | 24.62 | 40.62 | 0.00 |
1,000 addMany | 17.85 | 56.01 | 0.00 |
1,000 get | 20.83 | 48.00 | 0.00 |
1,000 has | 20.78 | 48.13 | 0.00 |
1,000 dfs | 186.06 | 5.37 | 0.02 |
1,000 bfs | 66.58 | 15.02 | 0.02 |
1,000 morris | 298.23 | 3.35 | 0.02 |
+
+
bst
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 add randomly | 55.04 | 18.17 | 0.01 |
10,000 add & delete randomly | 129.85 | 7.70 | 0.01 |
10,000 addMany | 50.40 | 19.84 | 0.01 |
10,000 get | 63.39 | 15.78 | 0.01 |
+
+
rb-tree
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add | 113.25 | 8.83 | 0.02 |
100,000 add & delete randomly | 305.28 | 3.28 | 0.03 |
100,000 getNode | 73.20 | 13.66 | 0.03 |
100,000 add & iterator | 159.80 | 6.26 | 0.06 |
+
+
comparison
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
SRC PQ 10,000 add | 0.17 | 5872.02 | 4.08e-5 |
CJS PQ 10,000 add | 0.20 | 4961.22 | 1.14e-4 |
MJS PQ 10,000 add | 0.74 | 1351.47 | 2.98e-4 |
SRC PQ 10,000 add & pop | 4.62 | 216.49 | 0.00 |
CJS PQ 10,000 add & pop | 4.36 | 229.40 | 0.00 |
MJS PQ 10,000 add & pop | 3.92 | 255.23 | 0.00 |
+
+
directed-graph
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000 addVertex | 0.12 | 8557.70 | 2.46e-5 |
1,000 addEdge | 7.37 | 135.70 | 0.00 |
1,000 getVertex | 0.05 | 1.91e+4 | 1.12e-5 |
1,000 getEdge | 22.75 | 43.96 | 0.00 |
tarjan | 196.98 | 5.08 | 0.01 |
tarjan all | 217.25 | 4.60 | 0.03 |
topologicalSort | 177.30 | 5.64 | 0.02 |
+
+
hash-map
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 set | 153.74 | 6.50 | 0.07 |
1,000,000 Map set | 330.02 | 3.03 | 0.16 |
1,000,000 Set add | 258.64 | 3.87 | 0.06 |
1,000,000 set & get | 138.80 | 7.20 | 0.06 |
1,000,000 Map set & get | 352.63 | 2.84 | 0.05 |
1,000,000 Set add & has | 217.97 | 4.59 | 0.02 |
1,000,000 ObjKey set & get | 414.87 | 2.41 | 0.06 |
1,000,000 Map ObjKey set & get | 389.17 | 2.57 | 0.07 |
1,000,000 Set ObjKey add & has | 352.67 | 2.84 | 0.03 |
+
+
heap
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 90.67 | 11.03 | 0.02 |
100,000 add & dfs | 40.30 | 24.81 | 0.01 |
10,000 fib add & pop | 414.94 | 2.41 | 0.02 |
+
+
doubly-linked-list
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 290.62 | 3.44 | 0.10 |
1,000,000 unshift | 253.88 | 3.94 | 0.10 |
1,000,000 unshift & shift | 259.65 | 3.85 | 0.14 |
1,000,000 insertBefore | 463.16 | 2.16 | 0.10 |
+
+
singly-linked-list
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push & shift | 250.27 | 4.00 | 0.08 |
10,000 push & pop | 261.13 | 3.83 | 0.03 |
10,000 insertBefore | 282.46 | 3.54 | 0.02 |
+
+
max-priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 refill & poll | 10.49 | 95.29 | 0.00 |
+
+
priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 110.63 | 9.04 | 0.01 |
+
+
deque
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 15.89 | 62.92 | 0.00 |
1,000,000 push & pop | 26.45 | 37.81 | 0.01 |
1,000,000 push & shift | 27.52 | 36.34 | 0.00 |
1,000,000 unshift & shift | 28.82 | 34.70 | 0.01 |
+
+
queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 51.21 | 19.53 | 0.02 |
1,000,000 push & shift | 105.56 | 9.47 | 0.05 |
+
+
stack
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 43.57 | 22.95 | 0.01 |
1,000,000 push & pop | 55.18 | 18.12 | 0.01 |
+
+
trie
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 push | 54.08 | 18.49 | 0.01 |
100,000 getWords | 77.77 | 12.86 | 0.02 |
+
+
+[//]: # (No deletion!!! End of Replace Section)
+
+
+
diff --git a/test/unit/data-structures/binary-tree/binary-tree.test.ts b/test/unit/data-structures/binary-tree/binary-tree.test.ts
index a2bcc6f..c5e7225 100644
--- a/test/unit/data-structures/binary-tree/binary-tree.test.ts
+++ b/test/unit/data-structures/binary-tree/binary-tree.test.ts
@@ -264,7 +264,7 @@ describe('BinaryTree', () => {
describe('BinaryTree Morris Traversal', () => {
// Create a binary tree
- const tree = new BinaryTree>();
+ const tree = new BinaryTree();
tree.add(1);
tree.add(2);
tree.add(3);
@@ -448,7 +448,7 @@ describe('BinaryTree', () => {
it('should get the height of the tree', () => {
tree.add([5, 'A']);
- tree.add([3, 'B']);
+ tree.add(3, 'B');
tree.add([7, 'C']);
expect(tree.getHeight()).toBe(1);
diff --git a/test/unit/data-structures/binary-tree/bst.test.ts b/test/unit/data-structures/binary-tree/bst.test.ts
index e684791..6f9717c 100644
--- a/test/unit/data-structures/binary-tree/bst.test.ts
+++ b/test/unit/data-structures/binary-tree/bst.test.ts
@@ -5,7 +5,7 @@ const isDebug = isDebugTest;
describe('BST operations test', () => {
it('should perform various operations on a Binary Search Tree with numeric values', () => {
- const bst = new BST();
+ const bst = new BST();
expect(bst).toBeInstanceOf(BST);
bst.add([11, 11]);
bst.add([3, 3]);
diff --git a/test/unit/data-structures/binary-tree/rb-tree.test.ts b/test/unit/data-structures/binary-tree/rb-tree.test.ts
index 125b8f4..a402de4 100644
--- a/test/unit/data-structures/binary-tree/rb-tree.test.ts
+++ b/test/unit/data-structures/binary-tree/rb-tree.test.ts
@@ -6,10 +6,10 @@ import { OrderedMap } from 'js-sdsl';
const isDebug = isDebugTest;
describe('RedBlackTree', () => {
- let tree: RedBlackTree;
+ let tree: RedBlackTree;
beforeEach(() => {
- tree = new RedBlackTree();
+ tree = new RedBlackTree();
});
describe('add and getNode', () => {
@@ -141,10 +141,10 @@ describe('RedBlackTree', () => {
});
describe('RedBlackTree', () => {
- let tree: RedBlackTree;
+ let tree: RedBlackTree;
beforeEach(() => {
- tree = new RedBlackTree();
+ tree = new RedBlackTree();
});
it('should add nodes into the tree', () => {
@@ -511,7 +511,7 @@ describe('RedBlackTree iterative methods test', () => {
beforeEach(() => {
rbTree = new RedBlackTree();
rbTree.add([1, 'a']);
- rbTree.add([2, 'b']);
+ rbTree.add(2, 'b');
rbTree.add([3, 'c']);
});