min-heap-typed 1.52.9 → 1.53.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.
Files changed (27) hide show
  1. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +21 -21
  2. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +63 -46
  3. package/dist/data-structures/binary-tree/avl-tree.d.ts +20 -20
  4. package/dist/data-structures/binary-tree/avl-tree.js +28 -26
  5. package/dist/data-structures/binary-tree/binary-tree.d.ts +186 -144
  6. package/dist/data-structures/binary-tree/binary-tree.js +375 -264
  7. package/dist/data-structures/binary-tree/bst.d.ts +56 -56
  8. package/dist/data-structures/binary-tree/bst.js +105 -77
  9. package/dist/data-structures/binary-tree/rb-tree.d.ts +13 -13
  10. package/dist/data-structures/binary-tree/rb-tree.js +35 -33
  11. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +21 -21
  12. package/dist/data-structures/binary-tree/tree-multi-map.js +58 -48
  13. package/dist/data-structures/trie/trie.js +3 -3
  14. package/dist/interfaces/binary-tree.d.ts +5 -5
  15. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +13 -13
  16. package/dist/types/data-structures/binary-tree/bst.d.ts +3 -3
  17. package/package.json +2 -2
  18. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +59 -53
  19. package/src/data-structures/binary-tree/avl-tree.ts +31 -34
  20. package/src/data-structures/binary-tree/binary-tree.ts +439 -359
  21. package/src/data-structures/binary-tree/bst.ts +142 -112
  22. package/src/data-structures/binary-tree/rb-tree.ts +37 -41
  23. package/src/data-structures/binary-tree/tree-multi-map.ts +56 -60
  24. package/src/data-structures/trie/trie.ts +3 -3
  25. package/src/interfaces/binary-tree.ts +6 -6
  26. package/src/types/data-structures/binary-tree/binary-tree.ts +14 -15
  27. package/src/types/data-structures/binary-tree/bst.ts +4 -4
@@ -5,7 +5,7 @@
5
5
  * @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { BSTNested, BSTNKeyOrNode, BSTNodeNested, BSTOptions, BTNCallback, BTNEntry, BTNKeyOrNodeOrEntry, BTNPredicate, Comparator, CP, DFSOrderPattern, IterationType, OptBSTN } from '../../types';
8
+ import type { BSTNested, BSTNodeNested, BSTNOptKeyOrNode, BSTOptions, BTNRep, Comparator, CP, DFSOrderPattern, IterationType, NodeCallback, NodePredicate, OptNode } from '../../types';
9
9
  import { BinaryTree, BinaryTreeNode } from './binary-tree';
10
10
  import { IBinaryTree } from '../../interfaces';
11
11
  export declare class BSTNode<K = any, V = any, NODE extends BSTNode<K, V, NODE> = BSTNodeNested<K, V>> extends BinaryTreeNode<K, V, NODE> {
@@ -16,26 +16,26 @@ export declare class BSTNode<K = any, V = any, NODE extends BSTNode<K, V, NODE>
16
16
  * The function returns the value of the `_left` property.
17
17
  * @returns The `_left` property of the current object is being returned.
18
18
  */
19
- get left(): OptBSTN<NODE>;
19
+ get left(): OptNode<NODE>;
20
20
  /**
21
21
  * The function sets the left child of a node and updates the parent reference of the child.
22
- * @param {OptBSTN<NODE>} v - The parameter `v` is of type `OptBSTN<NODE>`. It can either be an
22
+ * @param {OptNode<NODE>} v - The parameter `v` is of type `OptNode<NODE>`. It can either be an
23
23
  * instance of the `NODE` class or `undefined`.
24
24
  */
25
- set left(v: OptBSTN<NODE>);
25
+ set left(v: OptNode<NODE>);
26
26
  protected _right?: NODE;
27
27
  /**
28
28
  * The function returns the right node of a binary tree or undefined if there is no right node.
29
29
  * @returns The method is returning the value of the `_right` property, which is of type `NODE` or
30
30
  * `undefined`.
31
31
  */
32
- get right(): OptBSTN<NODE>;
32
+ get right(): OptNode<NODE>;
33
33
  /**
34
34
  * The function sets the right child of a node and updates the parent reference of the child.
35
- * @param {OptBSTN<NODE>} v - The parameter `v` is of type `OptBSTN<NODE>`. It can either be a
35
+ * @param {OptNode<NODE>} v - The parameter `v` is of type `OptNode<NODE>`. It can either be a
36
36
  * `NODE` object or `undefined`.
37
37
  */
38
- set right(v: OptBSTN<NODE>);
38
+ set right(v: OptNode<NODE>);
39
39
  }
40
40
  /**
41
41
  * 1. Node Order: Each node's left child has a lesser value, and the right child has a greater value.
@@ -46,22 +46,22 @@ export declare class BSTNode<K = any, V = any, NODE extends BSTNode<K, V, NODE>
46
46
  * 6. Balance Variability: Can become unbalanced; special types maintain balance.
47
47
  * 7. No Auto-Balancing: Standard BSTs don't automatically balance themselves.
48
48
  */
49
- export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTNode<K, V, NODE> = BSTNode<K, V, BSTNodeNested<K, V>>, TREE extends BST<K, V, R, NODE, TREE> = BST<K, V, R, NODE, BSTNested<K, V, R, NODE>>> extends BinaryTree<K, V, R, NODE, TREE> implements IBinaryTree<K, V, R, NODE, TREE> {
49
+ export declare class BST<K = any, V = any, R = object, NODE extends BSTNode<K, V, NODE> = BSTNode<K, V, BSTNodeNested<K, V>>, TREE extends BST<K, V, R, NODE, TREE> = BST<K, V, R, NODE, BSTNested<K, V, R, NODE>>> extends BinaryTree<K, V, R, NODE, TREE> implements IBinaryTree<K, V, R, NODE, TREE> {
50
50
  /**
51
51
  * This is the constructor function for a Binary Search Tree class in TypeScript.
52
- * @param keysOrNodesOrEntriesOrRaws - The `keysOrNodesOrEntriesOrRaws` parameter is an
52
+ * @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter is an
53
53
  * iterable that can contain either keys, nodes, entries, or raw elements. These elements will be
54
54
  * added to the binary search tree during the construction of the object.
55
55
  * @param [options] - An optional object that contains additional options for the Binary Search Tree.
56
56
  * It can include a comparator function that defines the order of the elements in the tree.
57
57
  */
58
- constructor(keysOrNodesOrEntriesOrRaws?: Iterable<R | BTNKeyOrNodeOrEntry<K, V, NODE>>, options?: BSTOptions<K, V, R>);
58
+ constructor(keysNodesEntriesOrRaws?: Iterable<R | BTNRep<K, V, NODE>>, options?: BSTOptions<K, V, R>);
59
59
  protected _root?: NODE;
60
60
  /**
61
61
  * The function returns the root node of a tree structure.
62
62
  * @returns The `_root` property of the object, which is of type `NODE` or `undefined`.
63
63
  */
64
- get root(): OptBSTN<NODE>;
64
+ get root(): OptNode<NODE>;
65
65
  /**
66
66
  * The function creates a new BSTNode with the given key and value and returns it.
67
67
  * @param {K} key - The key parameter is of type K, which represents the type of the key for the node
@@ -81,22 +81,22 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
81
81
  createTree(options?: BSTOptions<K, V, R>): TREE;
82
82
  /**
83
83
  * The function overrides a method and converts a key, value pair or entry or raw element to a node.
84
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} keyOrNodeOrEntryOrRaw - A variable that can be of
85
- * type R or BTNKeyOrNodeOrEntry<K, V, NODE>. It represents either a key, a node, an entry, or a raw
84
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - A variable that can be of
85
+ * type R or BTNRep<K, V, NODE>. It represents either a key, a node, an entry, or a raw
86
86
  * element.
87
87
  * @param {V} [value] - The `value` parameter is an optional value of type `V`. It represents the
88
88
  * value associated with a key in a key-value pair.
89
89
  * @returns either a NODE object or undefined.
90
90
  */
91
- keyValueOrEntryOrRawElementToNode(keyOrNodeOrEntryOrRaw: BTNKeyOrNodeOrEntry<K, V, NODE> | R, value?: V): OptBSTN<NODE>;
91
+ keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V): [OptNode<NODE>, V | undefined];
92
92
  /**
93
93
  * Time Complexity: O(log n)
94
94
  * Space Complexity: O(log n)
95
95
  *
96
96
  * The function ensures the existence of a node in a data structure and returns it, or undefined if
97
97
  * it doesn't exist.
98
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} keyOrNodeOrEntryOrRaw - The parameter
99
- * `keyOrNodeOrEntryOrRaw` can accept a value of type `R`, which represents the key, node,
98
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
99
+ * `keyNodeEntryOrRaw` can accept a value of type `R`, which represents the key, node,
100
100
  * entry, or raw element that needs to be ensured in the tree.
101
101
  * @param {IterationType} [iterationType=ITERATIVE] - The `iterationType` parameter is an optional
102
102
  * parameter that specifies the type of iteration to be used when ensuring a node. It has a default
@@ -104,15 +104,15 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
104
104
  * @returns The method is returning either the node that was ensured or `undefined` if the node could
105
105
  * not be ensured.
106
106
  */
107
- ensureNode(keyOrNodeOrEntryOrRaw: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): OptBSTN<NODE>;
107
+ ensureNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, iterationType?: IterationType): OptNode<NODE>;
108
108
  /**
109
109
  * The function checks if the input is an instance of the BSTNode class.
110
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} keyOrNodeOrEntryOrRaw - The parameter
111
- * `keyOrNodeOrEntryOrRaw` can be of type `R` or `BTNKeyOrNodeOrEntry<K, V, NODE>`.
112
- * @returns a boolean value indicating whether the input parameter `keyOrNodeOrEntryOrRaw` is
110
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
111
+ * `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
112
+ * @returns a boolean value indicating whether the input parameter `keyNodeEntryOrRaw` is
113
113
  * an instance of the `BSTNode` class.
114
114
  */
115
- isNode(keyOrNodeOrEntryOrRaw: BTNKeyOrNodeOrEntry<K, V, NODE> | R): keyOrNodeOrEntryOrRaw is NODE;
115
+ isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
116
116
  /**
117
117
  * The function "override isKey" checks if a key is comparable based on a given comparator.
118
118
  * @param {any} key - The `key` parameter is a value that will be checked to determine if it is of
@@ -127,20 +127,20 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
127
127
  * Space Complexity: O(1)
128
128
  *
129
129
  * The `add` function in TypeScript adds a new node to a binary search tree based on the key value.
130
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} keyOrNodeOrEntryOrRaw - The parameter
131
- * `keyOrNodeOrEntryOrRaw` can accept a value of type `R` or `BTNKeyOrNodeOrEntry<K, V, NODE>`.
130
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
131
+ * `keyNodeEntryOrRaw` can accept a value of type `R` or `BTNRep<K, V, NODE>`.
132
132
  * @param {V} [value] - The `value` parameter is an optional value that can be associated with the
133
133
  * key in the binary search tree. If provided, it will be stored in the node along with the key.
134
134
  * @returns a boolean value.
135
135
  */
136
- add(keyOrNodeOrEntryOrRaw: BTNKeyOrNodeOrEntry<K, V, NODE> | R, value?: V): boolean;
136
+ add(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V): boolean;
137
137
  /**
138
138
  * Time Complexity: O(k log n)
139
139
  * Space Complexity: O(k + log n)
140
140
  *
141
141
  * The `addMany` function in TypeScript adds multiple keys or nodes to a data structure and returns
142
142
  * an array indicating whether each key or node was successfully inserted.
143
- * @param keysOrNodesOrEntriesOrRaws - An iterable containing keys, nodes, entries, or raw
143
+ * @param keysNodesEntriesOrRaws - An iterable containing keys, nodes, entries, or raw
144
144
  * elements to be added to the data structure.
145
145
  * @param [values] - An optional iterable of values to be associated with the keys or nodes being
146
146
  * added. If provided, the values will be assigned to the corresponding keys or nodes in the same
@@ -155,39 +155,39 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
155
155
  * @returns The function `addMany` returns an array of booleans indicating whether each element was
156
156
  * successfully inserted into the data structure.
157
157
  */
158
- addMany(keysOrNodesOrEntriesOrRaws: Iterable<R | BTNKeyOrNodeOrEntry<K, V, NODE>>, values?: Iterable<V | undefined>, isBalanceAdd?: boolean, iterationType?: IterationType): boolean[];
158
+ addMany(keysNodesEntriesOrRaws: Iterable<R | BTNRep<K, V, NODE>>, values?: Iterable<V | undefined>, isBalanceAdd?: boolean, iterationType?: IterationType): boolean[];
159
159
  /**
160
160
  * Time Complexity: O(log n)
161
161
  * Space Complexity: O(k + log n)
162
162
  *
163
163
  * The function `getNodes` in TypeScript overrides the base class method to retrieve nodes based on a
164
- * given predicate and iteration type.
165
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R | BTNPredicate<NODE>} predicate - The `predicate`
164
+ * given keyNodeEntryRawOrPredicate and iteration type.
165
+ * @param {BTNRep<K, V, NODE> | R | NodePredicate<NODE>} keyNodeEntryRawOrPredicate - The `keyNodeEntryRawOrPredicate`
166
166
  * parameter in the `getNodes` method is used to filter the nodes that will be returned. It can be a
167
- * key, a node, an entry, or a custom predicate function that determines whether a node should be
167
+ * key, a node, an entry, or a custom keyNodeEntryRawOrPredicate function that determines whether a node should be
168
168
  * included in the result.
169
169
  * @param [onlyOne=false] - The `onlyOne` parameter in the `getNodes` method is a boolean flag that
170
- * determines whether to return only the first node that matches the predicate (`true`) or all nodes
171
- * that match the predicate (`false`). If `onlyOne` is set to `true`, the method will stop iterating
170
+ * determines whether to return only the first node that matches the keyNodeEntryRawOrPredicate (`true`) or all nodes
171
+ * that match the keyNodeEntryRawOrPredicate (`false`). If `onlyOne` is set to `true`, the method will stop iterating
172
172
  * and
173
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} beginRoot - The `beginRoot` parameter in the
173
+ * @param {BTNRep<K, V, NODE> | R} startNode - The `startNode` parameter in the
174
174
  * `getNodes` method is used to specify the starting point for traversing the tree when searching for
175
- * nodes that match a given predicate. It represents the root node of the subtree where the search
175
+ * nodes that match a given keyNodeEntryRawOrPredicate. It represents the root node of the subtree where the search
176
176
  * should begin. If not explicitly provided, the default value for `begin
177
177
  * @param {IterationType} iterationType - The `iterationType` parameter in the `getNodes` method
178
178
  * specifies the type of iteration to be performed when traversing the nodes of a binary tree. It can
179
179
  * have two possible values:
180
- * @returns The `getNodes` method returns an array of nodes that satisfy the given predicate.
180
+ * @returns The `getNodes` method returns an array of nodes that satisfy the given keyNodeEntryRawOrPredicate.
181
181
  */
182
- getNodes(predicate: BTNKeyOrNodeOrEntry<K, V, NODE> | R | BTNPredicate<NODE>, onlyOne?: boolean, beginRoot?: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): NODE[];
182
+ getNodes(keyNodeEntryRawOrPredicate: BTNRep<K, V, NODE> | R | NodePredicate<NODE>, onlyOne?: boolean, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): NODE[];
183
183
  /**
184
184
  * Time Complexity: O(log n)
185
185
  * Space Complexity: O(1)
186
186
  *
187
- * This function retrieves a node based on a given predicate within a binary search tree structure.
188
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R | BTNPredicate<NODE>} predicate - The `predicate`
189
- * parameter can be of type `BTNKeyOrNodeOrEntry<K, V, NODE>`, `R`, or `BTNPredicate<NODE>`.
190
- * @param {R | BSTNKeyOrNode<K, NODE>} beginRoot - The `beginRoot` parameter in the `getNode` method
187
+ * This function retrieves a node based on a given keyNodeEntryRawOrPredicate within a binary search tree structure.
188
+ * @param {BTNRep<K, V, NODE> | R | NodePredicate<NODE>} keyNodeEntryRawOrPredicate - The `keyNodeEntryRawOrPredicate`
189
+ * parameter can be of type `BTNRep<K, V, NODE>`, `R`, or `NodePredicate<NODE>`.
190
+ * @param {R | BSTNOptKeyOrNode<K, NODE>} startNode - The `startNode` parameter in the `getNode` method
191
191
  * is used to specify the starting point for searching nodes in the binary search tree. If no
192
192
  * specific starting point is provided, the default value is set to `this._root`, which is the root
193
193
  * node of the binary search tree.
@@ -195,12 +195,12 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
195
195
  * parameter that specifies the type of iteration to be used. It has a default value of
196
196
  * `this.iterationType`, which means it will use the iteration type defined in the class instance if
197
197
  * no value is provided when calling the method.
198
- * @returns The `getNode` method is returning an optional binary search tree node (`OptBSTN<NODE>`).
199
- * It is using the `getNodes` method to find the node based on the provided predicate, beginning at
200
- * the specified root node (`beginRoot`) and using the specified iteration type. The method then
198
+ * @returns The `getNode` method is returning an optional binary search tree node (`OptNode<NODE>`).
199
+ * It is using the `getNodes` method to find the node based on the provided keyNodeEntryRawOrPredicate, beginning at
200
+ * the specified root node (`startNode`) and using the specified iteration type. The method then
201
201
  * returns the first node found or `undefined` if no node is found.
202
202
  */
203
- getNode(predicate: BTNKeyOrNodeOrEntry<K, V, NODE> | R | BTNPredicate<NODE>, beginRoot?: R | BSTNKeyOrNode<K, NODE>, iterationType?: IterationType): OptBSTN<NODE>;
203
+ getNode(keyNodeEntryRawOrPredicate: BTNRep<K, V, NODE> | R | NodePredicate<NODE>, startNode?: R | BSTNOptKeyOrNode<K, NODE>, iterationType?: IterationType): OptNode<NODE>;
204
204
  /**
205
205
  * Time Complexity: O(log n)
206
206
  * Space Complexity: O(1)
@@ -214,7 +214,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
214
214
  * It has a default value of `'ITERATIVE'`.
215
215
  * @returns The method is returning a NODE object or undefined.
216
216
  */
217
- getNodeByKey(key: K, iterationType?: IterationType): OptBSTN<NODE>;
217
+ getNodeByKey(key: K, iterationType?: IterationType): OptNode<NODE>;
218
218
  /**
219
219
  * Time complexity: O(n)
220
220
  * Space complexity: O(n)
@@ -223,11 +223,11 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
223
223
  * the callback function.
224
224
  * @param {C} callback - The `callback` parameter is a function that will be called for each node
225
225
  * during the depth-first search traversal. It is an optional parameter and defaults to
226
- * `this._DEFAULT_BTN_CALLBACK`. The type `C` represents the type of the callback function.
226
+ * `this._DEFAULT_NODE_CALLBACK`. The type `C` represents the type of the callback function.
227
227
  * @param {DFSOrderPattern} [pattern=IN] - The "pattern" parameter in the code snippet refers to the
228
228
  * order in which the Depth-First Search (DFS) algorithm visits the nodes in a tree or graph. It can
229
229
  * take one of the following values:
230
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} beginRoot - The `beginRoot` parameter is the starting
230
+ * @param {BTNRep<K, V, NODE> | R} startNode - The `startNode` parameter is the starting
231
231
  * point for the depth-first search traversal. It can be either a root node, a key-value pair, or a
232
232
  * node entry. If not specified, the default value is the root of the tree.
233
233
  * @param {IterationType} [iterationType=ITERATIVE] - The `iterationType` parameter specifies the
@@ -235,7 +235,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
235
235
  * following values:
236
236
  * @returns The method is returning an array of the return type of the callback function.
237
237
  */
238
- dfs<C extends BTNCallback<NODE>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
238
+ dfs<C extends NodeCallback<NODE>>(callback?: C, pattern?: DFSOrderPattern, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
239
239
  /**
240
240
  * Time complexity: O(n)
241
241
  * Space complexity: O(n)
@@ -245,7 +245,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
245
245
  * @param {C} callback - The `callback` parameter is a function that will be called for each node
246
246
  * visited during the breadth-first search. It should take a single argument, which is the current
247
247
  * node being visited, and it can return a value of any type.
248
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} beginRoot - The `beginRoot` parameter is the starting
248
+ * @param {BTNRep<K, V, NODE> | R} startNode - The `startNode` parameter is the starting
249
249
  * point for the breadth-first search. It can be either a root node, a key-value pair, or an entry
250
250
  * object. If no value is provided, the default value is the root of the tree.
251
251
  * @param {IterationType} iterationType - The `iterationType` parameter is used to specify the type
@@ -253,7 +253,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
253
253
  * the following values:
254
254
  * @returns an array of the return type of the callback function.
255
255
  */
256
- bfs<C extends BTNCallback<NODE>>(callback?: C, beginRoot?: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
256
+ bfs<C extends NodeCallback<NODE>>(callback?: C, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
257
257
  /**
258
258
  * Time complexity: O(n)
259
259
  * Space complexity: O(n)
@@ -261,9 +261,9 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
261
261
  * The function overrides the listLevels method from the superclass and returns an array of arrays
262
262
  * containing the results of the callback function applied to each level of the tree.
263
263
  * @param {C} callback - The `callback` parameter is a generic type `C` that extends
264
- * `BTNCallback<NODE>`. It represents a callback function that will be called for each node in the
264
+ * `NodeCallback<NODE>`. It represents a callback function that will be called for each node in the
265
265
  * tree during the iteration process.
266
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} beginRoot - The `beginRoot` parameter is the starting
266
+ * @param {BTNRep<K, V, NODE> | R} startNode - The `startNode` parameter is the starting
267
267
  * point for listing the levels of the binary tree. It can be either a root node of the tree, a
268
268
  * key-value pair representing a node in the tree, or a key representing a node in the tree. If no
269
269
  * value is provided, the root of
@@ -272,7 +272,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
272
272
  * @returns The method is returning a two-dimensional array of the return type of the callback
273
273
  * function.
274
274
  */
275
- listLevels<C extends BTNCallback<NODE>>(callback?: C, beginRoot?: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[][];
275
+ listLevels<C extends NodeCallback<NODE>>(callback?: C, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[][];
276
276
  /**
277
277
  * Time complexity: O(n)
278
278
  * Space complexity: O(n)
@@ -285,7 +285,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
285
285
  * @param {CP} lesserOrGreater - The `lesserOrGreater` parameter is used to determine whether to
286
286
  * traverse nodes that are lesser, greater, or both than the `targetNode`. It accepts the values -1,
287
287
  * 0, or 1, where:
288
- * @param {BTNKeyOrNodeOrEntry<K, V, NODE> | R} targetNode - The `targetNode` parameter is the node in
288
+ * @param {BTNRep<K, V, NODE> | R} targetNode - The `targetNode` parameter is the node in
289
289
  * the binary tree that you want to start traversing from. It can be specified either by providing
290
290
  * the key of the node, the node itself, or an entry containing the key and value of the node. If no
291
291
  * `targetNode` is provided,
@@ -294,7 +294,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
294
294
  * @returns The function `lesserOrGreaterTraverse` returns an array of values of type
295
295
  * `ReturnType<C>`, which is the return type of the callback function passed as an argument.
296
296
  */
297
- lesserOrGreaterTraverse<C extends BTNCallback<NODE>>(callback?: C, lesserOrGreater?: CP, targetNode?: BTNKeyOrNodeOrEntry<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
297
+ lesserOrGreaterTraverse<C extends NodeCallback<NODE>>(callback?: C, lesserOrGreater?: CP, targetNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
298
298
  /**
299
299
  * Time complexity: O(n)
300
300
  * Space complexity: O(n)
@@ -331,7 +331,7 @@ export declare class BST<K = any, V = any, R = BTNEntry<K, V>, NODE extends BSTN
331
331
  /**
332
332
  * The function sets the root of a tree-like structure and updates the parent property of the new
333
333
  * root.
334
- * @param {OptBSTN<NODE>} v - v is a parameter of type NODE or undefined.
334
+ * @param {OptNode<NODE>} v - v is a parameter of type NODE or undefined.
335
335
  */
336
- protected _setRoot(v: OptBSTN<NODE>): void;
336
+ protected _setRoot(v: OptNode<NODE>): void;
337
337
  }