bst-typed 1.53.6 → 1.53.8

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 (62) hide show
  1. package/README.md +61 -0
  2. package/dist/common/index.d.ts +12 -0
  3. package/dist/common/index.js +28 -0
  4. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
  5. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +9 -12
  6. package/dist/data-structures/binary-tree/avl-tree.js +2 -2
  7. package/dist/data-structures/binary-tree/binary-tree.d.ts +55 -20
  8. package/dist/data-structures/binary-tree/binary-tree.js +102 -68
  9. package/dist/data-structures/binary-tree/bst.d.ts +131 -37
  10. package/dist/data-structures/binary-tree/bst.js +222 -69
  11. package/dist/data-structures/binary-tree/index.d.ts +1 -1
  12. package/dist/data-structures/binary-tree/index.js +1 -1
  13. package/dist/data-structures/binary-tree/{rb-tree.d.ts → red-black-tree.d.ts} +53 -0
  14. package/dist/data-structures/binary-tree/{rb-tree.js → red-black-tree.js} +56 -3
  15. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +2 -2
  16. package/dist/data-structures/binary-tree/tree-multi-map.js +7 -7
  17. package/dist/data-structures/hash/hash-map.d.ts +30 -0
  18. package/dist/data-structures/hash/hash-map.js +30 -0
  19. package/dist/data-structures/heap/heap.d.ts +26 -9
  20. package/dist/data-structures/heap/heap.js +37 -17
  21. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +54 -9
  22. package/dist/data-structures/linked-list/doubly-linked-list.js +80 -19
  23. package/dist/data-structures/linked-list/singly-linked-list.d.ts +35 -2
  24. package/dist/data-structures/linked-list/singly-linked-list.js +55 -11
  25. package/dist/data-structures/queue/deque.d.ts +37 -8
  26. package/dist/data-structures/queue/deque.js +73 -29
  27. package/dist/data-structures/queue/queue.d.ts +41 -1
  28. package/dist/data-structures/queue/queue.js +51 -9
  29. package/dist/data-structures/stack/stack.d.ts +27 -10
  30. package/dist/data-structures/stack/stack.js +39 -20
  31. package/dist/data-structures/trie/trie.d.ts +111 -6
  32. package/dist/data-structures/trie/trie.js +123 -14
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.js +2 -1
  35. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  36. package/dist/types/data-structures/binary-tree/bst.d.ts +3 -2
  37. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
  38. package/dist/types/utils/utils.d.ts +10 -6
  39. package/dist/utils/utils.js +4 -2
  40. package/package.json +2 -2
  41. package/src/common/index.ts +25 -0
  42. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +9 -11
  43. package/src/data-structures/binary-tree/avl-tree.ts +3 -2
  44. package/src/data-structures/binary-tree/binary-tree.ts +110 -66
  45. package/src/data-structures/binary-tree/bst.ts +232 -72
  46. package/src/data-structures/binary-tree/index.ts +1 -1
  47. package/src/data-structures/binary-tree/{rb-tree.ts → red-black-tree.ts} +56 -3
  48. package/src/data-structures/binary-tree/tree-multi-map.ts +6 -6
  49. package/src/data-structures/hash/hash-map.ts +30 -0
  50. package/src/data-structures/heap/heap.ts +72 -49
  51. package/src/data-structures/linked-list/doubly-linked-list.ts +173 -105
  52. package/src/data-structures/linked-list/singly-linked-list.ts +61 -11
  53. package/src/data-structures/queue/deque.ts +72 -28
  54. package/src/data-structures/queue/queue.ts +50 -7
  55. package/src/data-structures/stack/stack.ts +39 -20
  56. package/src/data-structures/trie/trie.ts +123 -13
  57. package/src/index.ts +2 -1
  58. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  59. package/src/types/data-structures/binary-tree/bst.ts +3 -2
  60. package/src/types/data-structures/binary-tree/rb-tree.ts +1 -1
  61. package/src/types/utils/utils.ts +16 -10
  62. package/src/utils/utils.ts +4 -2
package/README.md CHANGED
@@ -345,6 +345,67 @@ bfsNodes[2].id; // 16
345
345
 
346
346
  [//]: # (No deletion!!! Start of Example Replace Section)
347
347
 
348
+ ### Merge 3 sorted datasets
349
+ ```typescript
350
+ const dataset1 = new BST<number, string>([
351
+ [1, 'A'],
352
+ [7, 'G']
353
+ ]);
354
+ const dataset2 = [
355
+ [2, 'B'],
356
+ [6, 'F']
357
+ ];
358
+ const dataset3 = new BST<number, string>([
359
+ [3, 'C'],
360
+ [5, 'E'],
361
+ [4, 'D']
362
+ ]);
363
+
364
+ // Merge datasets into a single BinarySearchTree
365
+ const merged = new BST<number, string>(dataset1);
366
+ merged.addMany(dataset2);
367
+ merged.merge(dataset3);
368
+
369
+ // Verify merged dataset is in sorted order
370
+ console.log([...merged.values()]); // ['A', 'B', 'C', 'D', 'E', 'F', 'G']
371
+ ```
372
+
373
+ ### Find elements in a range
374
+ ```typescript
375
+ const bst = new BST<number>([10, 5, 15, 3, 7, 12, 18]);
376
+ console.log(bst.search(new Range(5, 10))); // [10, 5, 7]
377
+ console.log(bst.rangeSearch([4, 12], node => node.key.toString())); // ['10', '12', '5', '7']
378
+ console.log(bst.search(new Range(4, 12, true, false))); // [10, 5, 7]
379
+ console.log(bst.rangeSearch([15, 20])); // [15, 18]
380
+ console.log(bst.search(new Range(15, 20, false))); // [18]
381
+ ```
382
+
383
+ ### Find lowest common ancestor
384
+ ```typescript
385
+ const bst = new BST<number>([20, 10, 30, 5, 15, 25, 35, 3, 7, 12, 18]);
386
+
387
+ // LCA helper function
388
+ const findLCA = (num1: number, num2: number): number | undefined => {
389
+ const path1 = bst.getPathToRoot(num1);
390
+ const path2 = bst.getPathToRoot(num2);
391
+ // Find the first common ancestor
392
+ return findFirstCommon(path1, path2);
393
+ };
394
+
395
+ function findFirstCommon(arr1: number[], arr2: number[]): number | undefined {
396
+ for (const num of arr1) {
397
+ if (arr2.indexOf(num) !== -1) {
398
+ return num;
399
+ }
400
+ }
401
+ return undefined;
402
+ }
403
+
404
+ // Assertions
405
+ console.log(findLCA(3, 10)); // 7
406
+ console.log(findLCA(5, 35)); // 15
407
+ console.log(findLCA(20, 30)); // 25
408
+ ```
348
409
 
349
410
  [//]: # (No deletion!!! End of Example Replace Section)
350
411
 
@@ -0,0 +1,12 @@
1
+ export declare enum DFSOperation {
2
+ VISIT = 0,
3
+ PROCESS = 1
4
+ }
5
+ export declare class Range<K> {
6
+ low: K;
7
+ high: K;
8
+ includeLow: boolean;
9
+ includeHigh: boolean;
10
+ constructor(low: K, high: K, includeLow?: boolean, includeHigh?: boolean);
11
+ isInRange(key: K, comparator: (a: K, b: K) => number): boolean;
12
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Range = exports.DFSOperation = void 0;
4
+ const utils_1 = require("../utils");
5
+ var DFSOperation;
6
+ (function (DFSOperation) {
7
+ DFSOperation[DFSOperation["VISIT"] = 0] = "VISIT";
8
+ DFSOperation[DFSOperation["PROCESS"] = 1] = "PROCESS";
9
+ })(DFSOperation = exports.DFSOperation || (exports.DFSOperation = {}));
10
+ class Range {
11
+ constructor(low, high, includeLow = true, includeHigh = true) {
12
+ this.low = low;
13
+ this.high = high;
14
+ this.includeLow = includeLow;
15
+ this.includeHigh = includeHigh;
16
+ if (!((0, utils_1.isComparable)(low) && (0, utils_1.isComparable)(high)))
17
+ throw new RangeError('low or high is not comparable');
18
+ if (low > high)
19
+ throw new RangeError('low must be less than or equal to high');
20
+ }
21
+ // Determine whether a key is within the range
22
+ isInRange(key, comparator) {
23
+ const lowCheck = this.includeLow ? comparator(key, this.low) >= 0 : comparator(key, this.low) > 0;
24
+ const highCheck = this.includeHigh ? comparator(key, this.high) <= 0 : comparator(key, this.high) < 0;
25
+ return lowCheck && highCheck;
26
+ }
27
+ }
28
+ exports.Range = Range;
@@ -102,7 +102,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R = object, NODE extends
102
102
  * times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
103
103
  * @returns either a NODE object or undefined.
104
104
  */
105
- keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
105
+ protected _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
106
106
  /**
107
107
  * Time Complexity: O(log n)
108
108
  * Space Complexity: O(1)
@@ -96,7 +96,7 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
96
96
  * object.
97
97
  */
98
98
  createTree(options) {
99
- return new AVLTreeMultiMap([], Object.assign({ iterationType: this.iterationType, isMapMode: this._isMapMode, comparator: this._comparator, toEntryFn: this._toEntryFn }, options));
99
+ return new AVLTreeMultiMap([], Object.assign({ iterationType: this.iterationType, isMapMode: this._isMapMode, extractComparable: this._extractComparable, toEntryFn: this._toEntryFn, isReverse: this._isReverse }, options));
100
100
  }
101
101
  /**
102
102
  * The function checks if the input is an instance of AVLTreeMultiMapNode.
@@ -120,7 +120,7 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
120
120
  * times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
121
121
  * @returns either a NODE object or undefined.
122
122
  */
123
- keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw, value, count = 1) {
123
+ _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw, value, count = 1) {
124
124
  if (keyNodeEntryOrRaw === undefined || keyNodeEntryOrRaw === null)
125
125
  return [undefined, undefined];
126
126
  if (this.isNode(keyNodeEntryOrRaw))
@@ -132,17 +132,14 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
132
132
  const finalValue = value !== null && value !== void 0 ? value : entryValue;
133
133
  return [this.createNode(key, finalValue, count), finalValue];
134
134
  }
135
- if (this.isKey(keyNodeEntryOrRaw))
136
- return [this.createNode(keyNodeEntryOrRaw, value, count), value];
137
135
  if (this.isRaw(keyNodeEntryOrRaw)) {
138
- if (this._toEntryFn) {
139
- const [key, entryValue] = this._toEntryFn(keyNodeEntryOrRaw);
140
- const finalValue = value !== null && value !== void 0 ? value : entryValue;
141
- if (this.isKey(key))
142
- return [this.createNode(key, finalValue, count), finalValue];
143
- }
144
- return [undefined, undefined];
136
+ const [key, entryValue] = this._toEntryFn(keyNodeEntryOrRaw);
137
+ const finalValue = value !== null && value !== void 0 ? value : entryValue;
138
+ if (this.isKey(key))
139
+ return [this.createNode(key, finalValue, count), finalValue];
145
140
  }
141
+ if (this.isKey(keyNodeEntryOrRaw))
142
+ return [this.createNode(keyNodeEntryOrRaw, value, count), value];
146
143
  return [undefined, undefined];
147
144
  }
148
145
  /**
@@ -163,7 +160,7 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
163
160
  * @returns a boolean value.
164
161
  */
165
162
  add(keyNodeEntryOrRaw, value, count = 1) {
166
- const [newNode, newValue] = this.keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw, value, count);
163
+ const [newNode, newValue] = this._keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw, value, count);
167
164
  if (newNode === undefined)
168
165
  return false;
169
166
  const orgNodeCount = (newNode === null || newNode === void 0 ? void 0 : newNode.count) || 0;
@@ -85,7 +85,7 @@ class AVLTree extends bst_1.BST {
85
85
  * @returns a new AVLTree object.
86
86
  */
87
87
  createTree(options) {
88
- return new AVLTree([], Object.assign({ iterationType: this.iterationType, isMapMode: this._isMapMode, comparator: this._comparator, toEntryFn: this._toEntryFn }, options));
88
+ return new AVLTree([], Object.assign({ iterationType: this.iterationType, isMapMode: this._isMapMode, extractComparable: this._extractComparable, toEntryFn: this._toEntryFn, isReverse: this._isReverse }, options));
89
89
  }
90
90
  /**
91
91
  * The function checks if the input is an instance of AVLTreeNode.
@@ -409,7 +409,7 @@ class AVLTree extends bst_1.BST {
409
409
  */
410
410
  _balancePath(node) {
411
411
  node = this.ensureNode(node);
412
- const path = this.getPathToRoot(node => node, node, false); // first O(log n) + O(log n)
412
+ const path = this.getPathToRoot(node, node => node, false); // first O(log n) + O(log n)
413
413
  for (let i = 0; i < path.length; i++) {
414
414
  // second O(log n)
415
415
  const A = path[i];
@@ -8,6 +8,7 @@
8
8
  import { BinaryTreeDeleteResult, BinaryTreeNested, BinaryTreeNodeNested, BinaryTreeOptions, BinaryTreePrintOptions, BTNEntry, BTNRep, DFSOrderPattern, EntryCallback, FamilyPosition, IterationType, NodeCallback, NodeDisplayLayout, NodePredicate, OptNodeOrNull, ToEntryFn } from '../../types';
9
9
  import { IBinaryTree } from '../../interfaces';
10
10
  import { IterableEntryBase } from '../base';
11
+ import { Range } from '../../common';
11
12
  /**
12
13
  * Represents a node in a binary tree.
13
14
  * @template V - The type of data stored in the node.
@@ -91,7 +92,7 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
91
92
  * input parameter (`keyNodeEntryOrRaw`) and processes it accordingly to return a node or null
92
93
  * value.
93
94
  */
94
- keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V): [OptNodeOrNull<NODE>, V | undefined];
95
+ protected _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V): [OptNodeOrNull<NODE>, V | undefined];
95
96
  /**
96
97
  * Time Complexity: O(n)
97
98
  * Space Complexity: O(log n)
@@ -120,6 +121,13 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
120
121
  * is not a node.
121
122
  */
122
123
  isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
124
+ /**
125
+ * The function `isRaw` checks if the input parameter is of type `R` by verifying if it is an object.
126
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - BTNRep<K, V, NODE> | R
127
+ * @returns The function `isRaw` is checking if the `keyNodeEntryOrRaw` parameter is of type `R` by
128
+ * checking if it is an object. If the parameter is an object, the function will return `true`,
129
+ * indicating that it is of type `R`.
130
+ */
123
131
  isRaw(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is R;
124
132
  /**
125
133
  * The function `isRealNode` checks if a given input is a valid node in a binary tree.
@@ -150,6 +158,7 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
150
158
  * property of the current object and returning a boolean value based on that comparison.
151
159
  */
152
160
  isNIL(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): boolean;
161
+ isRange(keyNodeEntryRawOrPredicate: BTNRep<K, V, NODE> | R | NodePredicate<NODE> | Range<K>): keyNodeEntryRawOrPredicate is Range<K>;
153
162
  /**
154
163
  * The function determines whether a given key, node, entry, or raw data is a leaf node in a binary
155
164
  * tree.
@@ -221,6 +230,15 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
221
230
  * corresponds to the success of adding the corresponding key or value in the input iterable.
222
231
  */
223
232
  addMany(keysNodesEntriesOrRaws: Iterable<BTNRep<K, V, NODE> | R>, values?: Iterable<V | undefined>): boolean[];
233
+ /**
234
+ * Time Complexity: O(k * n)
235
+ * Space Complexity: O(1)
236
+ *
237
+ * The `merge` function in TypeScript merges another binary tree into the current tree by adding all
238
+ * elements from the other tree.
239
+ * @param anotherTree - `BinaryTree<K, V, R, NODE, TREE>`
240
+ */
241
+ merge(anotherTree: BinaryTree<K, V, R, NODE, TREE>): void;
224
242
  /**
225
243
  * Time Complexity: O(k * n)
226
244
  * Space Complexity: O(1)
@@ -250,6 +268,31 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
250
268
  * need to be balanced (`needBalanced`).
251
269
  */
252
270
  delete(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): BinaryTreeDeleteResult<NODE>[];
271
+ /**
272
+ * Time Complexity: O(n)
273
+ * Space Complexity: O(k + log n)
274
+ *
275
+ * The `search` function in TypeScript performs a depth-first or breadth-first search on a tree
276
+ * structure based on a given predicate or key, with options to return multiple results or just one.
277
+ * @param {BTNRep<K, V, NODE> | R | NodePredicate<NODE>} keyNodeEntryRawOrPredicate - The
278
+ * `keyNodeEntryRawOrPredicate` parameter in the `search` function can accept three types of values:
279
+ * @param [onlyOne=false] - The `onlyOne` parameter in the `search` function is a boolean flag that
280
+ * determines whether the search should stop after finding the first matching node. If `onlyOne` is
281
+ * set to `true`, the search will return as soon as a matching node is found. If `onlyOne` is
282
+ * @param {C} callback - The `callback` parameter in the `search` function is a callback function
283
+ * that will be called on each node that matches the search criteria. It is of type `C`, which
284
+ * extends `NodeCallback<NODE>`. The default value for `callback` is `this._DEFAULT_NODE_CALLBACK` if
285
+ * @param {BTNRep<K, V, NODE> | R} startNode - The `startNode` parameter in the `search` function is
286
+ * used to specify the node from which the search operation should begin. It represents the starting
287
+ * point in the binary tree where the search will be performed. If no specific `startNode` is
288
+ * provided, the search operation will start from the root
289
+ * @param {IterationType} iterationType - The `iterationType` parameter in the `search` function
290
+ * specifies the type of iteration to be used when searching for nodes in a binary tree. It can have
291
+ * two possible values:
292
+ * @returns The `search` function returns an array of values that match the provided criteria based
293
+ * on the search algorithm implemented within the function.
294
+ */
295
+ search<C extends NodeCallback<NODE>>(keyNodeEntryRawOrPredicate: BTNRep<K, V, NODE> | R | NodePredicate<NODE>, onlyOne?: boolean, callback?: C, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): ReturnType<C>[];
253
296
  /**
254
297
  * Time Complexity: O(n)
255
298
  * Space Complexity: O(k + log n)
@@ -293,20 +336,6 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
293
336
  * or `null` if no matching node is found.
294
337
  */
295
338
  getNode(keyNodeEntryRawOrPredicate: BTNRep<K, V, NODE> | R | NodePredicate<NODE>, startNode?: BTNRep<K, V, NODE> | R, iterationType?: IterationType): OptNodeOrNull<NODE>;
296
- /**
297
- * Time Complexity: O(n)
298
- * Space Complexity: O(log n)
299
- *
300
- * The function `getNodeByKey` retrieves a node by its key from a binary tree structure.
301
- * @param {K} key - The `key` parameter is the value used to search for a specific node in a data
302
- * structure.
303
- * @param {IterationType} iterationType - The `iterationType` parameter is a type of iteration that
304
- * specifies how the tree nodes should be traversed when searching for a node with the given key. It
305
- * is an optional parameter with a default value of `this.iterationType`.
306
- * @returns The `getNodeByKey` function is returning an optional binary tree node
307
- * (`OptNodeOrNull<NODE>`).
308
- */
309
- getNodeByKey(key: K, iterationType?: IterationType): OptNodeOrNull<NODE>;
310
339
  /**
311
340
  * Time Complexity: O(n)
312
341
  * Space Complexity: O(log n)
@@ -478,7 +507,7 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
478
507
  * array is either in reverse order or in the original order based on the value of the `isReverse`
479
508
  * parameter.
480
509
  */
481
- getPathToRoot<C extends NodeCallback<OptNodeOrNull<NODE>>>(callback: C | undefined, beginNode: BTNRep<K, V, NODE> | R, isReverse?: boolean): ReturnType<C>[];
510
+ getPathToRoot<C extends NodeCallback<OptNodeOrNull<NODE>>>(beginNode: BTNRep<K, V, NODE> | R, callback?: C, isReverse?: boolean): ReturnType<C>[];
482
511
  /**
483
512
  * Time Complexity: O(log n)
484
513
  * Space Complexity: O(1)
@@ -825,16 +854,16 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
825
854
  * Time Complexity: O(1)
826
855
  * Space Complexity: O(1)
827
856
  *
828
- * The function `_getKey` in TypeScript returns the key from a given input, which can be a node,
857
+ * The function `_extractKey` in TypeScript returns the key from a given input, which can be a node,
829
858
  * entry, raw data, or null/undefined.
830
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The `_getKey` method you provided is a
859
+ * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The `_extractKey` method you provided is a
831
860
  * TypeScript method that takes in a parameter `keyNodeEntryOrRaw` of type `BTNRep<K, V, NODE> | R`,
832
861
  * where `BTNRep` is a generic type with keys `K`, `V`, and `NODE`, and `
833
- * @returns The `_getKey` method returns the key value extracted from the `keyNodeEntryOrRaw`
862
+ * @returns The `_extractKey` method returns the key value extracted from the `keyNodeEntryOrRaw`
834
863
  * parameter. The return value can be a key value of type `K`, `null`, or `undefined`, depending on
835
864
  * the conditions checked in the method.
836
865
  */
837
- protected _getKey(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): K | null | undefined;
866
+ protected _extractKey(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): K | null | undefined;
838
867
  /**
839
868
  * Time Complexity: O(1)
840
869
  * Space Complexity: O(1)
@@ -851,10 +880,16 @@ export declare class BinaryTree<K = any, V = any, R = object, NODE extends Binar
851
880
  */
852
881
  protected _setValue(key: K | null | undefined, value: V | undefined): false | Map<K, V | undefined>;
853
882
  /**
883
+ * Time Complexity: O(1)
884
+ * Space Complexity: O(1)
885
+ *
854
886
  * The _clearNodes function sets the root node to undefined and resets the size to 0.
855
887
  */
856
888
  protected _clearNodes(): void;
857
889
  /**
890
+ * Time Complexity: O(1)
891
+ * Space Complexity: O(1)
892
+ *
858
893
  * The _clearValues function clears all values stored in the _store object.
859
894
  */
860
895
  protected _clearValues(): void;