data-structure-typed 1.43.1 → 1.43.3
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/.eslintrc.js +3 -1
- package/CHANGELOG.md +1 -1
- package/README.md +7 -0
- package/benchmark/report.html +30 -30
- package/benchmark/report.json +201 -147
- package/dist/cjs/src/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.d.ts +8 -8
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.js +62 -62
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/src/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/src/data-structures/binary-tree/rb-tree.d.ts +4 -4
- package/dist/cjs/src/data-structures/binary-tree/rb-tree.js +1 -1
- package/dist/cjs/src/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/src/data-structures/binary-tree/tree-multimap.d.ts +24 -24
- package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js +50 -50
- package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js.map +1 -1
- package/dist/cjs/src/data-structures/graph/abstract-graph.d.ts +37 -37
- package/dist/cjs/src/data-structures/graph/abstract-graph.js +37 -37
- package/dist/cjs/src/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/src/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/src/data-structures/graph/map-graph.js.map +1 -1
- package/dist/cjs/src/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/src/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/src/interfaces/binary-tree.d.ts +1 -1
- package/dist/mjs/src/data-structures/binary-tree/binary-tree.d.ts +8 -8
- package/dist/mjs/src/data-structures/binary-tree/binary-tree.js +62 -62
- package/dist/mjs/src/data-structures/binary-tree/rb-tree.d.ts +4 -4
- package/dist/mjs/src/data-structures/binary-tree/rb-tree.js +1 -1
- package/dist/mjs/src/data-structures/binary-tree/tree-multimap.d.ts +24 -24
- package/dist/mjs/src/data-structures/binary-tree/tree-multimap.js +50 -50
- package/dist/mjs/src/data-structures/graph/abstract-graph.d.ts +37 -37
- package/dist/mjs/src/data-structures/graph/abstract-graph.js +37 -37
- package/dist/mjs/src/interfaces/binary-tree.d.ts +1 -1
- package/dist/umd/data-structure-typed.js +10497 -0
- package/dist/umd/data-structure-typed.min.js +1 -1
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +1 -1
- package/src/data-structures/binary-tree/avl-tree.ts +2 -3
- package/src/data-structures/binary-tree/binary-tree.ts +85 -92
- package/src/data-structures/binary-tree/bst.ts +14 -22
- package/src/data-structures/binary-tree/rb-tree.ts +11 -20
- package/src/data-structures/binary-tree/tree-multimap.ts +56 -58
- package/src/data-structures/graph/abstract-graph.ts +6 -22
- package/src/data-structures/graph/directed-graph.ts +3 -9
- package/src/data-structures/graph/map-graph.ts +6 -6
- package/src/data-structures/graph/undirected-graph.ts +1 -2
- package/src/data-structures/heap/heap.ts +1 -6
- package/src/data-structures/trie/trie.ts +1 -1
- package/src/interfaces/binary-tree.ts +1 -1
- package/src/types/utils/validate-type.ts +2 -16
- package/test/integration/index.html +50 -4
- package/test/performance/data-structures/binary-tree/rb-tree.test.ts +18 -19
- package/test/performance/data-structures/hash/hash-map.test.ts +10 -13
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +16 -16
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +1 -3
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +10 -12
- package/test/performance/data-structures/queue/deque.test.ts +18 -19
- package/test/performance/data-structures/queue/queue.test.ts +18 -19
- package/test/performance/data-structures/stack/stack.test.ts +10 -11
- package/test/performance/reportor.ts +4 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +0 -1
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +83 -61
- package/test/unit/data-structures/binary-tree/bst.test.ts +2 -6
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +34 -25
- package/test/unit/data-structures/graph/abstract-graph.test.ts +6 -6
- package/test/unit/data-structures/graph/directed-graph.test.ts +8 -28
- package/test/unit/data-structures/heap/heap.test.ts +1 -8
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +34 -12
- package/test/utils/json2html.ts +2 -6
- package/tsup.config.js +19 -1
package/benchmark/report.json
CHANGED
|
@@ -1,341 +1,395 @@
|
|
|
1
1
|
{
|
|
2
|
-
"avl-tree": {
|
|
2
|
+
"avl-tree.test.js": {
|
|
3
3
|
"benchmarks": [
|
|
4
4
|
{
|
|
5
5
|
"test name": "10,000 add randomly",
|
|
6
|
-
"time taken (ms)": "35
|
|
7
|
-
"executions per sec": "
|
|
8
|
-
"sample deviation": "
|
|
6
|
+
"time taken (ms)": "31.35",
|
|
7
|
+
"executions per sec": "31.90",
|
|
8
|
+
"sample deviation": "6.69e-4"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"test name": "10,000 add & delete randomly",
|
|
12
|
-
"time taken (ms)": "
|
|
13
|
-
"executions per sec": "
|
|
14
|
-
"sample deviation": "0.
|
|
12
|
+
"time taken (ms)": "70.29",
|
|
13
|
+
"executions per sec": "14.23",
|
|
14
|
+
"sample deviation": "0.00"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"test name": "10,000 addMany",
|
|
18
|
-
"time taken (ms)": "
|
|
19
|
-
"executions per sec": "
|
|
20
|
-
"sample deviation": "
|
|
18
|
+
"time taken (ms)": "40.95",
|
|
19
|
+
"executions per sec": "24.42",
|
|
20
|
+
"sample deviation": "0.00"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"test name": "10,000 get",
|
|
24
|
-
"time taken (ms)": "
|
|
25
|
-
"executions per sec": "
|
|
26
|
-
"sample deviation": "
|
|
24
|
+
"time taken (ms)": "27.36",
|
|
25
|
+
"executions per sec": "36.55",
|
|
26
|
+
"sample deviation": "3.94e-4"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
|
-
"testName": "avl-tree"
|
|
29
|
+
"testName": "avl-tree.test.js"
|
|
30
30
|
},
|
|
31
|
-
"binary-tree": {
|
|
31
|
+
"binary-tree.test.js": {
|
|
32
32
|
"benchmarks": [
|
|
33
33
|
{
|
|
34
34
|
"test name": "1,000 add randomly",
|
|
35
|
-
"time taken (ms)": "
|
|
36
|
-
"executions per sec": "
|
|
37
|
-
"sample deviation": "
|
|
35
|
+
"time taken (ms)": "12.12",
|
|
36
|
+
"executions per sec": "82.53",
|
|
37
|
+
"sample deviation": "1.47e-4"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"test name": "1,000 add & delete randomly",
|
|
41
|
-
"time taken (ms)": "
|
|
42
|
-
"executions per sec": "
|
|
43
|
-
"sample deviation": "
|
|
41
|
+
"time taken (ms)": "15.54",
|
|
42
|
+
"executions per sec": "64.34",
|
|
43
|
+
"sample deviation": "2.16e-4"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"test name": "1,000 addMany",
|
|
47
|
-
"time taken (ms)": "10.
|
|
48
|
-
"executions per sec": "
|
|
49
|
-
"sample deviation": "2.
|
|
47
|
+
"time taken (ms)": "10.15",
|
|
48
|
+
"executions per sec": "98.55",
|
|
49
|
+
"sample deviation": "2.30e-4"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"test name": "1,000 get",
|
|
53
|
-
"time taken (ms)": "
|
|
54
|
-
"executions per sec": "
|
|
55
|
-
"sample deviation": "
|
|
53
|
+
"time taken (ms)": "17.87",
|
|
54
|
+
"executions per sec": "55.95",
|
|
55
|
+
"sample deviation": "1.46e-4"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"test name": "1,000 dfs",
|
|
59
|
-
"time taken (ms)": "
|
|
60
|
-
"executions per sec": "6.
|
|
61
|
-
"sample deviation": "0.
|
|
59
|
+
"time taken (ms)": "154.81",
|
|
60
|
+
"executions per sec": "6.46",
|
|
61
|
+
"sample deviation": "0.00"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"test name": "1,000 bfs",
|
|
65
|
-
"time taken (ms)": "
|
|
66
|
-
"executions per sec": "
|
|
67
|
-
"sample deviation": "
|
|
65
|
+
"time taken (ms)": "55.20",
|
|
66
|
+
"executions per sec": "18.11",
|
|
67
|
+
"sample deviation": "1.82e-4"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"test name": "1,000 morris",
|
|
71
|
-
"time taken (ms)": "
|
|
72
|
-
"executions per sec": "3.
|
|
73
|
-
"sample deviation": "
|
|
71
|
+
"time taken (ms)": "260.41",
|
|
72
|
+
"executions per sec": "3.84",
|
|
73
|
+
"sample deviation": "5.23e-4"
|
|
74
74
|
}
|
|
75
75
|
],
|
|
76
|
-
"testName": "binary-tree"
|
|
76
|
+
"testName": "binary-tree.test.js"
|
|
77
77
|
},
|
|
78
|
-
"bst": {
|
|
78
|
+
"bst.test.js": {
|
|
79
79
|
"benchmarks": [
|
|
80
80
|
{
|
|
81
81
|
"test name": "10,000 add randomly",
|
|
82
|
-
"time taken (ms)": "
|
|
83
|
-
"executions per sec": "
|
|
84
|
-
"sample deviation": "
|
|
82
|
+
"time taken (ms)": "30.32",
|
|
83
|
+
"executions per sec": "32.98",
|
|
84
|
+
"sample deviation": "2.49e-4"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"test name": "10,000 add & delete randomly",
|
|
88
|
-
"time taken (ms)": "
|
|
89
|
-
"executions per sec": "13.
|
|
88
|
+
"time taken (ms)": "71.51",
|
|
89
|
+
"executions per sec": "13.98",
|
|
90
90
|
"sample deviation": "0.00"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"test name": "10,000 addMany",
|
|
94
|
-
"time taken (ms)": "
|
|
95
|
-
"executions per sec": "
|
|
94
|
+
"time taken (ms)": "28.90",
|
|
95
|
+
"executions per sec": "34.60",
|
|
96
96
|
"sample deviation": "0.00"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"test name": "10,000 get",
|
|
100
|
-
"time taken (ms)": "
|
|
101
|
-
"executions per sec": "
|
|
102
|
-
"sample deviation": "
|
|
100
|
+
"time taken (ms)": "27.75",
|
|
101
|
+
"executions per sec": "36.04",
|
|
102
|
+
"sample deviation": "6.92e-4"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
|
-
"testName": "bst"
|
|
105
|
+
"testName": "bst.test.js"
|
|
106
106
|
},
|
|
107
|
-
"rb-tree": {
|
|
107
|
+
"rb-tree.test.js": {
|
|
108
108
|
"benchmarks": [
|
|
109
109
|
{
|
|
110
110
|
"test name": "100,000 add",
|
|
111
|
-
"time taken (ms)": "
|
|
112
|
-
"executions per sec": "
|
|
113
|
-
"sample deviation": "0.
|
|
111
|
+
"time taken (ms)": "86.45",
|
|
112
|
+
"executions per sec": "11.57",
|
|
113
|
+
"sample deviation": "0.00"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"test name": "100,000 competitor add",
|
|
117
|
+
"time taken (ms)": "46.78",
|
|
118
|
+
"executions per sec": "21.38",
|
|
119
|
+
"sample deviation": "0.00"
|
|
114
120
|
},
|
|
115
121
|
{
|
|
116
122
|
"test name": "100,000 add & delete randomly",
|
|
117
|
-
"time taken (ms)": "
|
|
118
|
-
"executions per sec": "4.
|
|
123
|
+
"time taken (ms)": "219.22",
|
|
124
|
+
"executions per sec": "4.56",
|
|
119
125
|
"sample deviation": "0.01"
|
|
120
126
|
},
|
|
121
127
|
{
|
|
122
128
|
"test name": "100,000 getNode",
|
|
123
|
-
"time taken (ms)": "
|
|
124
|
-
"executions per sec": "
|
|
125
|
-
"sample deviation": "
|
|
129
|
+
"time taken (ms)": "37.83",
|
|
130
|
+
"executions per sec": "26.43",
|
|
131
|
+
"sample deviation": "6.20e-4"
|
|
126
132
|
}
|
|
127
133
|
],
|
|
128
|
-
"testName": "rb-tree"
|
|
134
|
+
"testName": "rb-tree.test.js"
|
|
129
135
|
},
|
|
130
|
-
"directed-graph": {
|
|
136
|
+
"directed-graph.test.js": {
|
|
131
137
|
"benchmarks": [
|
|
132
138
|
{
|
|
133
139
|
"test name": "1,000 addVertex",
|
|
134
140
|
"time taken (ms)": "0.11",
|
|
135
|
-
"executions per sec": "
|
|
136
|
-
"sample deviation": "3.
|
|
141
|
+
"executions per sec": "9232.27",
|
|
142
|
+
"sample deviation": "3.15e-5"
|
|
137
143
|
},
|
|
138
144
|
{
|
|
139
145
|
"test name": "1,000 addEdge",
|
|
140
|
-
"time taken (ms)": "6.
|
|
141
|
-
"executions per sec": "
|
|
142
|
-
"sample deviation": "
|
|
146
|
+
"time taken (ms)": "6.54",
|
|
147
|
+
"executions per sec": "152.80",
|
|
148
|
+
"sample deviation": "8.60e-4"
|
|
143
149
|
},
|
|
144
150
|
{
|
|
145
151
|
"test name": "1,000 getVertex",
|
|
146
152
|
"time taken (ms)": "0.05",
|
|
147
|
-
"executions per sec": "2.
|
|
148
|
-
"sample deviation": "
|
|
153
|
+
"executions per sec": "2.16e+4",
|
|
154
|
+
"sample deviation": "3.45e-7"
|
|
149
155
|
},
|
|
150
156
|
{
|
|
151
157
|
"test name": "1,000 getEdge",
|
|
152
|
-
"time taken (ms)": "
|
|
153
|
-
"executions per sec": "
|
|
158
|
+
"time taken (ms)": "22.17",
|
|
159
|
+
"executions per sec": "45.10",
|
|
154
160
|
"sample deviation": "0.00"
|
|
155
161
|
},
|
|
156
162
|
{
|
|
157
163
|
"test name": "tarjan",
|
|
158
|
-
"time taken (ms)": "
|
|
159
|
-
"executions per sec": "4.
|
|
164
|
+
"time taken (ms)": "211.64",
|
|
165
|
+
"executions per sec": "4.72",
|
|
160
166
|
"sample deviation": "0.01"
|
|
161
167
|
},
|
|
162
168
|
{
|
|
163
169
|
"test name": "tarjan all",
|
|
164
|
-
"time taken (ms)": "
|
|
165
|
-
"executions per sec": "4.
|
|
166
|
-
"sample deviation": "0.
|
|
170
|
+
"time taken (ms)": "209.87",
|
|
171
|
+
"executions per sec": "4.76",
|
|
172
|
+
"sample deviation": "0.00"
|
|
167
173
|
},
|
|
168
174
|
{
|
|
169
175
|
"test name": "topologicalSort",
|
|
170
|
-
"time taken (ms)": "
|
|
171
|
-
"executions per sec": "
|
|
172
|
-
"sample deviation": "0.
|
|
176
|
+
"time taken (ms)": "170.27",
|
|
177
|
+
"executions per sec": "5.87",
|
|
178
|
+
"sample deviation": "0.00"
|
|
173
179
|
}
|
|
174
180
|
],
|
|
175
|
-
"testName": "directed-graph"
|
|
181
|
+
"testName": "directed-graph.test.js"
|
|
176
182
|
},
|
|
177
|
-
"hash-map": {
|
|
183
|
+
"hash-map.test.js": {
|
|
178
184
|
"benchmarks": [
|
|
179
185
|
{
|
|
180
186
|
"test name": "10,000 set",
|
|
181
|
-
"time taken (ms)": "
|
|
182
|
-
"executions per sec": "
|
|
183
|
-
"sample deviation": "0.
|
|
187
|
+
"time taken (ms)": "16.01",
|
|
188
|
+
"executions per sec": "62.47",
|
|
189
|
+
"sample deviation": "0.00"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"test name": "10,000 competitor set",
|
|
193
|
+
"time taken (ms)": "0.57",
|
|
194
|
+
"executions per sec": "1748.11",
|
|
195
|
+
"sample deviation": "1.49e-5"
|
|
184
196
|
},
|
|
185
197
|
{
|
|
186
198
|
"test name": "10,000 set & get",
|
|
187
|
-
"time taken (ms)": "
|
|
188
|
-
"executions per sec": "
|
|
189
|
-
"sample deviation": "
|
|
199
|
+
"time taken (ms)": "34.39",
|
|
200
|
+
"executions per sec": "29.08",
|
|
201
|
+
"sample deviation": "4.42e-4"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"test name": "10,000 competitor set & get",
|
|
205
|
+
"time taken (ms)": "0.67",
|
|
206
|
+
"executions per sec": "1488.07",
|
|
207
|
+
"sample deviation": "3.39e-5"
|
|
190
208
|
}
|
|
191
209
|
],
|
|
192
|
-
"testName": "hash-map"
|
|
210
|
+
"testName": "hash-map.test.js"
|
|
193
211
|
},
|
|
194
|
-
"heap": {
|
|
212
|
+
"heap.test.js": {
|
|
195
213
|
"benchmarks": [
|
|
196
214
|
{
|
|
197
215
|
"test name": "10,000 add & pop",
|
|
198
|
-
"time taken (ms)": "4.
|
|
199
|
-
"executions per sec": "
|
|
200
|
-
"sample deviation": "
|
|
216
|
+
"time taken (ms)": "4.67",
|
|
217
|
+
"executions per sec": "213.95",
|
|
218
|
+
"sample deviation": "2.17e-4"
|
|
201
219
|
},
|
|
202
220
|
{
|
|
203
221
|
"test name": "10,000 fib add & pop",
|
|
204
|
-
"time taken (ms)": "
|
|
205
|
-
"executions per sec": "2.
|
|
206
|
-
"sample deviation": "0.
|
|
222
|
+
"time taken (ms)": "352.78",
|
|
223
|
+
"executions per sec": "2.83",
|
|
224
|
+
"sample deviation": "0.01"
|
|
207
225
|
}
|
|
208
226
|
],
|
|
209
|
-
"testName": "heap"
|
|
227
|
+
"testName": "heap.test.js"
|
|
210
228
|
},
|
|
211
|
-
"doubly-linked-list": {
|
|
229
|
+
"doubly-linked-list.test.js": {
|
|
212
230
|
"benchmarks": [
|
|
213
231
|
{
|
|
214
232
|
"test name": "1,000,000 unshift",
|
|
215
|
-
"time taken (ms)": "
|
|
216
|
-
"executions per sec": "4.
|
|
217
|
-
"sample deviation": "0.
|
|
233
|
+
"time taken (ms)": "230.25",
|
|
234
|
+
"executions per sec": "4.34",
|
|
235
|
+
"sample deviation": "0.03"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"test name": "1,000,000 competitor unshift",
|
|
239
|
+
"time taken (ms)": "82.22",
|
|
240
|
+
"executions per sec": "12.16",
|
|
241
|
+
"sample deviation": "0.02"
|
|
218
242
|
},
|
|
219
243
|
{
|
|
220
244
|
"test name": "1,000,000 unshift & shift",
|
|
221
|
-
"time taken (ms)": "
|
|
222
|
-
"executions per sec": "
|
|
245
|
+
"time taken (ms)": "166.38",
|
|
246
|
+
"executions per sec": "6.01",
|
|
223
247
|
"sample deviation": "0.02"
|
|
224
248
|
},
|
|
225
249
|
{
|
|
226
250
|
"test name": "1,000,000 insertBefore",
|
|
227
|
-
"time taken (ms)": "
|
|
228
|
-
"executions per sec": "3.
|
|
251
|
+
"time taken (ms)": "319.13",
|
|
252
|
+
"executions per sec": "3.13",
|
|
229
253
|
"sample deviation": "0.07"
|
|
230
254
|
}
|
|
231
255
|
],
|
|
232
|
-
"testName": "doubly-linked-list"
|
|
256
|
+
"testName": "doubly-linked-list.test.js"
|
|
233
257
|
},
|
|
234
|
-
"singly-linked-list": {
|
|
258
|
+
"singly-linked-list.test.js": {
|
|
235
259
|
"benchmarks": [
|
|
236
260
|
{
|
|
237
261
|
"test name": "10,000 push & pop",
|
|
238
|
-
"time taken (ms)": "
|
|
239
|
-
"executions per sec": "4.
|
|
240
|
-
"sample deviation": "0.
|
|
262
|
+
"time taken (ms)": "222.94",
|
|
263
|
+
"executions per sec": "4.49",
|
|
264
|
+
"sample deviation": "0.02"
|
|
241
265
|
},
|
|
242
266
|
{
|
|
243
267
|
"test name": "10,000 insertBefore",
|
|
244
|
-
"time taken (ms)": "
|
|
245
|
-
"executions per sec": "
|
|
268
|
+
"time taken (ms)": "249.12",
|
|
269
|
+
"executions per sec": "4.01",
|
|
246
270
|
"sample deviation": "0.01"
|
|
247
271
|
}
|
|
248
272
|
],
|
|
249
|
-
"testName": "singly-linked-list"
|
|
273
|
+
"testName": "singly-linked-list.test.js"
|
|
250
274
|
},
|
|
251
|
-
"max-priority-queue": {
|
|
275
|
+
"max-priority-queue.test.js": {
|
|
252
276
|
"benchmarks": [
|
|
253
277
|
{
|
|
254
278
|
"test name": "10,000 refill & poll",
|
|
255
|
-
"time taken (ms)": "11.
|
|
256
|
-
"executions per sec": "
|
|
257
|
-
"sample deviation": "
|
|
279
|
+
"time taken (ms)": "11.37",
|
|
280
|
+
"executions per sec": "87.97",
|
|
281
|
+
"sample deviation": "1.21e-4"
|
|
258
282
|
}
|
|
259
283
|
],
|
|
260
|
-
"testName": "max-priority-queue"
|
|
284
|
+
"testName": "max-priority-queue.test.js"
|
|
261
285
|
},
|
|
262
|
-
"priority-queue": {
|
|
286
|
+
"priority-queue.test.js": {
|
|
263
287
|
"benchmarks": [
|
|
264
288
|
{
|
|
265
289
|
"test name": "10,000 add & pop",
|
|
266
|
-
"time taken (ms)": "12.
|
|
267
|
-
"executions per sec": "
|
|
268
|
-
"sample deviation": "
|
|
290
|
+
"time taken (ms)": "12.37",
|
|
291
|
+
"executions per sec": "80.85",
|
|
292
|
+
"sample deviation": "6.48e-5"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"test name": "10,000 competitor add & pop",
|
|
296
|
+
"time taken (ms)": "2.13",
|
|
297
|
+
"executions per sec": "468.67",
|
|
298
|
+
"sample deviation": "6.91e-5"
|
|
269
299
|
}
|
|
270
300
|
],
|
|
271
|
-
"testName": "priority-queue"
|
|
301
|
+
"testName": "priority-queue.test.js"
|
|
272
302
|
},
|
|
273
|
-
"deque": {
|
|
303
|
+
"deque.test.js": {
|
|
274
304
|
"benchmarks": [
|
|
275
305
|
{
|
|
276
306
|
"test name": "1,000,000 push",
|
|
277
|
-
"time taken (ms)": "
|
|
278
|
-
"executions per sec": "4.
|
|
307
|
+
"time taken (ms)": "207.83",
|
|
308
|
+
"executions per sec": "4.81",
|
|
279
309
|
"sample deviation": "0.03"
|
|
280
310
|
},
|
|
311
|
+
{
|
|
312
|
+
"test name": "1,000,000 competitor push",
|
|
313
|
+
"time taken (ms)": "14.45",
|
|
314
|
+
"executions per sec": "69.20",
|
|
315
|
+
"sample deviation": "1.19e-4"
|
|
316
|
+
},
|
|
281
317
|
{
|
|
282
318
|
"test name": "1,000,000 shift",
|
|
283
|
-
"time taken (ms)": "
|
|
284
|
-
"executions per sec": "
|
|
319
|
+
"time taken (ms)": "24.73",
|
|
320
|
+
"executions per sec": "40.43",
|
|
285
321
|
"sample deviation": "0.00"
|
|
286
322
|
}
|
|
287
323
|
],
|
|
288
|
-
"testName": "deque"
|
|
324
|
+
"testName": "deque.test.js"
|
|
289
325
|
},
|
|
290
|
-
"queue": {
|
|
326
|
+
"queue.test.js": {
|
|
291
327
|
"benchmarks": [
|
|
292
328
|
{
|
|
293
329
|
"test name": "1,000,000 push",
|
|
294
|
-
"time taken (ms)": "
|
|
295
|
-
"executions per sec": "
|
|
330
|
+
"time taken (ms)": "43.17",
|
|
331
|
+
"executions per sec": "23.16",
|
|
332
|
+
"sample deviation": "0.01"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"test name": "1,000,000 competitor push",
|
|
336
|
+
"time taken (ms)": "47.17",
|
|
337
|
+
"executions per sec": "21.20",
|
|
296
338
|
"sample deviation": "0.01"
|
|
297
339
|
},
|
|
298
340
|
{
|
|
299
341
|
"test name": "1,000,000 push & shift",
|
|
300
|
-
"time taken (ms)": "
|
|
301
|
-
"executions per sec": "12.
|
|
302
|
-
"sample deviation": "
|
|
342
|
+
"time taken (ms)": "79.55",
|
|
343
|
+
"executions per sec": "12.57",
|
|
344
|
+
"sample deviation": "7.42e-4"
|
|
303
345
|
}
|
|
304
346
|
],
|
|
305
|
-
"testName": "queue"
|
|
347
|
+
"testName": "queue.test.js"
|
|
306
348
|
},
|
|
307
|
-
"stack": {
|
|
349
|
+
"stack.test.js": {
|
|
308
350
|
"benchmarks": [
|
|
309
351
|
{
|
|
310
352
|
"test name": "1,000,000 push",
|
|
311
|
-
"time taken (ms)": "43.
|
|
312
|
-
"executions per sec": "
|
|
353
|
+
"time taken (ms)": "43.39",
|
|
354
|
+
"executions per sec": "23.05",
|
|
355
|
+
"sample deviation": "0.01"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"test name": "1,000,000 competitor push",
|
|
359
|
+
"time taken (ms)": "43.04",
|
|
360
|
+
"executions per sec": "23.23",
|
|
313
361
|
"sample deviation": "0.01"
|
|
314
362
|
},
|
|
315
363
|
{
|
|
316
364
|
"test name": "1,000,000 push & pop",
|
|
317
|
-
"time taken (ms)": "50.
|
|
318
|
-
"executions per sec": "19.
|
|
365
|
+
"time taken (ms)": "50.18",
|
|
366
|
+
"executions per sec": "19.93",
|
|
367
|
+
"sample deviation": "0.01"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"test name": "1,000,000 competitor push & pop",
|
|
371
|
+
"time taken (ms)": "49.06",
|
|
372
|
+
"executions per sec": "20.38",
|
|
319
373
|
"sample deviation": "0.00"
|
|
320
374
|
}
|
|
321
375
|
],
|
|
322
|
-
"testName": "stack"
|
|
376
|
+
"testName": "stack.test.js"
|
|
323
377
|
},
|
|
324
|
-
"trie": {
|
|
378
|
+
"trie.test.js": {
|
|
325
379
|
"benchmarks": [
|
|
326
380
|
{
|
|
327
381
|
"test name": "100,000 push",
|
|
328
|
-
"time taken (ms)": "
|
|
329
|
-
"executions per sec": "
|
|
330
|
-
"sample deviation": "
|
|
382
|
+
"time taken (ms)": "42.19",
|
|
383
|
+
"executions per sec": "23.70",
|
|
384
|
+
"sample deviation": "6.72e-4"
|
|
331
385
|
},
|
|
332
386
|
{
|
|
333
387
|
"test name": "100,000 getWords",
|
|
334
|
-
"time taken (ms)": "
|
|
335
|
-
"executions per sec": "
|
|
336
|
-
"sample deviation": "0.
|
|
388
|
+
"time taken (ms)": "95.42",
|
|
389
|
+
"executions per sec": "10.48",
|
|
390
|
+
"sample deviation": "0.00"
|
|
337
391
|
}
|
|
338
392
|
],
|
|
339
|
-
"testName": "trie"
|
|
393
|
+
"testName": "trie.test.js"
|
|
340
394
|
}
|
|
341
395
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avl-tree.js","sourceRoot":"","sources":["../../../../../src/data-structures/binary-tree/avl-tree.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+BAAmC;AAKnC,MAAa,WAAyE,SAAQ,aAAa;IAGzG,YAAY,GAAW,EAAE,KAAS;QAChC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,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C,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC;YAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC;QAC7B,IAAI,CAAC;YAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC;YAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AAzZD,0BAyZC"}
|
|
@@ -381,7 +381,7 @@ export declare class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = Binary
|
|
|
381
381
|
* @param {any} node - The parameter `node` is of type `any`, which means it can be any data type.
|
|
382
382
|
* @returns a boolean value.
|
|
383
383
|
*/
|
|
384
|
-
isNodeOrNull(node: any): node is
|
|
384
|
+
isNodeOrNull(node: any): node is N | null;
|
|
385
385
|
/**
|
|
386
386
|
* The function "isNodeKey" checks if a potential key is a number.
|
|
387
387
|
* @param {any} potentialKey - The potentialKey parameter is of type any, which means it can be any
|
|
@@ -439,6 +439,13 @@ export declare class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = Binary
|
|
|
439
439
|
* binary tree nodes in a specific order.
|
|
440
440
|
*/
|
|
441
441
|
[Symbol.iterator](node?: N | null | undefined): Generator<BTNKey, void, undefined>;
|
|
442
|
+
/**
|
|
443
|
+
* The `print` function is used to display a binary tree structure in a visually appealing way.
|
|
444
|
+
* @param {N | null | undefined} root - The `root` parameter is of type `BTNKey | N | null |
|
|
445
|
+
* undefined`. It represents the root node of a binary tree. The root node can have one of the
|
|
446
|
+
* following types:
|
|
447
|
+
*/
|
|
448
|
+
print(beginRoot?: BTNKey | N | null | undefined): void;
|
|
442
449
|
protected _defaultOneParamCallback: (node: N) => number;
|
|
443
450
|
/**
|
|
444
451
|
* Swap the data of two nodes in the binary tree.
|
|
@@ -466,11 +473,4 @@ export declare class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = Binary
|
|
|
466
473
|
* type `N` or `null`.
|
|
467
474
|
*/
|
|
468
475
|
protected _setRoot(v: N | null | undefined): void;
|
|
469
|
-
/**
|
|
470
|
-
* The `print` function is used to display a binary tree structure in a visually appealing way.
|
|
471
|
-
* @param {N | null | undefined} root - The `root` parameter is of type `BTNKey | N | null |
|
|
472
|
-
* undefined`. It represents the root node of a binary tree. The root node can have one of the
|
|
473
|
-
* following types:
|
|
474
|
-
*/
|
|
475
|
-
print(beginRoot?: BTNKey | N | null | undefined): void;
|
|
476
476
|
}
|