data-structure-typed 1.19.6 → 1.19.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 (43) hide show
  1. package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +41 -58
  2. package/dist/data-structures/binary-tree/abstract-binary-tree.js +107 -145
  3. package/dist/data-structures/binary-tree/avl-tree.d.ts +1 -0
  4. package/dist/data-structures/binary-tree/avl-tree.js +4 -0
  5. package/dist/data-structures/binary-tree/binary-tree.d.ts +2 -1
  6. package/dist/data-structures/binary-tree/binary-tree.js +3 -0
  7. package/dist/data-structures/binary-tree/bst.d.ts +1 -0
  8. package/dist/data-structures/binary-tree/bst.js +4 -0
  9. package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -1
  10. package/dist/data-structures/binary-tree/rb-tree.js +2 -3
  11. package/dist/data-structures/binary-tree/tree-multiset.d.ts +22 -16
  12. package/dist/data-structures/binary-tree/tree-multiset.js +138 -122
  13. package/dist/data-structures/interfaces/abstract-binary-tree.d.ts +6 -9
  14. package/dist/data-structures/types/abstract-binary-tree.d.ts +1 -2
  15. package/dist/data-structures/types/tree-multiset.d.ts +2 -2
  16. package/package.json +22 -5
  17. package/src/data-structures/binary-tree/abstract-binary-tree.ts +112 -161
  18. package/src/data-structures/binary-tree/avl-tree.ts +4 -0
  19. package/src/data-structures/binary-tree/binary-tree.ts +4 -2
  20. package/src/data-structures/binary-tree/bst.ts +4 -1
  21. package/src/data-structures/binary-tree/rb-tree.ts +3 -3
  22. package/src/data-structures/binary-tree/tree-multiset.ts +136 -118
  23. package/src/data-structures/interfaces/abstract-binary-tree.ts +6 -43
  24. package/src/data-structures/types/abstract-binary-tree.ts +1 -2
  25. package/src/data-structures/types/tree-multiset.ts +2 -2
  26. package/tsconfig.json +1 -2
  27. package/src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif +0 -0
  28. package/src/data-structures/binary-tree/diagrams/bst-rotation.gif +0 -0
  29. package/src/data-structures/binary-tree/diagrams/segment-tree.png +0 -0
  30. package/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
  31. package/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
  32. package/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
  33. package/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
  34. package/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
  35. package/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
  36. package/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
  37. package/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
  38. package/src/data-structures/graph/diagrams/mst.jpg +0 -0
  39. package/src/data-structures/graph/diagrams/tarjan-articulation-point-bridge.png +0 -0
  40. package/src/data-structures/graph/diagrams/tarjan-complicate-simple.png +0 -0
  41. package/src/data-structures/graph/diagrams/tarjan-strongly-connected-component.png +0 -0
  42. package/src/data-structures/graph/diagrams/tarjan.mp4 +0 -0
  43. package/src/data-structures/graph/diagrams/tarjan.webp +0 -0
@@ -9,7 +9,6 @@ import type {BinaryTreeNodeId, TreeMultisetNodeNested, TreeMultisetOptions} from
9
9
  import {BinaryTreeDeletedResult, CP, DFSOrderPattern, FamilyPosition, LoopType, NodeOrPropertyName} from '../types';
10
10
  import {ITreeMultiset, ITreeMultisetNode} from '../interfaces';
11
11
  import {AVLTree, AVLTreeNode} from './avl-tree';
12
- import {ObjectWithNumberId} from '../../utils';
13
12
 
14
13
  export class TreeMultisetNode<T = any, NEIGHBOR extends TreeMultisetNode<T, NEIGHBOR> = TreeMultisetNodeNested<T>> extends AVLTreeNode<T, NEIGHBOR> implements ITreeMultisetNode<T, NEIGHBOR> {
15
14
 
@@ -28,7 +27,7 @@ export class TreeMultisetNode<T = any, NEIGHBOR extends TreeMultisetNode<T, NEIG
28
27
  this._count = count;
29
28
  }
30
29
 
31
- private _count = 1;
30
+ private _count: number;
32
31
 
33
32
  get count(): number {
34
33
  return this._count;
@@ -51,7 +50,7 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
51
50
  * TreeMultiset.
52
51
  */
53
52
  constructor(options?: TreeMultisetOptions) {
54
- super({...options, isMergeDuplicatedVal: true});
53
+ super({...options, isMergeDuplicatedNodeById: true});
55
54
  }
56
55
 
57
56
  private _count = 0;
@@ -81,95 +80,93 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
81
80
  * @returns the `destNode` after swapping its values with the `srcNode`.
82
81
  */
83
82
  override swapLocation(srcNode: N, destNode: N): N {
84
- const {val, count, height, id} = destNode;
83
+ const {id, val, count, height} = destNode;
85
84
  const tempNode = this.createNode(id, val, count);
86
85
  if (tempNode) {
87
86
  tempNode.height = height;
88
87
 
89
- if (tempNode instanceof TreeMultisetNode) {
90
- destNode.id = srcNode.id;
91
- destNode.val = srcNode.val;
92
- destNode.count = srcNode.count;
93
- destNode.height = srcNode.height;
88
+ destNode.id = srcNode.id;
89
+ destNode.val = srcNode.val;
90
+ destNode.count = srcNode.count;
91
+ destNode.height = srcNode.height;
94
92
 
95
- srcNode.id = tempNode.id;
96
- srcNode.val = tempNode.val;
97
- srcNode.count = tempNode.count;
98
- srcNode.height = tempNode.height;
99
- }
93
+ srcNode.id = tempNode.id;
94
+ srcNode.val = tempNode.val;
95
+ srcNode.count = tempNode.count;
96
+ srcNode.height = tempNode.height;
100
97
  }
101
98
 
102
99
  return destNode;
103
100
  }
104
101
 
105
102
  /**
106
- * The `add` function adds a new node to a binary tree, updating the size and count properties accordingly, and
107
- * balancing the tree if necessary.
108
- * @param {BinaryTreeNodeId} id - The id parameter represents the identifier of the binary tree node that we want to
109
- * add. It is of type BinaryTreeNodeId.
110
- * @param [val] - The `val` parameter is an optional value that can be assigned to the node being added. If no value is
111
- * provided, it will default to `undefined`.
112
- * @param {number} [count] - The `count` parameter is an optional parameter that specifies the number of times the node
113
- * with the given `id` should be added to the binary tree. If the `count` parameter is not provided, it defaults to 1.
114
- * @returns The `add` method returns the inserted node (`N`), `null`, or `undefined`.
103
+ * The `add` function adds a new node to a binary search tree, maintaining the tree's properties and balancing if
104
+ * necessary.
105
+ * @param {BinaryTreeNodeId | N} idOrNode - The `idOrNode` parameter can be either a `BinaryTreeNodeId` or a `N` (which
106
+ * represents a `BinaryTreeNode`).
107
+ * @param [val] - The `val` parameter represents the value to be added to the binary tree node.
108
+ * @param {number} [count] - The `count` parameter is an optional parameter that specifies the number of times the
109
+ * value should be added to the binary tree. If the `count` parameter is not provided, it defaults to 1.
110
+ * @returns The method `add` returns either the inserted node (`N`), `null`, or `undefined`.
115
111
  */
116
- override add(id: BinaryTreeNodeId, val?: N['val'], count?: number): N | null | undefined {
112
+ override add(idOrNode: BinaryTreeNodeId | N | null, val?: N['val'], count?: number): N | null | undefined {
117
113
  count = count ?? 1;
118
- let inserted: N | null = null;
119
- const newNode = this.createNode(id, val, count);
120
- if (this.root === null) {
114
+ let inserted: N | null | undefined = undefined, newNode: N | null;
115
+ if (idOrNode instanceof TreeMultisetNode) {
116
+ newNode = this.createNode(idOrNode.id, idOrNode.val, idOrNode.count);
117
+ } else if (idOrNode === null) {
118
+ newNode = null;
119
+ } else {
120
+ newNode = this.createNode(idOrNode, val, count);
121
+ }
122
+ if (!this.root) {
121
123
  this._setRoot(newNode);
122
124
  this._setSize(this.size + 1);
123
- this._setCount(this.count + count);
124
- inserted = (this.root);
125
+ newNode && this._setCount(this.count + newNode.count);
126
+ inserted = this.root;
125
127
  } else {
126
128
  let cur = this.root;
127
129
  let traversing = true;
128
130
  while (traversing) {
129
- if (cur !== null && newNode !== null) {
130
- if (this._compare(cur.id, id) === CP.eq) {
131
- if (newNode) {
131
+ if (cur) {
132
+ if (newNode) {
133
+ if (this._compare(cur.id, newNode.id) === CP.eq) {
132
134
  cur.val = newNode.val;
133
- cur.count += count;
135
+ cur.count += newNode.count;
134
136
  this._setCount(this.count + newNode.count);
135
- }
136
- //Duplicates are not accepted.
137
- traversing = false;
138
- inserted = cur;
139
- } else if (this._compare(cur.id, id) === CP.gt) {
140
- // Traverse left of the node
141
- if (cur.left === undefined) {
142
- if (newNode) {
143
- newNode.parent = cur;
144
- }
145
- //Add to the left of the current node
146
- cur.left = newNode;
147
- this._setSize(this.size + 1);
148
- this._setCount(this.count + newNode.count);
149
-
150
137
  traversing = false;
151
- inserted = cur.left;
152
- } else {
153
- //Traverse the left of the current node
154
- if (cur.left) cur = cur.left;
155
- }
156
- } else if (this._compare(cur.id, id) === CP.lt) {
157
- // Traverse right of the node
158
- if (cur.right === undefined) {
159
- if (newNode) {
160
- newNode.parent = cur;
138
+ inserted = cur;
139
+ } else if (this._compare(cur.id, newNode.id) === CP.gt) {
140
+ // Traverse left of the node
141
+ if (cur.left === undefined) {
142
+ //Add to the left of the current node
143
+ cur.left = newNode;
144
+ this._setSize(this.size + 1);
145
+ this._setCount(this.count + newNode.count);
146
+
147
+ traversing = false;
148
+ inserted = cur.left;
149
+ } else {
150
+ //Traverse the left of the current node
151
+ if (cur.left) cur = cur.left;
152
+ }
153
+ } else if (this._compare(cur.id, newNode.id) === CP.lt) {
154
+ // Traverse right of the node
155
+ if (cur.right === undefined) {
156
+ //Add to the right of the current node
157
+ cur.right = newNode;
158
+ this._setSize(this.size + 1);
159
+ this._setCount(this.count + newNode.count);
160
+
161
+ traversing = false;
162
+ inserted = (cur.right);
163
+ } else {
164
+ //Traverse the left of the current node
165
+ if (cur.right) cur = cur.right;
161
166
  }
162
- //Add to the right of the current node
163
- cur.right = newNode;
164
- this._setSize(this.size + 1);
165
- this._setCount(this.count + newNode.count);
166
-
167
- traversing = false;
168
- inserted = (cur.right);
169
- } else {
170
- //Traverse the left of the current node
171
- if (cur.right) cur = cur.right;
172
167
  }
168
+ } else {
169
+ // TODO may need to support null inserted
173
170
  }
174
171
  } else {
175
172
  traversing = false;
@@ -192,24 +189,19 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
192
189
  override addTo(newNode: N | null, parent: N): N | null | undefined {
193
190
  if (parent) {
194
191
  if (parent.left === undefined) {
195
- if (newNode) {
196
- newNode.parent = parent;
197
- }
198
192
  parent.left = newNode;
199
193
  if (newNode !== null) {
200
194
  this._setSize(this.size + 1);
201
- this._setCount(this.count + newNode.count ?? 0)
195
+ this._setCount(this.count + newNode.count)
202
196
  }
203
197
 
204
198
  return parent.left;
205
199
  } else if (parent.right === undefined) {
206
- if (newNode) {
207
- newNode.parent = parent;
208
- }
200
+
209
201
  parent.right = newNode;
210
202
  if (newNode !== null) {
211
203
  this._setSize(this.size + 1);
212
- this._setCount(this.count + newNode.count ?? 0);
204
+ this._setCount(this.count + newNode.count);
213
205
  }
214
206
  return parent.right;
215
207
  } else {
@@ -221,66 +213,88 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
221
213
  }
222
214
 
223
215
  /**
224
- * The `addMany` function inserts multiple items into a binary tree and returns an array of the inserted nodes or
225
- * null/undefined values.
226
- * @param {N[] | N[]} data - The `data` parameter can be either an array of elements of type `N` or an
227
- * array of `N` objects.
216
+ * The `addMany` function adds multiple nodes to a binary tree and returns an array of the inserted nodes.
217
+ * @param {BinaryTreeNodeId[] | N[]} idsOrNodes - An array of BinaryTreeNodeId objects or N objects. These objects
218
+ * represent the IDs or nodes of the binary tree where the values will be added.
219
+ * @param {N['val'][]} [data] - Optional array of values to be associated with each node being added. If provided, the
220
+ * length of the `data` array should be equal to the length of the `idsOrNodes` array.
228
221
  * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
229
222
  */
230
- override addMany(data: N[] | Array<N['val']>): (N | null | undefined)[] {
223
+ override addMany(idsOrNodes: (BinaryTreeNodeId | N)[], data?: N['val'][]): (N | null | undefined)[] {
231
224
  // TODO not sure addMany not be run multi times
232
225
  const inserted: (N | null | undefined)[] = [];
233
- const map: Map<N | N['val'], number> = new Map();
226
+ const map: Map<N | BinaryTreeNodeId, number> = new Map();
234
227
 
235
- if (this.isMergeDuplicatedVal) {
236
- for (const nodeOrId of data) map.set(nodeOrId, (map.get(nodeOrId) ?? 0) + 1);
228
+ if (this.isMergeDuplicatedNodeById) {
229
+ for (const idOrNode of idsOrNodes) map.set(idOrNode, (map.get(idOrNode) ?? 0) + 1);
237
230
  }
238
231
 
239
- for (const nodeOrId of data) {
240
-
241
- if (nodeOrId instanceof TreeMultisetNode) {
242
- inserted.push(this.add(nodeOrId.id, nodeOrId.val, nodeOrId.count));
232
+ for (let i = 0; i < idsOrNodes.length; i++) {
233
+ const idOrNode = idsOrNodes[i];
234
+ if (idOrNode instanceof TreeMultisetNode) {
235
+ inserted.push(this.add(idOrNode.id, idOrNode.val, idOrNode.count));
243
236
  continue;
244
237
  }
245
238
 
246
- if (nodeOrId === null) {
239
+ if (idOrNode === null) {
247
240
  inserted.push(this.add(NaN, null, 0));
248
241
  continue;
249
242
  }
250
243
 
251
- // TODO will this cause an issue?
252
- const count = this.isMergeDuplicatedVal ? map.get(nodeOrId) : 1;
253
- let newId: BinaryTreeNodeId;
254
- if (typeof nodeOrId === 'number') {
255
- newId = this.autoIncrementId ? this.maxId + 1 : nodeOrId;
256
- } else if (nodeOrId instanceof Object) {
257
- if (this.autoIncrementId) {
258
- newId = this.maxId + 1;
259
- } else {
260
- if (Object.keys(nodeOrId).includes('id')) {
261
- newId = (nodeOrId as ObjectWithNumberId).id;
262
- } else {
263
- console.warn(nodeOrId, 'Object value must has an id property when the autoIncrementId is false');
264
- continue;
265
- }
244
+ const count = this.isMergeDuplicatedNodeById ? map.get(idOrNode) : 1;
245
+ const val = data?.[i];
246
+ if (this.isMergeDuplicatedNodeById) {
247
+ if (map.has(idOrNode)) {
248
+ inserted.push(this.add(idOrNode, val, count));
249
+ map.delete(idOrNode);
266
250
  }
267
251
  } else {
268
- console.warn(nodeOrId, ` is not added`);
269
- continue;
252
+ inserted.push(this.add(idOrNode, val, 1));
270
253
  }
254
+ }
255
+ return inserted;
256
+ }
257
+
258
+ /**
259
+ * The `perfectlyBalance` function takes a binary tree, performs a depth-first search to sort the nodes, and then
260
+ * constructs a balanced binary search tree using either a recursive or iterative approach.
261
+ * @returns The function `perfectlyBalance()` returns a boolean value.
262
+ */
263
+ override perfectlyBalance(): boolean {
264
+ const sorted = this.DFS('in', 'node'), n = sorted.length;
265
+ if (sorted.length < 1) return false;
266
+
267
+ this.clear();
268
+
269
+ if (this.loopType === LoopType.RECURSIVE) {
270
+ const buildBalanceBST = (l: number, r: number) => {
271
+ if (l > r) return;
272
+ const m = l + Math.floor((r - l) / 2);
273
+ const midNode = sorted[m];
274
+ this.add(midNode.id, midNode.val, midNode.count);
275
+ buildBalanceBST(l, m - 1);
276
+ buildBalanceBST(m + 1, r);
277
+ };
271
278
 
272
- if (this.isMergeDuplicatedVal) {
273
- if (map.has(nodeOrId)) {
274
- inserted.push(this.add(newId, nodeOrId, count));
275
- map.delete(nodeOrId);
279
+ buildBalanceBST(0, n - 1);
280
+ return true;
281
+ } else {
282
+ const stack: [[number, number]] = [[0, n - 1]];
283
+ while (stack.length > 0) {
284
+ const popped = stack.pop();
285
+ if (popped) {
286
+ const [l, r] = popped;
287
+ if (l <= r) {
288
+ const m = l + Math.floor((r - l) / 2);
289
+ const midNode = sorted[m];
290
+ this.add(midNode.id, midNode.val, midNode.count);
291
+ stack.push([m + 1, r]);
292
+ stack.push([l, m - 1]);
293
+ }
276
294
  }
277
- } else {
278
- inserted.push(this.add(newId, nodeOrId, 1));
279
295
  }
280
-
281
- this._setMaxId(newId);
296
+ return true;
282
297
  }
283
- return inserted;
284
298
  }
285
299
 
286
300
  /**
@@ -296,7 +310,7 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
296
310
  const bstDeletedResult: BinaryTreeDeletedResult<N>[] = [];
297
311
  if (!this.root) return bstDeletedResult;
298
312
 
299
- const curr: N | null = (typeof nodeOrId === 'number') ? this.get(nodeOrId) : nodeOrId;
313
+ const curr: N | null = this.get(nodeOrId);
300
314
  if (!curr) return bstDeletedResult;
301
315
 
302
316
  const parent: N | null = curr?.parent ? curr.parent : null;
@@ -324,13 +338,17 @@ export class TreeMultiset<N extends TreeMultisetNode<N['val'], N> = TreeMultiset
324
338
  const parentOfLeftSubTreeMax = leftSubTreeRightMost.parent;
325
339
  orgCurrent = this.swapLocation(curr, leftSubTreeRightMost);
326
340
  if (parentOfLeftSubTreeMax) {
327
- if (parentOfLeftSubTreeMax.right === leftSubTreeRightMost) parentOfLeftSubTreeMax.right = leftSubTreeRightMost.left;
328
- else parentOfLeftSubTreeMax.left = leftSubTreeRightMost.left;
341
+ if (parentOfLeftSubTreeMax.right === leftSubTreeRightMost) {
342
+ parentOfLeftSubTreeMax.right = leftSubTreeRightMost.left;
343
+ } else {
344
+ parentOfLeftSubTreeMax.left = leftSubTreeRightMost.left;
345
+ }
329
346
  needBalanced = parentOfLeftSubTreeMax;
330
347
  }
331
348
  }
332
349
  }
333
350
  this._setSize(this.size - 1);
351
+ // TODO How to handle when the count of target node is lesser than current node's count
334
352
  this._setCount(this.count - orgCurrent.count);
335
353
  }
336
354
 
@@ -51,15 +51,9 @@ export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'],
51
51
 
52
52
  get visitedNode(): N[]
53
53
 
54
- get visitedCount(): number[]
55
-
56
54
  get visitedLeftSum(): number[]
57
55
 
58
- get autoIncrementId(): boolean
59
-
60
- get maxId(): number
61
-
62
- get isMergeDuplicatedVal(): boolean
56
+ get isMergeDuplicatedNodeById(): boolean
63
57
 
64
58
  get root(): N | null
65
59
 
@@ -71,13 +65,13 @@ export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'],
71
65
 
72
66
  isEmpty(): boolean
73
67
 
74
- add(id: BinaryTreeNodeId, val?: N['val'], count?: number): N | null | undefined
68
+ add(id: BinaryTreeNodeId | N, val?: N['val']): N | null | undefined
75
69
 
76
70
  addTo(newNode: N | null, parent: N): N | null | undefined
77
71
 
78
- addMany(data: N[] | Array<N['val']>): (N | null | undefined)[]
72
+ addMany(idsOrNodes: (BinaryTreeNodeId | N | null)[], data?: N['val'][]): (N | null | undefined)[]
79
73
 
80
- fill(data: N[] | Array<N['val']>): boolean
74
+ fill(idsOrNodes: (BinaryTreeNodeId | N | null)[], data?: N[] | Array<N['val']>): boolean
81
75
 
82
76
  remove(id: BinaryTreeNodeId, ignoreCount?: boolean): BinaryTreeDeletedResult<N>[]
83
77
 
@@ -109,9 +103,9 @@ export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'],
109
103
 
110
104
  getRightMost(node?: N | null): N | null
111
105
 
112
- isBSTByRooted(node: N | null): boolean
106
+ isSubtreeBST(node: N | null): boolean
113
107
 
114
- isBST(node?: N | null): boolean
108
+ isBST(): boolean
115
109
 
116
110
  getSubTreeSize(subTreeRoot: N | null | undefined): number
117
111
 
@@ -195,37 +189,6 @@ export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'],
195
189
 
196
190
  morris(pattern?: 'in' | 'pre' | 'post', nodeOrPropertyName?: NodeOrPropertyName): AbstractBinaryTreeNodeProperties<N>
197
191
 
198
- // _setLoopType(value: LoopType): void
199
- //
200
- // _setVisitedId(value: BinaryTreeNodeId[]): void
201
- //
202
- // _setVisitedVal(value: Array<N>): void
203
- //
204
- // _setVisitedNode(value: N[]): void
205
- //
206
- // setVisitedCount(value: number[]): void
207
- //
208
- // _setVisitedLeftSum(value: number[]): void
209
- //
210
- // _setAutoIncrementId(value: boolean): void
211
- //
212
- // _setMaxId(value: number): void
213
- //
214
- // _setIsDuplicatedVal(value: boolean): void
215
- //
216
- // _setRoot(v: N | null): void
217
- //
218
- // _setSize(v: number): void
219
- //
220
- // _setCount(v: number): void
221
- //
222
- // _resetResults(): void
223
-
224
- // _pushByPropertyNameStopOrNot(cur: N, result: (N | null | undefined)[], nodeProperty: BinaryTreeNodeId | N, propertyName ?: BinaryTreeNodePropertyName, onlyOne ?: boolean): void
225
- //
226
- // _accumulatedByPropertyName(node: N, nodeOrPropertyName ?: NodeOrPropertyName): void
227
- //
228
- // _getResultByPropertyName(nodeOrPropertyName ?: NodeOrPropertyName): AbstractBinaryTreeNodeProperties<N>
229
192
 
230
193
  // --- end additional methods ---
231
194
  }
@@ -37,6 +37,5 @@ export type AbstractBinaryTreeNodeNested<T> = AbstractBinaryTreeNode<T, Abstract
37
37
 
38
38
  export type AbstractBinaryTreeOptions = {
39
39
  loopType?: LoopType,
40
- autoIncrementId?: boolean,
41
- isMergeDuplicatedVal?: boolean
40
+ isMergeDuplicatedNodeById?: boolean
42
41
  }
@@ -3,6 +3,6 @@ import {AVLTreeOptions} from './avl-tree';
3
3
 
4
4
  export type TreeMultisetNodeNested<T> = TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
5
5
 
6
- export type TreeMultisetOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedVal'> & {
7
- isMergeDuplicatedVal: true,
6
+ export type TreeMultisetOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedNodeById'> & {
7
+ isMergeDuplicatedNodeById: true,
8
8
  }
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "module": "commonjs",
6
6
  "target": "es6",
7
7
  "lib": [
8
- // "es2015",
9
8
  "esnext"
10
9
  ],
11
10
  "strict": true,
@@ -31,7 +30,7 @@
31
30
  "src",
32
31
  ],
33
32
  "exclude": [
34
- // "node_modules/data-structure-typed",
33
+ // "node_modules/data-structure-typed",
35
34
  "node_modules",
36
35
  "dist"
37
36
  ]