data-structure-typed 1.41.9 → 1.42.0
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 +12 -41
- package/benchmark/report.html +12 -12
- package/benchmark/report.json +107 -107
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.d.ts +12 -61
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.js +137 -50
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/mjs/src/data-structures/binary-tree/binary-tree.d.ts +12 -61
- package/dist/mjs/src/data-structures/binary-tree/binary-tree.js +137 -50
- 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/binary-tree.ts +209 -57
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +27 -6
package/benchmark/report.json
CHANGED
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
"benchmarks": [
|
|
4
4
|
{
|
|
5
5
|
"test name": "10,000 add randomly",
|
|
6
|
-
"time taken (ms)": "
|
|
7
|
-
"executions per sec": "
|
|
8
|
-
"sample deviation": "
|
|
6
|
+
"time taken (ms)": "34.10",
|
|
7
|
+
"executions per sec": "29.32",
|
|
8
|
+
"sample deviation": "0.00"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"test name": "10,000 add & delete randomly",
|
|
12
|
-
"time taken (ms)": "
|
|
13
|
-
"executions per sec": "
|
|
12
|
+
"time taken (ms)": "74.44",
|
|
13
|
+
"executions per sec": "13.43",
|
|
14
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)": "44.65",
|
|
19
|
+
"executions per sec": "22.39",
|
|
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)": "30.76",
|
|
25
|
+
"executions per sec": "32.51",
|
|
26
|
+
"sample deviation": "0.00"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"testName": "avl-tree"
|
|
@@ -32,45 +32,45 @@
|
|
|
32
32
|
"benchmarks": [
|
|
33
33
|
{
|
|
34
34
|
"test name": "1,000 add randomly",
|
|
35
|
-
"time taken (ms)": "13.
|
|
36
|
-
"executions per sec": "
|
|
37
|
-
"sample deviation": "
|
|
35
|
+
"time taken (ms)": "13.23",
|
|
36
|
+
"executions per sec": "75.58",
|
|
37
|
+
"sample deviation": "2.94e-4"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"test name": "1,000 add & delete randomly",
|
|
41
|
-
"time taken (ms)": "16.
|
|
42
|
-
"executions per sec": "
|
|
43
|
-
"sample deviation": "
|
|
41
|
+
"time taken (ms)": "16.29",
|
|
42
|
+
"executions per sec": "61.38",
|
|
43
|
+
"sample deviation": "7.50e-4"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"test name": "1,000 addMany",
|
|
47
|
-
"time taken (ms)": "10.
|
|
48
|
-
"executions per sec": "94.
|
|
49
|
-
"sample deviation": "1.
|
|
47
|
+
"time taken (ms)": "10.58",
|
|
48
|
+
"executions per sec": "94.51",
|
|
49
|
+
"sample deviation": "1.17e-4"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"test name": "1,000 get",
|
|
53
|
-
"time taken (ms)": "18.
|
|
54
|
-
"executions per sec": "
|
|
55
|
-
"sample deviation": "
|
|
53
|
+
"time taken (ms)": "18.09",
|
|
54
|
+
"executions per sec": "55.28",
|
|
55
|
+
"sample deviation": "3.74e-4"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"test name": "1,000 dfs",
|
|
59
|
-
"time taken (ms)": "
|
|
60
|
-
"executions per sec": "
|
|
61
|
-
"sample deviation": "
|
|
59
|
+
"time taken (ms)": "71.97",
|
|
60
|
+
"executions per sec": "13.89",
|
|
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)": "57.49",
|
|
66
|
+
"executions per sec": "17.39",
|
|
67
|
+
"sample deviation": "5.01e-4"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"test name": "1,000 morris",
|
|
71
|
-
"time taken (ms)": "37.
|
|
72
|
-
"executions per sec": "26.
|
|
73
|
-
"sample deviation": "2.
|
|
71
|
+
"time taken (ms)": "37.35",
|
|
72
|
+
"executions per sec": "26.78",
|
|
73
|
+
"sample deviation": "2.94e-4"
|
|
74
74
|
}
|
|
75
75
|
],
|
|
76
76
|
"testName": "binary-tree"
|
|
@@ -79,27 +79,27 @@
|
|
|
79
79
|
"benchmarks": [
|
|
80
80
|
{
|
|
81
81
|
"test name": "10,000 add randomly",
|
|
82
|
-
"time taken (ms)": "
|
|
83
|
-
"executions per sec": "
|
|
84
|
-
"sample deviation": "3.
|
|
82
|
+
"time taken (ms)": "33.54",
|
|
83
|
+
"executions per sec": "29.81",
|
|
84
|
+
"sample deviation": "3.61e-4"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"test name": "10,000 add & delete randomly",
|
|
88
|
-
"time taken (ms)": "
|
|
89
|
-
"executions per sec": "13.
|
|
90
|
-
"sample deviation": "0.
|
|
88
|
+
"time taken (ms)": "75.05",
|
|
89
|
+
"executions per sec": "13.33",
|
|
90
|
+
"sample deviation": "0.00"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"test name": "10,000 addMany",
|
|
94
|
-
"time taken (ms)": "
|
|
95
|
-
"executions per sec": "
|
|
96
|
-
"sample deviation": "
|
|
94
|
+
"time taken (ms)": "31.50",
|
|
95
|
+
"executions per sec": "31.74",
|
|
96
|
+
"sample deviation": "4.90e-4"
|
|
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)": "34.92",
|
|
101
|
+
"executions per sec": "28.64",
|
|
102
|
+
"sample deviation": "0.01"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"testName": "bst"
|
|
@@ -108,21 +108,21 @@
|
|
|
108
108
|
"benchmarks": [
|
|
109
109
|
{
|
|
110
110
|
"test name": "100,000 add randomly",
|
|
111
|
-
"time taken (ms)": "
|
|
112
|
-
"executions per sec": "
|
|
113
|
-
"sample deviation": "0.
|
|
111
|
+
"time taken (ms)": "80.61",
|
|
112
|
+
"executions per sec": "12.41",
|
|
113
|
+
"sample deviation": "0.01"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"test name": "100,000 add & 1000 delete randomly",
|
|
117
|
-
"time taken (ms)": "
|
|
118
|
-
"executions per sec": "
|
|
117
|
+
"time taken (ms)": "86.72",
|
|
118
|
+
"executions per sec": "11.53",
|
|
119
119
|
"sample deviation": "0.01"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"test name": "100,000 getNode",
|
|
123
|
-
"time taken (ms)": "
|
|
124
|
-
"executions per sec": "
|
|
125
|
-
"sample deviation": "0.
|
|
123
|
+
"time taken (ms)": "75.09",
|
|
124
|
+
"executions per sec": "13.32",
|
|
125
|
+
"sample deviation": "0.03"
|
|
126
126
|
}
|
|
127
127
|
],
|
|
128
128
|
"testName": "rb-tree"
|
|
@@ -131,45 +131,45 @@
|
|
|
131
131
|
"benchmarks": [
|
|
132
132
|
{
|
|
133
133
|
"test name": "1,000 addVertex",
|
|
134
|
-
"time taken (ms)": "0.
|
|
135
|
-
"executions per sec": "
|
|
136
|
-
"sample deviation": "
|
|
134
|
+
"time taken (ms)": "0.12",
|
|
135
|
+
"executions per sec": "8506.54",
|
|
136
|
+
"sample deviation": "3.38e-5"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"test name": "1,000 addEdge",
|
|
140
|
-
"time taken (ms)": "6.
|
|
141
|
-
"executions per sec": "
|
|
140
|
+
"time taken (ms)": "6.96",
|
|
141
|
+
"executions per sec": "143.61",
|
|
142
142
|
"sample deviation": "0.00"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"test name": "1,000 getVertex",
|
|
146
146
|
"time taken (ms)": "0.05",
|
|
147
|
-
"executions per sec": "
|
|
148
|
-
"sample deviation": "
|
|
147
|
+
"executions per sec": "1.85e+4",
|
|
148
|
+
"sample deviation": "2.60e-5"
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
"test name": "1,000 getEdge",
|
|
152
|
-
"time taken (ms)": "23.
|
|
153
|
-
"executions per sec": "
|
|
154
|
-
"sample deviation": "0.
|
|
152
|
+
"time taken (ms)": "23.99",
|
|
153
|
+
"executions per sec": "41.69",
|
|
154
|
+
"sample deviation": "0.01"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"test name": "tarjan",
|
|
158
|
-
"time taken (ms)": "
|
|
159
|
-
"executions per sec": "4.
|
|
160
|
-
"sample deviation": "0.
|
|
158
|
+
"time taken (ms)": "205.07",
|
|
159
|
+
"executions per sec": "4.88",
|
|
160
|
+
"sample deviation": "0.04"
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"test name": "tarjan all",
|
|
164
|
-
"time taken (ms)": "
|
|
165
|
-
"executions per sec": "4.
|
|
166
|
-
"sample deviation": "0.
|
|
164
|
+
"time taken (ms)": "211.45",
|
|
165
|
+
"executions per sec": "4.73",
|
|
166
|
+
"sample deviation": "0.04"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"test name": "topologicalSort",
|
|
170
|
-
"time taken (ms)": "186.
|
|
171
|
-
"executions per sec": "5.
|
|
172
|
-
"sample deviation": "0.
|
|
170
|
+
"time taken (ms)": "186.95",
|
|
171
|
+
"executions per sec": "5.35",
|
|
172
|
+
"sample deviation": "0.06"
|
|
173
173
|
}
|
|
174
174
|
],
|
|
175
175
|
"testName": "directed-graph"
|
|
@@ -178,15 +178,15 @@
|
|
|
178
178
|
"benchmarks": [
|
|
179
179
|
{
|
|
180
180
|
"test name": "10,000 add & pop",
|
|
181
|
-
"time taken (ms)": "
|
|
182
|
-
"executions per sec": "
|
|
183
|
-
"sample deviation": "
|
|
181
|
+
"time taken (ms)": "5.03",
|
|
182
|
+
"executions per sec": "198.77",
|
|
183
|
+
"sample deviation": "0.00"
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
"test name": "10,000 fib add & pop",
|
|
187
|
-
"time taken (ms)": "
|
|
188
|
-
"executions per sec": "2.
|
|
189
|
-
"sample deviation": "0.
|
|
187
|
+
"time taken (ms)": "373.81",
|
|
188
|
+
"executions per sec": "2.68",
|
|
189
|
+
"sample deviation": "0.03"
|
|
190
190
|
}
|
|
191
191
|
],
|
|
192
192
|
"testName": "heap"
|
|
@@ -195,21 +195,21 @@
|
|
|
195
195
|
"benchmarks": [
|
|
196
196
|
{
|
|
197
197
|
"test name": "1,000,000 unshift",
|
|
198
|
-
"time taken (ms)": "
|
|
199
|
-
"executions per sec": "4.
|
|
200
|
-
"sample deviation": "0.
|
|
198
|
+
"time taken (ms)": "231.55",
|
|
199
|
+
"executions per sec": "4.32",
|
|
200
|
+
"sample deviation": "0.03"
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
"test name": "1,000,000 unshift & shift",
|
|
204
|
-
"time taken (ms)": "
|
|
205
|
-
"executions per sec": "6.
|
|
206
|
-
"sample deviation": "0.
|
|
204
|
+
"time taken (ms)": "163.44",
|
|
205
|
+
"executions per sec": "6.12",
|
|
206
|
+
"sample deviation": "0.01"
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
"test name": "1,000,000 insertBefore",
|
|
210
|
-
"time taken (ms)": "
|
|
211
|
-
"executions per sec": "3.
|
|
212
|
-
"sample deviation": "0.
|
|
210
|
+
"time taken (ms)": "301.21",
|
|
211
|
+
"executions per sec": "3.32",
|
|
212
|
+
"sample deviation": "0.03"
|
|
213
213
|
}
|
|
214
214
|
],
|
|
215
215
|
"testName": "doubly-linked-list"
|
|
@@ -218,14 +218,14 @@
|
|
|
218
218
|
"benchmarks": [
|
|
219
219
|
{
|
|
220
220
|
"test name": "10,000 push & pop",
|
|
221
|
-
"time taken (ms)": "
|
|
222
|
-
"executions per sec": "4.
|
|
221
|
+
"time taken (ms)": "216.27",
|
|
222
|
+
"executions per sec": "4.62",
|
|
223
223
|
"sample deviation": "0.01"
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
"test name": "10,000 insertBefore",
|
|
227
|
-
"time taken (ms)": "
|
|
228
|
-
"executions per sec": "
|
|
227
|
+
"time taken (ms)": "252.18",
|
|
228
|
+
"executions per sec": "3.97",
|
|
229
229
|
"sample deviation": "0.01"
|
|
230
230
|
}
|
|
231
231
|
],
|
|
@@ -235,9 +235,9 @@
|
|
|
235
235
|
"benchmarks": [
|
|
236
236
|
{
|
|
237
237
|
"test name": "10,000 refill & poll",
|
|
238
|
-
"time taken (ms)": "11.
|
|
239
|
-
"executions per sec": "86.
|
|
240
|
-
"sample deviation": "
|
|
238
|
+
"time taken (ms)": "11.56",
|
|
239
|
+
"executions per sec": "86.52",
|
|
240
|
+
"sample deviation": "2.35e-4"
|
|
241
241
|
}
|
|
242
242
|
],
|
|
243
243
|
"testName": "max-priority-queue"
|
|
@@ -246,14 +246,14 @@
|
|
|
246
246
|
"benchmarks": [
|
|
247
247
|
{
|
|
248
248
|
"test name": "1,000,000 push",
|
|
249
|
-
"time taken (ms)": "
|
|
249
|
+
"time taken (ms)": "222.98",
|
|
250
250
|
"executions per sec": "4.48",
|
|
251
|
-
"sample deviation": "0.
|
|
251
|
+
"sample deviation": "0.05"
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
"test name": "1,000,000 shift",
|
|
255
|
-
"time taken (ms)": "
|
|
256
|
-
"executions per sec": "
|
|
255
|
+
"time taken (ms)": "26.01",
|
|
256
|
+
"executions per sec": "38.44",
|
|
257
257
|
"sample deviation": "0.00"
|
|
258
258
|
}
|
|
259
259
|
],
|
|
@@ -263,14 +263,14 @@
|
|
|
263
263
|
"benchmarks": [
|
|
264
264
|
{
|
|
265
265
|
"test name": "1,000,000 push",
|
|
266
|
-
"time taken (ms)": "
|
|
267
|
-
"executions per sec": "
|
|
266
|
+
"time taken (ms)": "44.93",
|
|
267
|
+
"executions per sec": "22.26",
|
|
268
268
|
"sample deviation": "0.01"
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
"test name": "1,000,000 push & shift",
|
|
272
|
-
"time taken (ms)": "
|
|
273
|
-
"executions per sec": "12.
|
|
272
|
+
"time taken (ms)": "80.87",
|
|
273
|
+
"executions per sec": "12.37",
|
|
274
274
|
"sample deviation": "0.00"
|
|
275
275
|
}
|
|
276
276
|
],
|
|
@@ -280,15 +280,15 @@
|
|
|
280
280
|
"benchmarks": [
|
|
281
281
|
{
|
|
282
282
|
"test name": "100,000 push",
|
|
283
|
-
"time taken (ms)": "
|
|
284
|
-
"executions per sec": "
|
|
285
|
-
"sample deviation": "0.
|
|
283
|
+
"time taken (ms)": "57.22",
|
|
284
|
+
"executions per sec": "17.48",
|
|
285
|
+
"sample deviation": "0.01"
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
288
|
"test name": "100,000 getWords",
|
|
289
|
-
"time taken (ms)": "
|
|
290
|
-
"executions per sec": "
|
|
291
|
-
"sample deviation": "0.
|
|
289
|
+
"time taken (ms)": "99.32",
|
|
290
|
+
"executions per sec": "10.07",
|
|
291
|
+
"sample deviation": "0.01"
|
|
292
292
|
}
|
|
293
293
|
],
|
|
294
294
|
"testName": "trie"
|
|
@@ -238,67 +238,18 @@ export declare class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = Binary
|
|
|
238
238
|
* @returns a boolean value.
|
|
239
239
|
*/
|
|
240
240
|
isBST(iterationType?: IterationType): boolean;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
* @returns The function `subTreeTraverse` returns an array of `ReturnType<BTNCallback<N>>`.
|
|
254
|
-
*/
|
|
255
|
-
subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKey | N | null, iterationType?: IterationType): ReturnType<C>[];
|
|
256
|
-
/**
|
|
257
|
-
* The `dfs` function performs a depth-first search traversal on a binary tree, executing a callback
|
|
258
|
-
* function on each node according to a specified order pattern.
|
|
259
|
-
* @param callback - The `callback` parameter is a function that will be called on each node during
|
|
260
|
-
* the depth-first search traversal. It takes a node as input and returns a value. The default value
|
|
261
|
-
* is `this.defaultOneParamCallback`, which is a callback function defined elsewhere in the code.
|
|
262
|
-
* @param {DFSOrderPattern} [pattern=in] - The `pattern` parameter determines the order in which the
|
|
263
|
-
* nodes are visited during the depth-first search. There are three possible values for `pattern`:
|
|
264
|
-
* @param {N | null} beginRoot - The `beginRoot` parameter is the starting node for the depth-first
|
|
265
|
-
* search. It determines where the search will begin in the tree or graph structure. If `beginRoot`
|
|
266
|
-
* is `null`, an empty array will be returned.
|
|
267
|
-
* @param {IterationType} iterationType - The `iterationType` parameter determines the type of
|
|
268
|
-
* iteration used in the depth-first search algorithm. It can have two possible values:
|
|
269
|
-
* @returns The function `dfs` returns an array of `ReturnType<BTNCallback<N>>` values.
|
|
270
|
-
*/
|
|
271
|
-
dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: N | null, iterationType?: IterationType): ReturnType<C>[];
|
|
272
|
-
/**
|
|
273
|
-
* The bfs function performs a breadth-first search traversal on a binary tree, executing a callback
|
|
274
|
-
* function on each node.
|
|
275
|
-
* @param callback - The `callback` parameter is a function that will be called for each node in the
|
|
276
|
-
* breadth-first search. It takes a node of type `N` as its argument and returns a value of type
|
|
277
|
-
* `ReturnType<BTNCallback<N>>`. The default value for this parameter is `this.defaultOneParamCallback
|
|
278
|
-
* @param {N | null} beginRoot - The `beginRoot` parameter is the starting node for the breadth-first
|
|
279
|
-
* search. It determines from which node the search will begin. If `beginRoot` is `null`, the search
|
|
280
|
-
* will not be performed and an empty array will be returned.
|
|
281
|
-
* @param iterationType - The `iterationType` parameter determines the type of iteration to be used
|
|
282
|
-
* in the breadth-first search (BFS) algorithm. It can have two possible values:
|
|
283
|
-
* @returns The function `bfs` returns an array of `ReturnType<BTNCallback<N>>[]`.
|
|
284
|
-
*/
|
|
285
|
-
bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType): ReturnType<C>[];
|
|
286
|
-
/**
|
|
287
|
-
* The `listLevels` function takes a binary tree node and a callback function, and returns an array
|
|
288
|
-
* of arrays representing the levels of the tree.
|
|
289
|
-
* @param {C} callback - The `callback` parameter is a function that will be called on each node in
|
|
290
|
-
* the tree. It takes a node as input and returns a value. The return type of the callback function
|
|
291
|
-
* is determined by the generic type `C`.
|
|
292
|
-
* @param {N | null} beginRoot - The `beginRoot` parameter represents the starting node of the binary tree
|
|
293
|
-
* traversal. It can be any node in the binary tree. If no node is provided, the traversal will start
|
|
294
|
-
* from the root node of the binary tree.
|
|
295
|
-
* @param iterationType - The `iterationType` parameter determines whether the tree traversal is done
|
|
296
|
-
* recursively or iteratively. It can have two possible values:
|
|
297
|
-
* @returns The function `listLevels` returns an array of arrays, where each inner array represents a
|
|
298
|
-
* level in a binary tree. Each inner array contains the return type of the provided callback
|
|
299
|
-
* function `C` applied to the nodes at that level.
|
|
300
|
-
*/
|
|
301
|
-
listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType): ReturnType<C>[][];
|
|
241
|
+
subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKey | N | null, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
|
|
242
|
+
subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKey | N | null, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
|
|
243
|
+
subTreeTraverse<C extends BTNCallback<N | null>>(callback?: C, beginRoot?: BTNKey | N | null, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
|
|
244
|
+
dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: N | null, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
|
|
245
|
+
dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: N | null, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
|
|
246
|
+
dfs<C extends BTNCallback<N | null>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: N | null, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
|
|
247
|
+
bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
|
|
248
|
+
bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
|
|
249
|
+
bfs<C extends BTNCallback<N | null>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
|
|
250
|
+
listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: false): ReturnType<C>[][];
|
|
251
|
+
listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[][];
|
|
252
|
+
listLevels<C extends BTNCallback<N | null>>(callback?: C, beginRoot?: N | null, iterationType?: IterationType, includeNull?: true): ReturnType<C>[][];
|
|
302
253
|
/**
|
|
303
254
|
* The function returns the predecessor node of a given node in a binary tree.
|
|
304
255
|
* @param {N} node - The parameter "node" represents a node in a binary tree.
|