min-heap-typed 1.49.0 → 1.49.2

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 (88) hide show
  1. package/dist/data-structures/base/iterable-base.d.ts +11 -0
  2. package/dist/data-structures/base/iterable-base.js +21 -0
  3. package/dist/data-structures/binary-tree/avl-tree.d.ts +10 -12
  4. package/dist/data-structures/binary-tree/avl-tree.js +3 -4
  5. package/dist/data-structures/binary-tree/binary-tree.d.ts +58 -58
  6. package/dist/data-structures/binary-tree/binary-tree.js +6 -6
  7. package/dist/data-structures/binary-tree/bst.d.ts +15 -15
  8. package/dist/data-structures/binary-tree/bst.js +3 -3
  9. package/dist/data-structures/binary-tree/rb-tree.d.ts +11 -11
  10. package/dist/data-structures/binary-tree/rb-tree.js +5 -6
  11. package/dist/data-structures/binary-tree/tree-multimap.d.ts +14 -14
  12. package/dist/data-structures/binary-tree/tree-multimap.js +3 -3
  13. package/dist/data-structures/graph/abstract-graph.d.ts +9 -3
  14. package/dist/data-structures/graph/abstract-graph.js +27 -31
  15. package/dist/data-structures/graph/directed-graph.d.ts +8 -1
  16. package/dist/data-structures/graph/directed-graph.js +1 -8
  17. package/dist/data-structures/graph/map-graph.d.ts +1 -1
  18. package/dist/data-structures/graph/undirected-graph.d.ts +8 -1
  19. package/dist/data-structures/graph/undirected-graph.js +1 -8
  20. package/dist/data-structures/hash/hash-map.d.ts +22 -10
  21. package/dist/data-structures/hash/hash-map.js +28 -16
  22. package/dist/data-structures/hash/hash-table.d.ts +2 -2
  23. package/dist/data-structures/heap/heap.d.ts +20 -38
  24. package/dist/data-structures/heap/heap.js +22 -42
  25. package/dist/data-structures/heap/max-heap.d.ts +11 -1
  26. package/dist/data-structures/heap/max-heap.js +10 -7
  27. package/dist/data-structures/heap/min-heap.d.ts +11 -1
  28. package/dist/data-structures/heap/min-heap.js +10 -7
  29. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +95 -95
  30. package/dist/data-structures/linked-list/doubly-linked-list.js +132 -136
  31. package/dist/data-structures/linked-list/singly-linked-list.d.ts +18 -23
  32. package/dist/data-structures/linked-list/singly-linked-list.js +42 -49
  33. package/dist/data-structures/linked-list/skip-linked-list.d.ts +2 -2
  34. package/dist/data-structures/linked-list/skip-linked-list.js +2 -2
  35. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +1 -1
  36. package/dist/data-structures/priority-queue/max-priority-queue.js +0 -7
  37. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +1 -1
  38. package/dist/data-structures/priority-queue/min-priority-queue.js +0 -7
  39. package/dist/data-structures/priority-queue/priority-queue.d.ts +9 -1
  40. package/dist/data-structures/priority-queue/priority-queue.js +8 -7
  41. package/dist/data-structures/queue/deque.d.ts +76 -80
  42. package/dist/data-structures/queue/deque.js +106 -122
  43. package/dist/data-structures/queue/queue.d.ts +30 -16
  44. package/dist/data-structures/queue/queue.js +31 -24
  45. package/dist/data-structures/stack/stack.d.ts +17 -8
  46. package/dist/data-structures/stack/stack.js +9 -9
  47. package/dist/data-structures/trie/trie.d.ts +14 -5
  48. package/dist/data-structures/trie/trie.js +13 -13
  49. package/dist/interfaces/binary-tree.d.ts +4 -4
  50. package/dist/types/common.d.ts +32 -8
  51. package/dist/types/common.js +22 -1
  52. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -24
  53. package/dist/types/data-structures/binary-tree/binary-tree.js +0 -22
  54. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
  55. package/dist/types/data-structures/binary-tree/tree-multimap.d.ts +1 -1
  56. package/package.json +2 -2
  57. package/src/data-structures/base/iterable-base.ts +24 -0
  58. package/src/data-structures/binary-tree/avl-tree.ts +14 -14
  59. package/src/data-structures/binary-tree/binary-tree.ts +74 -77
  60. package/src/data-structures/binary-tree/bst.ts +18 -17
  61. package/src/data-structures/binary-tree/rb-tree.ts +17 -18
  62. package/src/data-structures/binary-tree/tree-multimap.ts +22 -20
  63. package/src/data-structures/graph/abstract-graph.ts +35 -25
  64. package/src/data-structures/graph/directed-graph.ts +2 -2
  65. package/src/data-structures/graph/map-graph.ts +1 -1
  66. package/src/data-structures/graph/undirected-graph.ts +2 -2
  67. package/src/data-structures/hash/hash-map.ts +40 -24
  68. package/src/data-structures/hash/hash-table.ts +3 -3
  69. package/src/data-structures/heap/heap.ts +33 -60
  70. package/src/data-structures/heap/max-heap.ts +11 -2
  71. package/src/data-structures/heap/min-heap.ts +11 -2
  72. package/src/data-structures/linked-list/doubly-linked-list.ts +147 -145
  73. package/src/data-structures/linked-list/singly-linked-list.ts +52 -52
  74. package/src/data-structures/linked-list/skip-linked-list.ts +2 -2
  75. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -1
  76. package/src/data-structures/priority-queue/min-priority-queue.ts +1 -1
  77. package/src/data-structures/priority-queue/priority-queue.ts +9 -2
  78. package/src/data-structures/queue/deque.ts +129 -144
  79. package/src/data-structures/queue/queue.ts +37 -26
  80. package/src/data-structures/stack/stack.ts +20 -14
  81. package/src/data-structures/trie/trie.ts +18 -13
  82. package/src/interfaces/binary-tree.ts +5 -5
  83. package/src/types/common.ts +37 -12
  84. package/src/types/data-structures/binary-tree/avl-tree.ts +0 -1
  85. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -26
  86. package/src/types/data-structures/binary-tree/bst.ts +0 -1
  87. package/src/types/data-structures/binary-tree/rb-tree.ts +1 -1
  88. package/src/types/data-structures/binary-tree/tree-multimap.ts +1 -1
@@ -126,6 +126,12 @@ export declare abstract class IterableEntryBase<K = any, V = any> {
126
126
  * all the elements in the collection.
127
127
  */
128
128
  reduce<U>(callbackfn: ReduceEntryCallback<K, V, U>, initialValue: U): U;
129
+ hasValue(value: V): boolean;
130
+ /**
131
+ * Time Complexity: O(n)
132
+ * Space Complexity: O(n)
133
+ */
134
+ print(): void;
129
135
  protected abstract _getIterator(...args: any[]): IterableIterator<[K, V]>;
130
136
  }
131
137
  export declare abstract class IterableElementBase<V> {
@@ -228,5 +234,10 @@ export declare abstract class IterableElementBase<V> {
228
234
  * all the elements in the array and applying the callback function to each element.
229
235
  */
230
236
  reduce<U>(callbackfn: ReduceElementCallback<V, U>, initialValue: U): U;
237
+ /**
238
+ * Time Complexity: O(n)
239
+ * Space Complexity: O(n)
240
+ */
241
+ print(): void;
231
242
  protected abstract _getIterator(...args: any[]): IterableIterator<V>;
232
243
  }
@@ -172,6 +172,20 @@ class IterableEntryBase {
172
172
  }
173
173
  return accumulator;
174
174
  }
175
+ hasValue(value) {
176
+ for (const [, elementValue] of this) {
177
+ if (elementValue === value)
178
+ return true;
179
+ }
180
+ return false;
181
+ }
182
+ /**
183
+ * Time Complexity: O(n)
184
+ * Space Complexity: O(n)
185
+ */
186
+ print() {
187
+ console.log([...this]);
188
+ }
175
189
  }
176
190
  exports.IterableEntryBase = IterableEntryBase;
177
191
  class IterableElementBase {
@@ -308,5 +322,12 @@ class IterableElementBase {
308
322
  }
309
323
  return accumulator;
310
324
  }
325
+ /**
326
+ * Time Complexity: O(n)
327
+ * Space Complexity: O(n)
328
+ */
329
+ print() {
330
+ console.log([...this]);
331
+ }
311
332
  }
312
333
  exports.IterableElementBase = IterableElementBase;
@@ -6,8 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { BST, BSTNode } from './bst';
9
- import type { AVLTreeNested, AVLTreeNodeNested, AVLTreeOptions, BiTreeDeleteResult, BSTNodeKeyOrNode, BTNodeExemplar } from '../../types';
10
- import { BTNCallback, BTNodeKeyOrNode } from '../../types';
9
+ import type { AVLTreeNested, AVLTreeNodeNested, AVLTreeOptions, BinaryTreeDeleteResult, BSTNKeyOrNode, BTNCallback, BTNExemplar, BTNKeyOrNode } from '../../types';
11
10
  import { IBinaryTree } from '../../interfaces';
12
11
  export declare class AVLTreeNode<K = any, V = any, N extends AVLTreeNode<K, V, N> = AVLTreeNodeNested<K, V>> extends BSTNode<K, V, N> {
13
12
  height: number;
@@ -21,19 +20,18 @@ export declare class AVLTreeNode<K = any, V = any, N extends AVLTreeNode<K, V, N
21
20
  * 5. Efficient Lookups: Offers O(log n) search time, where 'n' is the number of nodes, due to its balanced nature.
22
21
  * 6. Complex Insertions and Deletions: Due to rebalancing, these operations are more complex than in a regular BST.
23
22
  * 7. Path Length: The path length from the root to any leaf is longer compared to an unbalanced BST, but shorter than a linear chain of nodes.
24
- * 8. Memory Overhead: Stores balance factors (or heights) at each node, leading to slightly higher memory usage compared to a regular BST.
25
23
  */
26
24
  export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> = AVLTreeNode<K, V, AVLTreeNodeNested<K, V>>, TREE extends AVLTree<K, V, N, TREE> = AVLTree<K, V, N, AVLTreeNested<K, V, N>>> extends BST<K, V, N, TREE> implements IBinaryTree<K, V, N, TREE> {
27
25
  /**
28
26
  * The constructor function initializes an AVLTree object with optional elements and options.
29
- * @param [elements] - The `elements` parameter is an optional iterable of `BTNodeExemplar<K, V, N>`
27
+ * @param [elements] - The `elements` parameter is an optional iterable of `BTNExemplar<K, V, N>`
30
28
  * objects. It represents a collection of elements that will be added to the AVL tree during
31
29
  * initialization.
32
30
  * @param [options] - The `options` parameter is an optional object that allows you to customize the
33
31
  * behavior of the AVL tree. It is of type `Partial<AVLTreeOptions>`, which means that you can
34
32
  * provide only a subset of the properties defined in the `AVLTreeOptions` interface.
35
33
  */
36
- constructor(elements?: Iterable<BTNodeExemplar<K, V, N>>, options?: Partial<AVLTreeOptions<K>>);
34
+ constructor(elements?: Iterable<BTNExemplar<K, V, N>>, options?: Partial<AVLTreeOptions<K>>);
37
35
  /**
38
36
  * The function creates a new AVL tree node with the specified key and value.
39
37
  * @param {K} key - The key parameter is the key value that will be associated with
@@ -54,17 +52,17 @@ export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> =
54
52
  createTree(options?: AVLTreeOptions<K>): TREE;
55
53
  /**
56
54
  * The function checks if an exemplar is an instance of AVLTreeNode.
57
- * @param exemplar - The `exemplar` parameter is of type `BTNodeExemplar<K, V, N>`.
55
+ * @param exemplar - The `exemplar` parameter is of type `BTNExemplar<K, V, N>`.
58
56
  * @returns a boolean value indicating whether the exemplar is an instance of the AVLTreeNode class.
59
57
  */
60
- isNode(exemplar: BTNodeExemplar<K, V, N>): exemplar is N;
58
+ isNode(exemplar: BTNExemplar<K, V, N>): exemplar is N;
61
59
  /**
62
60
  * The function "isNotNodeInstance" checks if a potential key is a K.
63
61
  * @param {any} potentialKey - The potentialKey parameter is of type any, which means it can be any
64
62
  * data type.
65
63
  * @returns a boolean value indicating whether the potentialKey is of type number or not.
66
64
  */
67
- isNotNodeInstance(potentialKey: BTNodeKeyOrNode<K, N>): potentialKey is K;
65
+ isNotNodeInstance(potentialKey: BTNKeyOrNode<K, N>): potentialKey is K;
68
66
  /**
69
67
  * Time Complexity: O(log n) - logarithmic time, where "n" is the number of nodes in the tree. The add method of the superclass (BST) has logarithmic time complexity.
70
68
  * Space Complexity: O(1) - constant space, as it doesn't use additional data structures that scale with input size.
@@ -81,7 +79,7 @@ export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> =
81
79
  * being added to the binary tree.
82
80
  * @returns The method is returning either the inserted node or undefined.
83
81
  */
84
- add(keyOrNodeOrEntry: BTNodeExemplar<K, V, N>, value?: V): N | undefined;
82
+ add(keyOrNodeOrEntry: BTNExemplar<K, V, N>, value?: V): N | undefined;
85
83
  /**
86
84
  * Time Complexity: O(log n) - logarithmic time, where "n" is the number of nodes in the tree. The add method of the superclass (BST) has logarithmic time complexity.
87
85
  * Space Complexity: O(1) - constant space, as it doesn't use additional data structures that scale with input size.
@@ -99,9 +97,9 @@ export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> =
99
97
  * that is deleted from the binary tree. It is an optional parameter and if not provided, it will
100
98
  * default to the `_defaultOneParamCallback` function. The `callback` function should have a single
101
99
  * parameter of type `N
102
- * @returns The method is returning an array of `BiTreeDeleteResult<N>`.
100
+ * @returns The method is returning an array of `BinaryTreeDeleteResult<N>`.
103
101
  */
104
- delete<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback?: C): BiTreeDeleteResult<N>[];
102
+ delete<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback?: C): BinaryTreeDeleteResult<N>[];
105
103
  /**
106
104
  * The `_swapProperties` function swaps the key, value, and height properties between two nodes in a binary
107
105
  * tree.
@@ -112,7 +110,7 @@ export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> =
112
110
  * @returns either the `destNode` object if both `srcNode` and `destNode` are defined, or `undefined`
113
111
  * if either `srcNode` or `destNode` is undefined.
114
112
  */
115
- protected _swapProperties(srcNode: BSTNodeKeyOrNode<K, N>, destNode: BSTNodeKeyOrNode<K, N>): N | undefined;
113
+ protected _swapProperties(srcNode: BSTNKeyOrNode<K, N>, destNode: BSTNKeyOrNode<K, N>): N | undefined;
116
114
  /**
117
115
  * Time Complexity: O(1) - constant time, as it performs a fixed number of operations.
118
116
  * Space Complexity: O(1) - constant space, as it only uses a constant amount of memory.
@@ -24,12 +24,11 @@ exports.AVLTreeNode = AVLTreeNode;
24
24
  * 5. Efficient Lookups: Offers O(log n) search time, where 'n' is the number of nodes, due to its balanced nature.
25
25
  * 6. Complex Insertions and Deletions: Due to rebalancing, these operations are more complex than in a regular BST.
26
26
  * 7. Path Length: The path length from the root to any leaf is longer compared to an unbalanced BST, but shorter than a linear chain of nodes.
27
- * 8. Memory Overhead: Stores balance factors (or heights) at each node, leading to slightly higher memory usage compared to a regular BST.
28
27
  */
29
28
  class AVLTree extends bst_1.BST {
30
29
  /**
31
30
  * The constructor function initializes an AVLTree object with optional elements and options.
32
- * @param [elements] - The `elements` parameter is an optional iterable of `BTNodeExemplar<K, V, N>`
31
+ * @param [elements] - The `elements` parameter is an optional iterable of `BTNExemplar<K, V, N>`
33
32
  * objects. It represents a collection of elements that will be added to the AVL tree during
34
33
  * initialization.
35
34
  * @param [options] - The `options` parameter is an optional object that allows you to customize the
@@ -65,7 +64,7 @@ class AVLTree extends bst_1.BST {
65
64
  }
66
65
  /**
67
66
  * The function checks if an exemplar is an instance of AVLTreeNode.
68
- * @param exemplar - The `exemplar` parameter is of type `BTNodeExemplar<K, V, N>`.
67
+ * @param exemplar - The `exemplar` parameter is of type `BTNExemplar<K, V, N>`.
69
68
  * @returns a boolean value indicating whether the exemplar is an instance of the AVLTreeNode class.
70
69
  */
71
70
  isNode(exemplar) {
@@ -121,7 +120,7 @@ class AVLTree extends bst_1.BST {
121
120
  * that is deleted from the binary tree. It is an optional parameter and if not provided, it will
122
121
  * default to the `_defaultOneParamCallback` function. The `callback` function should have a single
123
122
  * parameter of type `N
124
- * @returns The method is returning an array of `BiTreeDeleteResult<N>`.
123
+ * @returns The method is returning an array of `BinaryTreeDeleteResult<N>`.
125
124
  */
126
125
  delete(identifier, callback = this._defaultOneParamCallback) {
127
126
  if (identifier instanceof AVLTreeNode)
@@ -5,8 +5,8 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { BinaryTreeNodeNested, BinaryTreeOptions, BTNCallback, BTNodeEntry, BTNodeExemplar, BTNodeKeyOrNode } from '../../types';
9
- import { BinaryTreeNested, BinaryTreePrintOptions, BiTreeDeleteResult, DFSOrderPattern, EntryCallback, FamilyPosition, IterationType, NodeDisplayLayout } from '../../types';
8
+ import type { BinaryTreeDeleteResult, BinaryTreeNested, BinaryTreeNodeNested, BinaryTreeOptions, BinaryTreePrintOptions, BTNCallback, BTNEntry, BTNExemplar, BTNKeyOrNode, DFSOrderPattern, EntryCallback, NodeDisplayLayout } from '../../types';
9
+ import { FamilyPosition, IterationType } from '../../types';
10
10
  import { IBinaryTree } from '../../interfaces';
11
11
  import { IterableEntryBase } from "../base";
12
12
  /**
@@ -42,14 +42,14 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
42
42
  iterationType: IterationType;
43
43
  /**
44
44
  * The constructor function initializes a binary tree object with optional elements and options.
45
- * @param [elements] - An optional iterable of BTNodeExemplar objects. These objects represent the
45
+ * @param [elements] - An optional iterable of BTNExemplar objects. These objects represent the
46
46
  * elements to be added to the binary tree.
47
47
  * @param [options] - The `options` parameter is an optional object that can contain additional
48
48
  * configuration options for the binary tree. In this case, it is of type
49
49
  * `Partial<BinaryTreeOptions>`, which means that not all properties of `BinaryTreeOptions` are
50
50
  * required.
51
51
  */
52
- constructor(elements?: Iterable<BTNodeExemplar<K, V, N>>, options?: Partial<BinaryTreeOptions<K>>);
52
+ constructor(elements?: Iterable<BTNExemplar<K, V, N>>, options?: Partial<BinaryTreeOptions<K>>);
53
53
  protected _extractor: (key: K) => number;
54
54
  get extractor(): (key: K) => number;
55
55
  protected _root?: N | null;
@@ -73,26 +73,26 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
73
73
  createTree(options?: Partial<BinaryTreeOptions<K>>): TREE;
74
74
  /**
75
75
  * The function "isNode" checks if an exemplar is an instance of the BinaryTreeNode class.
76
- * @param exemplar - The `exemplar` parameter is a variable of type `BTNodeExemplar<K, V,N>`.
76
+ * @param exemplar - The `exemplar` parameter is a variable of type `BTNExemplar<K, V,N>`.
77
77
  * @returns a boolean value indicating whether the exemplar is an instance of the class N.
78
78
  */
79
- isNode(exemplar: BTNodeExemplar<K, V, N>): exemplar is N;
79
+ isNode(exemplar: BTNExemplar<K, V, N>): exemplar is N;
80
80
  /**
81
81
  * The function `exemplarToNode` converts an exemplar object into a node object.
82
- * @param exemplar - The `exemplar` parameter is of type `BTNodeExemplar<K, V, N>`.
82
+ * @param exemplar - The `exemplar` parameter is of type `BTNExemplar<K, V, N>`.
83
83
  * @param {V} [value] - The `value` parameter is an optional value that can be passed to the
84
84
  * `exemplarToNode` function. It represents the value associated with the exemplar node. If no value
85
85
  * is provided, it will be `undefined`.
86
86
  * @returns a value of type N (node), or null, or undefined.
87
87
  */
88
- exemplarToNode(exemplar: BTNodeExemplar<K, V, N>, value?: V): N | null | undefined;
88
+ exemplarToNode(exemplar: BTNExemplar<K, V, N>, value?: V): N | null | undefined;
89
89
  /**
90
90
  * The function checks if a given value is an entry in a binary tree node.
91
- * @param kne - BTNodeExemplar<K, V,N> - A generic type representing a node in a binary tree. It has
91
+ * @param kne - BTNExemplar<K, V,N> - A generic type representing a node in a binary tree. It has
92
92
  * two type parameters V and N, representing the value and node type respectively.
93
93
  * @returns a boolean value.
94
94
  */
95
- isEntry(kne: BTNodeExemplar<K, V, N>): kne is BTNodeEntry<K, V>;
95
+ isEntry(kne: BTNExemplar<K, V, N>): kne is BTNEntry<K, V>;
96
96
  /**
97
97
  * Time Complexity O(log n) - O(n)
98
98
  * Space Complexity O(1)
@@ -107,7 +107,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
107
107
  * @param {V} [value] - The value to be inserted into the binary tree.
108
108
  * @returns The function `add` returns either a node (`N`), `null`, or `undefined`.
109
109
  */
110
- add(keyOrNodeOrEntry: BTNodeExemplar<K, V, N>, value?: V): N | null | undefined;
110
+ add(keyOrNodeOrEntry: BTNExemplar<K, V, N>, value?: V): N | null | undefined;
111
111
  /**
112
112
  * Time Complexity: O(k log n) - O(k * n)
113
113
  * Space Complexity: O(1)
@@ -119,23 +119,23 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
119
119
  *
120
120
  * The `addMany` function takes in a collection of nodes and an optional collection of values, and
121
121
  * adds each node with its corresponding value to the data structure.
122
- * @param nodes - An iterable collection of BTNodeExemplar objects.
122
+ * @param nodes - An iterable collection of BTNExemplar objects.
123
123
  * @param [values] - An optional iterable of values that will be assigned to each node being added.
124
124
  * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
125
125
  */
126
- addMany(nodes: Iterable<BTNodeExemplar<K, V, N>>, values?: Iterable<V | undefined>): (N | null | undefined)[];
126
+ addMany(nodes: Iterable<BTNExemplar<K, V, N>>, values?: Iterable<V | undefined>): (N | null | undefined)[];
127
127
  /**
128
128
  * Time Complexity: O(k * n) "n" is the number of nodes in the tree, and "k" is the number of keys to be inserted.
129
129
  * Space Complexity: O(1)
130
130
  */
131
- refill(nodesOrKeysOrEntries: Iterable<BTNodeExemplar<K, V, N>>, values?: Iterable<V | undefined>): void;
131
+ refill(nodesOrKeysOrEntries: Iterable<BTNExemplar<K, V, N>>, values?: Iterable<V | undefined>): void;
132
132
  /**
133
133
  * Time Complexity: O(k * n) "n" is the number of nodes in the tree, and "k" is the number of keys to be inserted.
134
134
  * Space Complexity: O(1)
135
135
  */
136
- delete<C extends BTNCallback<N, K>>(identifier: K, callback?: C): BiTreeDeleteResult<N>[];
137
- delete<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C): BiTreeDeleteResult<N>[];
138
- delete<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C): BiTreeDeleteResult<N>[];
136
+ delete<C extends BTNCallback<N, K>>(identifier: K, callback?: C): BinaryTreeDeleteResult<N>[];
137
+ delete<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C): BinaryTreeDeleteResult<N>[];
138
+ delete<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C): BinaryTreeDeleteResult<N>[];
139
139
  /**
140
140
  * Time Complexity: O(n)
141
141
  * Space Complexity: O(1)
@@ -153,7 +153,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
153
153
  * `N` (binary tree node) or `null` or `undefined`. If no value is provided for `beginRoot
154
154
  * @returns the depth of the `distNode` relative to the `beginRoot`.
155
155
  */
156
- getDepth(distNode: BTNodeKeyOrNode<K, N>, beginRoot?: BTNodeKeyOrNode<K, N>): number;
156
+ getDepth(distNode: BTNKeyOrNode<K, N>, beginRoot?: BTNKeyOrNode<K, N>): number;
157
157
  /**
158
158
  * Time Complexity: O(n)
159
159
  * Space Complexity: O(1)
@@ -172,7 +172,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
172
172
  * values:
173
173
  * @returns the height of the binary tree.
174
174
  */
175
- getHeight(beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): number;
175
+ getHeight(beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): number;
176
176
  /**
177
177
  * Time Complexity: O(n)
178
178
  * Space Complexity: O(log n)
@@ -191,7 +191,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
191
191
  * to calculate the minimum height of a binary tree. It can have two possible values:
192
192
  * @returns The function `getMinHeight` returns the minimum height of a binary tree.
193
193
  */
194
- getMinHeight(beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): number;
194
+ getMinHeight(beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): number;
195
195
  /**
196
196
  * Time Complexity: O(n)
197
197
  * Space Complexity: O(log n)
@@ -208,28 +208,28 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
208
208
  * value of a binary tree node), `N` (a node of a binary tree), `null`, or `undefined`. If
209
209
  * @returns a boolean value.
210
210
  */
211
- isPerfectlyBalanced(beginRoot?: BTNodeKeyOrNode<K, N>): boolean;
211
+ isPerfectlyBalanced(beginRoot?: BTNKeyOrNode<K, N>): boolean;
212
212
  /**
213
213
  * Time Complexity: O(n)
214
214
  * Space Complexity: O(log n)
215
215
  */
216
- getNodes<C extends BTNCallback<N, K>>(identifier: K, callback?: C, onlyOne?: boolean, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N[];
217
- getNodes<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, onlyOne?: boolean, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N[];
218
- getNodes<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, onlyOne?: boolean, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N[];
216
+ getNodes<C extends BTNCallback<N, K>>(identifier: K, callback?: C, onlyOne?: boolean, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N[];
217
+ getNodes<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, onlyOne?: boolean, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N[];
218
+ getNodes<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, onlyOne?: boolean, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N[];
219
219
  /**
220
220
  * Time Complexity: O(n)
221
221
  * Space Complexity: O(log n).
222
222
  */
223
- has<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): boolean;
224
- has<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): boolean;
225
- has<C extends BTNCallback<N>>(identifier: ReturnType<C> | null | undefined, callback: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): boolean;
223
+ has<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): boolean;
224
+ has<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): boolean;
225
+ has<C extends BTNCallback<N>>(identifier: ReturnType<C> | null | undefined, callback: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): boolean;
226
226
  /**
227
227
  * Time Complexity: O(n)
228
228
  * Space Complexity: O(log n).
229
229
  */
230
- getNode<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
231
- getNode<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
232
- getNode<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
230
+ getNode<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
231
+ getNode<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
232
+ getNode<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
233
233
  /**
234
234
  * Time Complexity: O(n)
235
235
  * Space Complexity: O(log n)
@@ -264,10 +264,10 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
264
264
  * @returns either the node corresponding to the given key if it is a valid node key, or the key
265
265
  * itself if it is not a valid node key.
266
266
  */
267
- ensureNode(key: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
268
- get<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
269
- get<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
270
- get<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
267
+ ensureNode(key: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
268
+ get<C extends BTNCallback<N, K>>(identifier: K, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
269
+ get<C extends BTNCallback<N, N>>(identifier: N | null | undefined, callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
270
+ get<C extends BTNCallback<N>>(identifier: ReturnType<C>, callback: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): V | undefined;
271
271
  /**
272
272
  * Time Complexity: O(n)
273
273
  * Space Complexity: O(log n)
@@ -295,7 +295,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
295
295
  * reversed before returning it. If `isReverse` is set to `false`, the path will be returned as is
296
296
  * @returns The function `getPathToRoot` returns an array of nodes (`N[]`).
297
297
  */
298
- getPathToRoot(beginRoot: BTNodeKeyOrNode<K, N>, isReverse?: boolean): N[];
298
+ getPathToRoot(beginRoot: BTNKeyOrNode<K, N>, isReverse?: boolean): N[];
299
299
  /**
300
300
  * Time Complexity: O(log n)
301
301
  * Space Complexity: O(log n)
@@ -314,7 +314,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
314
314
  * @returns The function `getLeftMost` returns the leftmost node (`N`) in the binary tree. If there
315
315
  * is no leftmost node, it returns `null` or `undefined` depending on the input.
316
316
  */
317
- getLeftMost(beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
317
+ getLeftMost(beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
318
318
  /**
319
319
  * Time Complexity: O(log n)
320
320
  * Space Complexity: O(1)
@@ -334,7 +334,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
334
334
  * @returns The function `getRightMost` returns the rightmost node (`N`) in a binary tree. If there
335
335
  * is no rightmost node, it returns `null` or `undefined`, depending on the input.
336
336
  */
337
- getRightMost(beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
337
+ getRightMost(beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType): N | null | undefined;
338
338
  /**
339
339
  * Time Complexity: O(log n)
340
340
  * Space Complexity: O(1)
@@ -351,7 +351,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
351
351
  * possible values:
352
352
  * @returns a boolean value.
353
353
  */
354
- isSubtreeBST(beginRoot: BTNodeKeyOrNode<K, N>, iterationType?: IterationType): boolean;
354
+ isSubtreeBST(beginRoot: BTNKeyOrNode<K, N>, iterationType?: IterationType): boolean;
355
355
  /**
356
356
  * Time Complexity: O(n)
357
357
  * Space Complexity: O(1)
@@ -372,9 +372,9 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
372
372
  * Time Complexity: O(n)
373
373
  * Space Complexity: O(1)
374
374
  */
375
- subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
376
- subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
377
- subTreeTraverse<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
375
+ subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
376
+ subTreeTraverse<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
377
+ subTreeTraverse<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
378
378
  /**
379
379
  * Time complexity: O(n)
380
380
  * Space complexity: O(log n)
@@ -385,43 +385,43 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
385
385
  * @param {any} node - The parameter `node` is of type `any`, which means it can be any data type.
386
386
  * @returns a boolean value.
387
387
  */
388
- isRealNode(node: BTNodeExemplar<K, V, N>): node is N;
388
+ isRealNode(node: BTNExemplar<K, V, N>): node is N;
389
389
  /**
390
390
  * The function checks if a given node is a BinaryTreeNode instance and has a key value of NaN.
391
391
  * @param {any} node - The parameter `node` is of type `any`, which means it can be any data type.
392
392
  * @returns a boolean value.
393
393
  */
394
- isNIL(node: BTNodeExemplar<K, V, N>): boolean;
394
+ isNIL(node: BTNExemplar<K, V, N>): boolean;
395
395
  /**
396
396
  * The function checks if a given node is a real node or null.
397
397
  * @param {any} node - The parameter `node` is of type `any`, which means it can be any data type.
398
398
  * @returns a boolean value.
399
399
  */
400
- isNodeOrNull(node: BTNodeExemplar<K, V, N>): node is N | null;
400
+ isNodeOrNull(node: BTNExemplar<K, V, N>): node is N | null;
401
401
  /**
402
402
  * The function "isNotNodeInstance" checks if a potential key is a K.
403
403
  * @param {any} potentialKey - The potentialKey parameter is of type any, which means it can be any
404
404
  * data type.
405
405
  * @returns a boolean value indicating whether the potentialKey is of type number or not.
406
406
  */
407
- isNotNodeInstance(potentialKey: BTNodeKeyOrNode<K, N>): potentialKey is K;
408
- dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
409
- dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
410
- dfs<C extends BTNCallback<N | null | undefined>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
407
+ isNotNodeInstance(potentialKey: BTNKeyOrNode<K, N>): potentialKey is K;
408
+ dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
409
+ dfs<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
410
+ dfs<C extends BTNCallback<N | null | undefined>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
411
411
  /**
412
412
  * Time complexity: O(n)
413
413
  * Space complexity: O(n)
414
414
  */
415
- bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
416
- bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
417
- bfs<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
415
+ bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[];
416
+ bfs<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[];
417
+ bfs<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[];
418
418
  /**
419
419
  * Time complexity: O(n)
420
420
  * Space complexity: O(n)
421
421
  */
422
- listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[][];
423
- listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[][];
424
- listLevels<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNodeKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[][];
422
+ listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: false): ReturnType<C>[][];
423
+ listLevels<C extends BTNCallback<N>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: undefined): ReturnType<C>[][];
424
+ listLevels<C extends BTNCallback<N | null | undefined>>(callback?: C, beginRoot?: BTNKeyOrNode<K, N>, iterationType?: IterationType, includeNull?: true): ReturnType<C>[][];
425
425
  /**
426
426
  * Time Complexity: O(log n)
427
427
  * Space Complexity: O(1)
@@ -461,7 +461,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
461
461
  * `callback` function on each node in the binary tree. The type of the array elements is determined
462
462
  * by the return type of the `callback` function.
463
463
  */
464
- morris<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNodeKeyOrNode<K, N>): ReturnType<C>[];
464
+ morris<C extends BTNCallback<N>>(callback?: C, pattern?: DFSOrderPattern, beginRoot?: BTNKeyOrNode<K, N>): ReturnType<C>[];
465
465
  /**
466
466
  * Time complexity: O(n)
467
467
  * Space complexity: O(n)
@@ -522,7 +522,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
522
522
  * following types:
523
523
  * @param {BinaryTreePrintOptions} [options={ isShowUndefined: false, isShowNull: false, isShowRedBlackNIL: false}] - Options object that controls printing behavior. You can specify whether to display undefined, null, or sentinel nodes.
524
524
  */
525
- print(beginRoot?: BTNodeKeyOrNode<K, N>, options?: BinaryTreePrintOptions): void;
525
+ print(beginRoot?: BTNKeyOrNode<K, N>, options?: BinaryTreePrintOptions): void;
526
526
  protected _getIterator(node?: N | null | undefined): IterableIterator<[K, V | undefined]>;
527
527
  protected _displayAux(node: N | null | undefined, options: BinaryTreePrintOptions): NodeDisplayLayout;
528
528
  protected _defaultOneParamCallback: (node: N) => K;
@@ -532,7 +532,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
532
532
  * @param {N} destNode - The destination node to swap.
533
533
  * @returns {N} - The destination node after the swap.
534
534
  */
535
- protected _swapProperties(srcNode: BTNodeKeyOrNode<K, N>, destNode: BTNodeKeyOrNode<K, N>): N | undefined;
535
+ protected _swapProperties(srcNode: BTNKeyOrNode<K, N>, destNode: BTNKeyOrNode<K, N>): N | undefined;
536
536
  /**
537
537
  * The function replaces an old node with a new node in a binary tree.
538
538
  * @param {N} oldNode - The oldNode parameter represents the node that needs to be replaced in the
@@ -553,7 +553,7 @@ export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V,
553
553
  * the binary tree. If neither the left nor right child is available, the function returns undefined.
554
554
  * If the parent node is null, the function also returns undefined.
555
555
  */
556
- protected _addTo(newNode: N | null | undefined, parent: BTNodeKeyOrNode<K, N>): N | null | undefined;
556
+ protected _addTo(newNode: N | null | undefined, parent: BTNKeyOrNode<K, N>): N | null | undefined;
557
557
  /**
558
558
  * The function sets the root property of an object to a given value, and if the value is not null,
559
559
  * it also sets the parent property of the value to undefined.
@@ -69,7 +69,7 @@ exports.BinaryTreeNode = BinaryTreeNode;
69
69
  class BinaryTree extends base_1.IterableEntryBase {
70
70
  /**
71
71
  * The constructor function initializes a binary tree object with optional elements and options.
72
- * @param [elements] - An optional iterable of BTNodeExemplar objects. These objects represent the
72
+ * @param [elements] - An optional iterable of BTNExemplar objects. These objects represent the
73
73
  * elements to be added to the binary tree.
74
74
  * @param [options] - The `options` parameter is an optional object that can contain additional
75
75
  * configuration options for the binary tree. In this case, it is of type
@@ -124,7 +124,7 @@ class BinaryTree extends base_1.IterableEntryBase {
124
124
  }
125
125
  /**
126
126
  * The function "isNode" checks if an exemplar is an instance of the BinaryTreeNode class.
127
- * @param exemplar - The `exemplar` parameter is a variable of type `BTNodeExemplar<K, V,N>`.
127
+ * @param exemplar - The `exemplar` parameter is a variable of type `BTNExemplar<K, V,N>`.
128
128
  * @returns a boolean value indicating whether the exemplar is an instance of the class N.
129
129
  */
130
130
  isNode(exemplar) {
@@ -132,7 +132,7 @@ class BinaryTree extends base_1.IterableEntryBase {
132
132
  }
133
133
  /**
134
134
  * The function `exemplarToNode` converts an exemplar object into a node object.
135
- * @param exemplar - The `exemplar` parameter is of type `BTNodeExemplar<K, V, N>`.
135
+ * @param exemplar - The `exemplar` parameter is of type `BTNExemplar<K, V, N>`.
136
136
  * @param {V} [value] - The `value` parameter is an optional value that can be passed to the
137
137
  * `exemplarToNode` function. It represents the value associated with the exemplar node. If no value
138
138
  * is provided, it will be `undefined`.
@@ -170,7 +170,7 @@ class BinaryTree extends base_1.IterableEntryBase {
170
170
  }
171
171
  /**
172
172
  * The function checks if a given value is an entry in a binary tree node.
173
- * @param kne - BTNodeExemplar<K, V,N> - A generic type representing a node in a binary tree. It has
173
+ * @param kne - BTNExemplar<K, V,N> - A generic type representing a node in a binary tree. It has
174
174
  * two type parameters V and N, representing the value and node type respectively.
175
175
  * @returns a boolean value.
176
176
  */
@@ -248,7 +248,7 @@ class BinaryTree extends base_1.IterableEntryBase {
248
248
  *
249
249
  * The `addMany` function takes in a collection of nodes and an optional collection of values, and
250
250
  * adds each node with its corresponding value to the data structure.
251
- * @param nodes - An iterable collection of BTNodeExemplar objects.
251
+ * @param nodes - An iterable collection of BTNExemplar objects.
252
252
  * @param [values] - An optional iterable of values that will be assigned to each node being added.
253
253
  * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
254
254
  */
@@ -292,7 +292,7 @@ class BinaryTree extends base_1.IterableEntryBase {
292
292
  * @param {C} callback - The `callback` parameter is a function that is used to determine the
293
293
  * identifier of the node to be deleted. It is optional and has a default value of
294
294
  * `this._defaultOneParamCallback`. The `callback` function should return the identifier of the node.
295
- * @returns an array of `BiTreeDeleteResult<N>`.
295
+ * @returns an array of `BinaryTreeDeleteResult<N>`.
296
296
  */
297
297
  delete(identifier, callback = this._defaultOneParamCallback) {
298
298
  const deletedResult = [];