data-structure-typed 1.37.3 → 1.37.4

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 (28) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/data-structures/binary-tree/avl-tree.d.ts +42 -34
  3. package/dist/data-structures/binary-tree/avl-tree.js +42 -34
  4. package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
  5. package/dist/data-structures/binary-tree/binary-tree.d.ts +265 -168
  6. package/dist/data-structures/binary-tree/binary-tree.js +257 -170
  7. package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
  8. package/dist/data-structures/binary-tree/bst.d.ts +104 -59
  9. package/dist/data-structures/binary-tree/bst.js +105 -60
  10. package/dist/data-structures/binary-tree/bst.js.map +1 -1
  11. package/dist/data-structures/binary-tree/tree-multiset.d.ts +47 -39
  12. package/dist/data-structures/binary-tree/tree-multiset.js +47 -39
  13. package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
  14. package/lib/data-structures/binary-tree/avl-tree.d.ts +42 -34
  15. package/lib/data-structures/binary-tree/avl-tree.js +42 -34
  16. package/lib/data-structures/binary-tree/binary-tree.d.ts +265 -168
  17. package/lib/data-structures/binary-tree/binary-tree.js +257 -170
  18. package/lib/data-structures/binary-tree/bst.d.ts +104 -59
  19. package/lib/data-structures/binary-tree/bst.js +105 -60
  20. package/lib/data-structures/binary-tree/tree-multiset.d.ts +47 -39
  21. package/lib/data-structures/binary-tree/tree-multiset.js +47 -39
  22. package/package.json +5 -5
  23. package/src/data-structures/binary-tree/avl-tree.ts +42 -34
  24. package/src/data-structures/binary-tree/binary-tree.ts +270 -174
  25. package/src/data-structures/binary-tree/bst.ts +108 -66
  26. package/src/data-structures/binary-tree/tree-multiset.ts +47 -39
  27. package/umd/bundle.min.js +1 -1
  28. package/umd/bundle.min.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"binary-tree.js","sourceRoot":"","sources":["../../../src/data-structures/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
1
+ {"version":3,"file":"binary-tree.js","sourceRoot":"","sources":["../../../src/data-structures/binary-tree/binary-tree.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAWH,uCAAoG;AAEpG,uCAAuC;AACvC,oCAA+B;AAE/B;;;;GAIG;AACH,MAAa,cAAc;IACzB;;;;OAIG;IACH,YAAY,GAAsB,EAAE,GAAO;QACzC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAcD;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAI,IAAI,CAAC,CAA4B;QACnC,IAAI,CAAC,EAAE;YACL,CAAC,CAAC,MAAM,GAAG,IAAyB,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;IAID;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,IAAI,KAAK,CAAC,CAA4B;QACpC,IAAI,CAAC,EAAE;YACL,CAAC,CAAC,MAAM,GAAG,IAAyB,CAAC;SACtC;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAOD;;;OAGG;IACH,IAAI,cAAc;QAChB,MAAM,IAAI,GAAG,IAAyB,CAAC;QACvC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC7B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;oBAC3B,OAAO,sBAAc,CAAC,SAAS,CAAC;iBACjC;qBAAM;oBACL,OAAO,sBAAc,CAAC,IAAI,CAAC;iBAC5B;aACF;iBAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE;gBACrC,IAAI,IAAI,CAA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AAE;YACL,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC;SACtB;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACO,QAAQ,CAAC,CAAS;QAC1B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;CAGF;AAp/BD,gCAo/BC"}
@@ -14,79 +14,119 @@ export declare class BSTNode<V = any, FAMILY extends BSTNode<V, FAMILY> = BSTNod
14
14
  }
15
15
  export declare class BST<N extends BSTNode<N['val'], N> = BSTNode> extends BinaryTree<N> implements IBinaryTree<N> {
16
16
  /**
17
- * The constructor function initializes a binary search tree object with an optional comparator function.
18
- * @param {BSTOptions} [options] - An optional object that contains configuration options for the binary search tree.
17
+ * The constructor function initializes a binary search tree object with an optional comparator
18
+ * function.
19
+ * @param {BSTOptions} [options] - An optional object that contains configuration options for the
20
+ * binary search tree.
19
21
  */
20
22
  constructor(options?: BSTOptions);
21
23
  /**
22
24
  * The function creates a new binary search tree node with the given key and value.
23
- * @param {BinaryTreeNodeKey} key - The `key` parameter is the identifier for the binary tree node. It is used to uniquely
24
- * identify each node in the binary tree.
25
- * @param [val] - The `val` parameter is an optional value that can be assigned to the node. It represents the value
26
- * that will be stored in the node.
25
+ * @param {BinaryTreeNodeKey} key - The key parameter is the key value that will be associated with
26
+ * the new node. It is used to determine the position of the node in the binary search tree.
27
+ * @param [val] - The parameter `val` is an optional value that can be assigned to the node. It
28
+ * represents the value associated with the node in a binary search tree.
27
29
  * @returns a new instance of the BSTNode class with the specified key and value.
28
30
  */
29
31
  createNode(key: BinaryTreeNodeKey, val?: N['val']): N;
30
32
  /**
31
- * The `add` function adds a new node to a binary search tree, either by creating a new node or by updating an existing
32
- * node with the same ID.
33
- * @param {BinaryTreeNodeKey | N | null} keyOrNode - The `keyOrNode` parameter can be either a `BinaryTreeNodeKey` or a `N`
34
- * (which represents a binary tree node) or `null`.
35
- * @param [val] - The `val` parameter is an optional value that can be assigned to the `val` property of the new node
36
- * being added to the binary search tree.
37
- * @returns The function `add` returns the inserted node (`inserted`) which can be of type `N`, `null`, or `undefined`.
33
+ * The `add` function in a binary search tree class inserts a new node with a given key and value
34
+ * into the tree.
35
+ * @param {BinaryTreeNodeKey | N | null} keyOrNode - The `keyOrNode` parameter can be either a
36
+ * `BinaryTreeNodeKey` (which can be a number or a string), a `BSTNode` object, or `null`.
37
+ * @param [val] - The `val` parameter is the value to be assigned to the new node being added to the
38
+ * binary search tree.
39
+ * @returns the inserted node (N) if it was successfully added to the binary search tree. If the node
40
+ * was not added or if the parameters were invalid, it returns null or undefined.
38
41
  */
39
42
  add(keyOrNode: BinaryTreeNodeKey | N | null, val?: N['val']): N | null | undefined;
40
43
  /**
41
- * The `addMany` function overrides the base class method to add multiple nodes to a binary search tree in a balanced
42
- * manner.
43
- * @param {[BinaryTreeNodeKey | N , N['val']][]} keysOrNodes - The `keysOrNodes` parameter in the `addMany` function is an array of
44
- * `BinaryTreeNodeKey` or `N` (node) objects, or `null` values. It represents the nodes or node IDs that need to be added
45
- * to the binary search tree.
44
+ * The `addMany` function is used to efficiently add multiple nodes to a binary search tree while
45
+ * maintaining balance.
46
+ * @param {[BinaryTreeNodeKey | N, N['val']][]} arr - The `arr` parameter in the `addMany` function
47
+ * represents an array of keys or nodes that need to be added to the binary search tree. It can be an
48
+ * array of `BinaryTreeNodeKey` or `N` (which represents the node type in the binary search tree) or
49
+ * `null
46
50
  * @param {N['val'][]} data - The values of tree nodes
47
51
  * @param {boolean} isBalanceAdd - If true the nodes will be balance inserted in binary search method.
48
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a
49
- * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
52
+ * @param iterationType - The `iterationType` parameter determines the type of iteration to be used.
53
+ * It can have two possible values:
54
+ * @returns The `addMany` function returns an array of `N`, `null`, or `undefined` values.
50
55
  */
51
56
  addMany(keysOrNodes: (BinaryTreeNodeKey | null)[] | (N | null)[], data?: N['val'][], isBalanceAdd?: boolean, iterationType?: IterationType): (N | null | undefined)[];
52
57
  /**
53
- * The function returns the first node in a binary tree that matches the given property name and value.
54
- * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeKey` or a
55
- * generic type `N`. It represents the property of the binary tree node that you want to search for.
56
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
57
- * specifies the property name to use for searching the binary tree nodes. If not provided, it defaults to `'key'`.
58
- * @returns The method is returning either a BinaryTreeNodeKey or N (generic type) or null.
58
+ * The function returns the first node in the binary tree that matches the given node property and
59
+ * callback.
60
+ * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter is used to specify the
61
+ * property of the binary tree node that you want to search for. It can be either a specific key
62
+ * value (`BinaryTreeNodeKey`) or a custom callback function (`MapCallback<N>`) that determines
63
+ * whether a node matches the desired property.
64
+ * @param callback - The `callback` parameter is a function that is used to determine whether a node
65
+ * matches the desired property. It takes a node as input and returns a boolean value indicating
66
+ * whether the node matches the property or not. If no callback function is provided, the default
67
+ * callback function `_defaultCallbackByKey` is used
68
+ * @param beginRoot - The `beginRoot` parameter is the starting point for the search. It specifies
69
+ * the root node from which the search should begin.
70
+ * @param iterationType - The `iterationType` parameter is used to specify the type of iteration to
71
+ * be performed when searching for nodes in the binary tree. It can have one of the following values:
72
+ * @returns either the first node that matches the given nodeProperty and callback, or null if no
73
+ * matching node is found.
59
74
  */
60
- get(nodeProperty: BinaryTreeNodeKey | N, callback?: MapCallback<N>): N | null;
75
+ get(nodeProperty: BinaryTreeNodeKey | N, callback?: MapCallback<N>, beginRoot?: N | null, iterationType?: IterationType): N | null;
61
76
  /**
62
- * lastKey returns the last key in a binary tree. If the binary tree is empty, it returns 0.
63
- * @param beginRoot - The `beginRoot` parameter is an optional parameter that specifies the root node from which to begin
64
- * the search for the last key.
65
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a recursive or iterative approach to search for the last key.
77
+ * The function `lastKey` returns the key of the rightmost node if the comparison result is less
78
+ * than, the key of the leftmost node if the comparison result is greater than, and the key of the
79
+ * rightmost node otherwise.
80
+ * @param {N | null} beginRoot - The `beginRoot` parameter is the starting point for finding the last
81
+ * key in a binary tree. It represents the root node of the subtree from which the search for the
82
+ * last key should begin. If no specific `beginRoot` is provided, the search will start from the root
83
+ * of the entire binary
84
+ * @param iterationType - The `iterationType` parameter is used to specify the type of iteration to
85
+ * be performed when finding the last key. It determines whether the iteration should be performed in
86
+ * pre-order, in-order, or post-order.
87
+ * @returns the key of the rightmost node in the binary tree if the comparison result is less than,
88
+ * the key of the leftmost node if the comparison result is greater than, and the key of the
89
+ * rightmost node otherwise. If no node is found, it returns 0.
66
90
  */
67
91
  lastKey(beginRoot?: N | null, iterationType?: IterationType): BinaryTreeNodeKey;
68
92
  /**
69
- * The function `getNodes` returns an array of nodes in a binary tree that match a given property value.
70
- * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeKey` or an
71
- * `N` type. It represents the property of the binary tree node that you want to compare with.
72
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
73
- * specifies the property name to use for comparison. If not provided, it defaults to `'key'`.
74
- * @param {boolean} [onlyOne] - The `onlyOne` parameter is an optional boolean parameter that determines whether to
75
- * return only one node that matches the given `nodeProperty` or all nodes that match the `nodeProperty`. If `onlyOne`
76
- * is set to `true`, the function will return an array with only one node (if
77
- * @param beginRoot - The `beginRoot` parameter is an optional parameter that specifies the root node from which to
78
- * @param iterationType
79
- * @returns an array of nodes (type N).
93
+ * The function `getNodes` retrieves nodes from a binary tree based on a given node property or key,
94
+ * using either recursive or iterative traversal.
95
+ * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter represents the property
96
+ * of the binary tree node that you want to search for. It can be either a `BinaryTreeNodeKey` or a
97
+ * generic type `N`.
98
+ * @param callback - The `callback` parameter is a function that takes a node as input and returns a
99
+ * value. This value is compared with the `nodeProperty` parameter to determine if the node should be
100
+ * included in the result. The default value for `callback` is `this._defaultCallbackByKey`, which is
101
+ * a
102
+ * @param [onlyOne=false] - A boolean value indicating whether to stop the traversal after finding
103
+ * the first node that matches the nodeProperty. If set to true, the function will return an array
104
+ * containing only that node. If set to false (default), the function will continue the traversal and
105
+ * return an array containing all nodes that match the node
106
+ * @param {N | null} beginRoot - The `beginRoot` parameter is the starting node for the traversal. It
107
+ * specifies the root node of the binary tree from which the traversal should begin. If `beginRoot`
108
+ * is `null`, an empty array will be returned.
109
+ * @param iterationType - The `iterationType` parameter determines the type of iteration used to
110
+ * traverse the binary tree. It can have one of the following values:
111
+ * @returns an array of nodes (N[]).
80
112
  */
81
113
  getNodes(nodeProperty: BinaryTreeNodeKey | N, callback?: MapCallback<N>, onlyOne?: boolean, beginRoot?: N | null, iterationType?: IterationType): N[];
82
114
  /**
83
- * The `lesserOrGreaterTraverse` function adds a delta value to the specified property of all nodes in a binary tree that
84
- * have a greater value than a given node.
85
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
86
- * represents the node in the binary tree to which the delta value will be added.
87
- * @param lesserOrGreater - The `lesserOrGreater` parameter is an optional parameter that specifies whether the delta
88
- * @param targetNode - The `targetNode` parameter is an optional parameter that specifies the node in the binary tree
89
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a
115
+ * The `lesserOrGreaterTraverse` function traverses a binary tree and applies a callback function to
116
+ * nodes that have a key value lesser or greater than a target key value.
117
+ * @param callback - The `callback` parameter is a function that will be called for each node that
118
+ * meets the condition specified by the `lesserOrGreater` parameter. It takes a node as an argument
119
+ * and returns a value.
120
+ * @param {CP} lesserOrGreater - The `lesserOrGreater` parameter is used to determine whether to
121
+ * traverse nodes that are lesser than, greater than, or equal to the `targetNode`. It can take one
122
+ * of the following values:
123
+ * @param {N | BinaryTreeNodeKey | null} targetNode - The `targetNode` parameter in the
124
+ * `lesserOrGreaterTraverse` function is used to specify the node from which the traversal should
125
+ * start. It can be either a reference to a specific node (`N`), the key of a node
126
+ * (`BinaryTreeNodeKey`), or `null` to
127
+ * @param iterationType - The `iterationType` parameter determines whether the traversal should be
128
+ * done recursively or iteratively. It can have two possible values:
129
+ * @returns The function `lesserOrGreaterTraverse` returns an array of `MapCallbackReturn<N>`.
90
130
  */
91
131
  lesserOrGreaterTraverse(callback?: MapCallback<N>, lesserOrGreater?: CP, targetNode?: N | BinaryTreeNodeKey | null, iterationType?: IterationType): MapCallbackReturn<N>;
92
132
  /**
@@ -99,24 +139,29 @@ export declare class BST<N extends BSTNode<N['val'], N> = BSTNode> extends Binar
99
139
  * AVL Tree: AVL trees are well-suited for scenarios involving frequent searching, insertion, and deletion operations. Through rotation adjustments, AVL trees maintain their balance, ensuring average and worst-case time complexity of O(log n).
100
140
  */
101
141
  /**
102
- * The `perfectlyBalance` function takes a binary tree, performs a depth-first search to sort the nodes, and then
103
- * constructs a balanced binary search tree using either a recursive or iterative approach.
104
- * @returns The function `perfectlyBalance()` returns a boolean value.
142
+ * The `perfectlyBalance` function balances a binary search tree by adding nodes in a way that
143
+ * ensures the tree is perfectly balanced.
144
+ * @param iterationType - The `iterationType` parameter is an optional parameter that specifies the
145
+ * type of iteration to use when building a balanced binary search tree. It can have two possible
146
+ * values:
147
+ * @returns The function `perfectlyBalance` returns a boolean value.
105
148
  */
106
149
  perfectlyBalance(iterationType?: IterationType): boolean;
107
150
  /**
108
- * The function `isAVLBalanced` checks if a binary tree is balanced according to the AVL tree property.
151
+ * The function checks if a binary tree is AVL balanced using either recursive or iterative approach.
152
+ * @param iterationType - The `iterationType` parameter is used to determine the method of iteration
153
+ * to check if the AVL tree is balanced. It can have two possible values:
109
154
  * @returns a boolean value.
110
155
  */
111
156
  isAVLBalanced(iterationType?: IterationType): boolean;
112
157
  protected _comparator: BSTComparator;
113
158
  /**
114
- * The function compares two binary tree node IDs using a comparator function and returns whether the first ID is
115
- * greater than, less than, or equal to the second ID.
116
- * @param {BinaryTreeNodeKey} a - "a" is a BinaryTreeNodeKey, which represents the identifier of a binary tree node.
117
- * @param {BinaryTreeNodeKey} b - The parameter "b" in the above code refers to a BinaryTreeNodeKey.
118
- * @returns a value of type CP (ComparisonResult). The possible return values are CP.gt (greater than), CP.lt (less
119
- * than), or CP.eq (equal).
159
+ * The function compares two values using a comparator function and returns whether the first value
160
+ * is greater than, less than, or equal to the second value.
161
+ * @param {BinaryTreeNodeKey} a - The parameter "a" is of type BinaryTreeNodeKey.
162
+ * @param {BinaryTreeNodeKey} b - The parameter "b" in the above code represents a BinaryTreeNodeKey.
163
+ * @returns a value of type CP (ComparisonResult). The possible return values are CP.gt (greater
164
+ * than), CP.lt (less than), or CP.eq (equal).
120
165
  */
121
166
  protected _compare(a: BinaryTreeNodeKey, b: BinaryTreeNodeKey): CP;
122
167
  }
@@ -12,8 +12,10 @@ class BSTNode extends binary_tree_1.BinaryTreeNode {
12
12
  exports.BSTNode = BSTNode;
13
13
  class BST extends binary_tree_1.BinaryTree {
14
14
  /**
15
- * The constructor function initializes a binary search tree object with an optional comparator function.
16
- * @param {BSTOptions} [options] - An optional object that contains configuration options for the binary search tree.
15
+ * The constructor function initializes a binary search tree object with an optional comparator
16
+ * function.
17
+ * @param {BSTOptions} [options] - An optional object that contains configuration options for the
18
+ * binary search tree.
17
19
  */
18
20
  constructor(options) {
19
21
  super(options);
@@ -27,23 +29,24 @@ class BST extends binary_tree_1.BinaryTree {
27
29
  }
28
30
  /**
29
31
  * The function creates a new binary search tree node with the given key and value.
30
- * @param {BinaryTreeNodeKey} key - The `key` parameter is the identifier for the binary tree node. It is used to uniquely
31
- * identify each node in the binary tree.
32
- * @param [val] - The `val` parameter is an optional value that can be assigned to the node. It represents the value
33
- * that will be stored in the node.
32
+ * @param {BinaryTreeNodeKey} key - The key parameter is the key value that will be associated with
33
+ * the new node. It is used to determine the position of the node in the binary search tree.
34
+ * @param [val] - The parameter `val` is an optional value that can be assigned to the node. It
35
+ * represents the value associated with the node in a binary search tree.
34
36
  * @returns a new instance of the BSTNode class with the specified key and value.
35
37
  */
36
38
  createNode(key, val) {
37
39
  return new BSTNode(key, val);
38
40
  }
39
41
  /**
40
- * The `add` function adds a new node to a binary search tree, either by creating a new node or by updating an existing
41
- * node with the same ID.
42
- * @param {BinaryTreeNodeKey | N | null} keyOrNode - The `keyOrNode` parameter can be either a `BinaryTreeNodeKey` or a `N`
43
- * (which represents a binary tree node) or `null`.
44
- * @param [val] - The `val` parameter is an optional value that can be assigned to the `val` property of the new node
45
- * being added to the binary search tree.
46
- * @returns The function `add` returns the inserted node (`inserted`) which can be of type `N`, `null`, or `undefined`.
42
+ * The `add` function in a binary search tree class inserts a new node with a given key and value
43
+ * into the tree.
44
+ * @param {BinaryTreeNodeKey | N | null} keyOrNode - The `keyOrNode` parameter can be either a
45
+ * `BinaryTreeNodeKey` (which can be a number or a string), a `BSTNode` object, or `null`.
46
+ * @param [val] - The `val` parameter is the value to be assigned to the new node being added to the
47
+ * binary search tree.
48
+ * @returns the inserted node (N) if it was successfully added to the binary search tree. If the node
49
+ * was not added or if the parameters were invalid, it returns null or undefined.
47
50
  */
48
51
  add(keyOrNode, val) {
49
52
  // TODO support node as a parameter
@@ -121,15 +124,17 @@ class BST extends binary_tree_1.BinaryTree {
121
124
  return inserted;
122
125
  }
123
126
  /**
124
- * The `addMany` function overrides the base class method to add multiple nodes to a binary search tree in a balanced
125
- * manner.
126
- * @param {[BinaryTreeNodeKey | N , N['val']][]} keysOrNodes - The `keysOrNodes` parameter in the `addMany` function is an array of
127
- * `BinaryTreeNodeKey` or `N` (node) objects, or `null` values. It represents the nodes or node IDs that need to be added
128
- * to the binary search tree.
127
+ * The `addMany` function is used to efficiently add multiple nodes to a binary search tree while
128
+ * maintaining balance.
129
+ * @param {[BinaryTreeNodeKey | N, N['val']][]} arr - The `arr` parameter in the `addMany` function
130
+ * represents an array of keys or nodes that need to be added to the binary search tree. It can be an
131
+ * array of `BinaryTreeNodeKey` or `N` (which represents the node type in the binary search tree) or
132
+ * `null
129
133
  * @param {N['val'][]} data - The values of tree nodes
130
134
  * @param {boolean} isBalanceAdd - If true the nodes will be balance inserted in binary search method.
131
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a
132
- * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
135
+ * @param iterationType - The `iterationType` parameter determines the type of iteration to be used.
136
+ * It can have two possible values:
137
+ * @returns The `addMany` function returns an array of `N`, `null`, or `undefined` values.
133
138
  */
134
139
  addMany(keysOrNodes, data, isBalanceAdd = true, iterationType = this.iterationType) {
135
140
  // TODO this addMany function is inefficient, it should be optimized
@@ -201,22 +206,41 @@ class BST extends binary_tree_1.BinaryTree {
201
206
  return inserted;
202
207
  }
203
208
  /**
204
- * The function returns the first node in a binary tree that matches the given property name and value.
205
- * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeKey` or a
206
- * generic type `N`. It represents the property of the binary tree node that you want to search for.
207
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
208
- * specifies the property name to use for searching the binary tree nodes. If not provided, it defaults to `'key'`.
209
- * @returns The method is returning either a BinaryTreeNodeKey or N (generic type) or null.
209
+ * The function returns the first node in the binary tree that matches the given node property and
210
+ * callback.
211
+ * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter is used to specify the
212
+ * property of the binary tree node that you want to search for. It can be either a specific key
213
+ * value (`BinaryTreeNodeKey`) or a custom callback function (`MapCallback<N>`) that determines
214
+ * whether a node matches the desired property.
215
+ * @param callback - The `callback` parameter is a function that is used to determine whether a node
216
+ * matches the desired property. It takes a node as input and returns a boolean value indicating
217
+ * whether the node matches the property or not. If no callback function is provided, the default
218
+ * callback function `_defaultCallbackByKey` is used
219
+ * @param beginRoot - The `beginRoot` parameter is the starting point for the search. It specifies
220
+ * the root node from which the search should begin.
221
+ * @param iterationType - The `iterationType` parameter is used to specify the type of iteration to
222
+ * be performed when searching for nodes in the binary tree. It can have one of the following values:
223
+ * @returns either the first node that matches the given nodeProperty and callback, or null if no
224
+ * matching node is found.
210
225
  */
211
- get(nodeProperty, callback = this._defaultCallbackByKey) {
226
+ get(nodeProperty, callback = this._defaultCallbackByKey, beginRoot = this.root, iterationType = this.iterationType) {
212
227
  var _a;
213
- return (_a = this.getNodes(nodeProperty, callback, true)[0]) !== null && _a !== void 0 ? _a : null;
228
+ return (_a = this.getNodes(nodeProperty, callback, true, beginRoot, iterationType)[0]) !== null && _a !== void 0 ? _a : null;
214
229
  }
215
230
  /**
216
- * lastKey returns the last key in a binary tree. If the binary tree is empty, it returns 0.
217
- * @param beginRoot - The `beginRoot` parameter is an optional parameter that specifies the root node from which to begin
218
- * the search for the last key.
219
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a recursive or iterative approach to search for the last key.
231
+ * The function `lastKey` returns the key of the rightmost node if the comparison result is less
232
+ * than, the key of the leftmost node if the comparison result is greater than, and the key of the
233
+ * rightmost node otherwise.
234
+ * @param {N | null} beginRoot - The `beginRoot` parameter is the starting point for finding the last
235
+ * key in a binary tree. It represents the root node of the subtree from which the search for the
236
+ * last key should begin. If no specific `beginRoot` is provided, the search will start from the root
237
+ * of the entire binary
238
+ * @param iterationType - The `iterationType` parameter is used to specify the type of iteration to
239
+ * be performed when finding the last key. It determines whether the iteration should be performed in
240
+ * pre-order, in-order, or post-order.
241
+ * @returns the key of the rightmost node in the binary tree if the comparison result is less than,
242
+ * the key of the leftmost node if the comparison result is greater than, and the key of the
243
+ * rightmost node otherwise. If no node is found, it returns 0.
220
244
  */
221
245
  lastKey(beginRoot = this.root, iterationType = this.iterationType) {
222
246
  var _a, _b, _c, _d, _e, _f;
@@ -228,17 +252,25 @@ class BST extends binary_tree_1.BinaryTree {
228
252
  return (_f = (_e = this.getRightMost(beginRoot, iterationType)) === null || _e === void 0 ? void 0 : _e.key) !== null && _f !== void 0 ? _f : 0;
229
253
  }
230
254
  /**
231
- * The function `getNodes` returns an array of nodes in a binary tree that match a given property value.
232
- * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeKey` or an
233
- * `N` type. It represents the property of the binary tree node that you want to compare with.
234
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
235
- * specifies the property name to use for comparison. If not provided, it defaults to `'key'`.
236
- * @param {boolean} [onlyOne] - The `onlyOne` parameter is an optional boolean parameter that determines whether to
237
- * return only one node that matches the given `nodeProperty` or all nodes that match the `nodeProperty`. If `onlyOne`
238
- * is set to `true`, the function will return an array with only one node (if
239
- * @param beginRoot - The `beginRoot` parameter is an optional parameter that specifies the root node from which to
240
- * @param iterationType
241
- * @returns an array of nodes (type N).
255
+ * The function `getNodes` retrieves nodes from a binary tree based on a given node property or key,
256
+ * using either recursive or iterative traversal.
257
+ * @param {BinaryTreeNodeKey | N} nodeProperty - The `nodeProperty` parameter represents the property
258
+ * of the binary tree node that you want to search for. It can be either a `BinaryTreeNodeKey` or a
259
+ * generic type `N`.
260
+ * @param callback - The `callback` parameter is a function that takes a node as input and returns a
261
+ * value. This value is compared with the `nodeProperty` parameter to determine if the node should be
262
+ * included in the result. The default value for `callback` is `this._defaultCallbackByKey`, which is
263
+ * a
264
+ * @param [onlyOne=false] - A boolean value indicating whether to stop the traversal after finding
265
+ * the first node that matches the nodeProperty. If set to true, the function will return an array
266
+ * containing only that node. If set to false (default), the function will continue the traversal and
267
+ * return an array containing all nodes that match the node
268
+ * @param {N | null} beginRoot - The `beginRoot` parameter is the starting node for the traversal. It
269
+ * specifies the root node of the binary tree from which the traversal should begin. If `beginRoot`
270
+ * is `null`, an empty array will be returned.
271
+ * @param iterationType - The `iterationType` parameter determines the type of iteration used to
272
+ * traverse the binary tree. It can have one of the following values:
273
+ * @returns an array of nodes (N[]).
242
274
  */
243
275
  getNodes(nodeProperty, callback = this._defaultCallbackByKey, onlyOne = false, beginRoot = this.root, iterationType = this.iterationType) {
244
276
  if (!beginRoot)
@@ -297,13 +329,21 @@ class BST extends binary_tree_1.BinaryTree {
297
329
  }
298
330
  // --- start additional functions
299
331
  /**
300
- * The `lesserOrGreaterTraverse` function adds a delta value to the specified property of all nodes in a binary tree that
301
- * have a greater value than a given node.
302
- * @param callback - The `callback` parameter is a function that takes a node as a parameter and returns a value.
303
- * represents the node in the binary tree to which the delta value will be added.
304
- * @param lesserOrGreater - The `lesserOrGreater` parameter is an optional parameter that specifies whether the delta
305
- * @param targetNode - The `targetNode` parameter is an optional parameter that specifies the node in the binary tree
306
- * @param iterationType - The `iterationType` parameter is an optional parameter that specifies whether to use a
332
+ * The `lesserOrGreaterTraverse` function traverses a binary tree and applies a callback function to
333
+ * nodes that have a key value lesser or greater than a target key value.
334
+ * @param callback - The `callback` parameter is a function that will be called for each node that
335
+ * meets the condition specified by the `lesserOrGreater` parameter. It takes a node as an argument
336
+ * and returns a value.
337
+ * @param {CP} lesserOrGreater - The `lesserOrGreater` parameter is used to determine whether to
338
+ * traverse nodes that are lesser than, greater than, or equal to the `targetNode`. It can take one
339
+ * of the following values:
340
+ * @param {N | BinaryTreeNodeKey | null} targetNode - The `targetNode` parameter in the
341
+ * `lesserOrGreaterTraverse` function is used to specify the node from which the traversal should
342
+ * start. It can be either a reference to a specific node (`N`), the key of a node
343
+ * (`BinaryTreeNodeKey`), or `null` to
344
+ * @param iterationType - The `iterationType` parameter determines whether the traversal should be
345
+ * done recursively or iteratively. It can have two possible values:
346
+ * @returns The function `lesserOrGreaterTraverse` returns an array of `MapCallbackReturn<N>`.
307
347
  */
308
348
  lesserOrGreaterTraverse(callback = this._defaultCallbackByKey, lesserOrGreater = types_1.CP.lt, targetNode = this.root, iterationType = this.iterationType) {
309
349
  if (typeof targetNode === 'number')
@@ -356,9 +396,12 @@ class BST extends binary_tree_1.BinaryTree {
356
396
  * AVL Tree: AVL trees are well-suited for scenarios involving frequent searching, insertion, and deletion operations. Through rotation adjustments, AVL trees maintain their balance, ensuring average and worst-case time complexity of O(log n).
357
397
  */
358
398
  /**
359
- * The `perfectlyBalance` function takes a binary tree, performs a depth-first search to sort the nodes, and then
360
- * constructs a balanced binary search tree using either a recursive or iterative approach.
361
- * @returns The function `perfectlyBalance()` returns a boolean value.
399
+ * The `perfectlyBalance` function balances a binary search tree by adding nodes in a way that
400
+ * ensures the tree is perfectly balanced.
401
+ * @param iterationType - The `iterationType` parameter is an optional parameter that specifies the
402
+ * type of iteration to use when building a balanced binary search tree. It can have two possible
403
+ * values:
404
+ * @returns The function `perfectlyBalance` returns a boolean value.
362
405
  */
363
406
  perfectlyBalance(iterationType = this.iterationType) {
364
407
  const sorted = this.dfs(node => node, 'in'), n = sorted.length;
@@ -397,7 +440,9 @@ class BST extends binary_tree_1.BinaryTree {
397
440
  }
398
441
  }
399
442
  /**
400
- * The function `isAVLBalanced` checks if a binary tree is balanced according to the AVL tree property.
443
+ * The function checks if a binary tree is AVL balanced using either recursive or iterative approach.
444
+ * @param iterationType - The `iterationType` parameter is used to determine the method of iteration
445
+ * to check if the AVL tree is balanced. It can have two possible values:
401
446
  * @returns a boolean value.
402
447
  */
403
448
  isAVLBalanced(iterationType = this.iterationType) {
@@ -447,12 +492,12 @@ class BST extends binary_tree_1.BinaryTree {
447
492
  return balanced;
448
493
  }
449
494
  /**
450
- * The function compares two binary tree node IDs using a comparator function and returns whether the first ID is
451
- * greater than, less than, or equal to the second ID.
452
- * @param {BinaryTreeNodeKey} a - "a" is a BinaryTreeNodeKey, which represents the identifier of a binary tree node.
453
- * @param {BinaryTreeNodeKey} b - The parameter "b" in the above code refers to a BinaryTreeNodeKey.
454
- * @returns a value of type CP (ComparisonResult). The possible return values are CP.gt (greater than), CP.lt (less
455
- * than), or CP.eq (equal).
495
+ * The function compares two values using a comparator function and returns whether the first value
496
+ * is greater than, less than, or equal to the second value.
497
+ * @param {BinaryTreeNodeKey} a - The parameter "a" is of type BinaryTreeNodeKey.
498
+ * @param {BinaryTreeNodeKey} b - The parameter "b" in the above code represents a BinaryTreeNodeKey.
499
+ * @returns a value of type CP (ComparisonResult). The possible return values are CP.gt (greater
500
+ * than), CP.lt (less than), or CP.eq (equal).
456
501
  */
457
502
  _compare(a, b) {
458
503
  const compared = this._comparator(a, b);