data-structure-typed 1.48.2 → 1.48.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 (90) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +22 -22
  3. package/benchmark/report.html +16 -16
  4. package/benchmark/report.json +184 -184
  5. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +16 -16
  6. package/dist/cjs/data-structures/binary-tree/avl-tree.js +7 -7
  7. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  8. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +89 -87
  9. package/dist/cjs/data-structures/binary-tree/binary-tree.js +67 -58
  10. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  11. package/dist/cjs/data-structures/binary-tree/bst.d.ts +28 -47
  12. package/dist/cjs/data-structures/binary-tree/bst.js +54 -57
  13. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  14. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +15 -15
  15. package/dist/cjs/data-structures/binary-tree/rb-tree.js +7 -7
  16. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
  17. package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +22 -22
  18. package/dist/cjs/data-structures/binary-tree/tree-multimap.js +11 -11
  19. package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
  20. package/dist/cjs/data-structures/graph/abstract-graph.d.ts +1 -0
  21. package/dist/cjs/data-structures/graph/abstract-graph.js +4 -0
  22. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
  23. package/dist/cjs/data-structures/graph/directed-graph.d.ts +25 -7
  24. package/dist/cjs/data-structures/graph/directed-graph.js +58 -12
  25. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
  26. package/dist/cjs/data-structures/graph/undirected-graph.d.ts +25 -6
  27. package/dist/cjs/data-structures/graph/undirected-graph.js +70 -7
  28. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
  29. package/dist/cjs/interfaces/binary-tree.d.ts +6 -6
  30. package/dist/cjs/types/common.d.ts +11 -8
  31. package/dist/cjs/types/common.js +6 -1
  32. package/dist/cjs/types/common.js.map +1 -1
  33. package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +3 -3
  34. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +4 -4
  35. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +6 -6
  36. package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +3 -3
  37. package/dist/cjs/types/data-structures/binary-tree/tree-multimap.d.ts +3 -3
  38. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +16 -16
  39. package/dist/mjs/data-structures/binary-tree/avl-tree.js +7 -7
  40. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +89 -87
  41. package/dist/mjs/data-structures/binary-tree/binary-tree.js +67 -58
  42. package/dist/mjs/data-structures/binary-tree/bst.d.ts +28 -47
  43. package/dist/mjs/data-structures/binary-tree/bst.js +55 -57
  44. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +15 -15
  45. package/dist/mjs/data-structures/binary-tree/rb-tree.js +7 -7
  46. package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +22 -22
  47. package/dist/mjs/data-structures/binary-tree/tree-multimap.js +11 -11
  48. package/dist/mjs/data-structures/graph/abstract-graph.d.ts +1 -0
  49. package/dist/mjs/data-structures/graph/abstract-graph.js +4 -0
  50. package/dist/mjs/data-structures/graph/directed-graph.d.ts +25 -7
  51. package/dist/mjs/data-structures/graph/directed-graph.js +58 -12
  52. package/dist/mjs/data-structures/graph/undirected-graph.d.ts +25 -6
  53. package/dist/mjs/data-structures/graph/undirected-graph.js +70 -7
  54. package/dist/mjs/interfaces/binary-tree.d.ts +6 -6
  55. package/dist/mjs/types/common.d.ts +11 -8
  56. package/dist/mjs/types/common.js +5 -0
  57. package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +3 -3
  58. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +4 -4
  59. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +6 -6
  60. package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +3 -3
  61. package/dist/mjs/types/data-structures/binary-tree/tree-multimap.d.ts +3 -3
  62. package/dist/umd/data-structure-typed.js +276 -158
  63. package/dist/umd/data-structure-typed.min.js +2 -2
  64. package/dist/umd/data-structure-typed.min.js.map +1 -1
  65. package/package.json +2 -2
  66. package/src/data-structures/binary-tree/avl-tree.ts +20 -21
  67. package/src/data-structures/binary-tree/binary-tree.ts +147 -136
  68. package/src/data-structures/binary-tree/bst.ts +86 -82
  69. package/src/data-structures/binary-tree/rb-tree.ts +25 -26
  70. package/src/data-structures/binary-tree/tree-multimap.ts +30 -35
  71. package/src/data-structures/graph/abstract-graph.ts +5 -0
  72. package/src/data-structures/graph/directed-graph.ts +61 -12
  73. package/src/data-structures/graph/undirected-graph.ts +75 -7
  74. package/src/interfaces/binary-tree.ts +5 -6
  75. package/src/types/common.ts +11 -8
  76. package/src/types/data-structures/binary-tree/avl-tree.ts +3 -3
  77. package/src/types/data-structures/binary-tree/binary-tree.ts +6 -5
  78. package/src/types/data-structures/binary-tree/bst.ts +6 -6
  79. package/src/types/data-structures/binary-tree/rb-tree.ts +3 -3
  80. package/src/types/data-structures/binary-tree/tree-multimap.ts +3 -3
  81. package/test/integration/bst.test.ts +1 -1
  82. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +3 -3
  83. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +6 -6
  84. package/test/unit/data-structures/binary-tree/bst.test.ts +10 -9
  85. package/test/unit/data-structures/binary-tree/overall.test.ts +1 -1
  86. package/test/unit/data-structures/binary-tree/rb-tree.test.ts +1 -1
  87. package/test/unit/data-structures/binary-tree/tree-multimap.test.ts +5 -5
  88. package/test/unit/data-structures/graph/directed-graph.test.ts +37 -0
  89. package/test/unit/data-structures/graph/undirected-graph.test.ts +37 -0
  90. package/test/unit/unrestricted-interconversion.test.ts +1 -1
@@ -96,19 +96,37 @@ export declare class DirectedGraph<V = any, E = any, VO extends DirectedVertex<V
96
96
  */
97
97
  deleteEdgeSrcToDest(srcOrKey: VO | VertexKey, destOrKey: VO | VertexKey): EO | undefined;
98
98
  /**
99
- * Time Complexity: O(|E|) where |E| is the number of edges
99
+ * Time Complexity: O(E) where E is the number of edges
100
100
  * Space Complexity: O(1)
101
101
  */
102
102
  /**
103
- * Time Complexity: O(|E|) where |E| is the number of edges
103
+ * Time Complexity: O(E) where E is the number of edges
104
104
  * Space Complexity: O(1)
105
105
  *
106
- * The function removes an edge from a graph and returns the removed edge, or undefined if the edge was not found.
107
- * @param {EO} edge - The `edge` parameter is an object that represents an edge in a graph. It has two properties: `src`
108
- * and `dest`, which represent the source and destination vertices of the edge, respectively.
109
- * @returns The method `deleteEdge` returns the removed edge (`EO`) if it exists, or `undefined` if the edge does not exist.
106
+ * The `deleteEdge` function removes an edge from a graph and returns the removed edge.
107
+ * @param {EO | VertexKey} edgeOrSrcVertexKey - The `edge` parameter can be either an `EO` object (edge object) or
108
+ * a `VertexKey` (key of a vertex).
109
+ * @param {VertexKey} [destVertexKey] - The `destVertexKey` parameter is an optional parameter that
110
+ * represents the key of the destination vertex of the edge. It is used to specify the destination
111
+ * vertex when the `edge` parameter is a vertex key. If `destVertexKey` is not provided, the function
112
+ * assumes that the `edge`
113
+ * @returns the removed edge (EO) or undefined if no edge was removed.
114
+ */
115
+ deleteEdge(edgeOrSrcVertexKey: EO | VertexKey, destVertexKey?: VertexKey): EO | undefined;
116
+ /**
117
+ * Time Complexity: O(1) - Constant time for Map operations.
118
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
119
+ */
120
+ /**
121
+ * Time Complexity: O(1) - Constant time for Map operations.
122
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
123
+ *
124
+ * The `deleteVertex` function removes a vertex from a graph by its ID or by the vertex object itself.
125
+ * @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
126
+ * (`VertexKey`).
127
+ * @returns The method is returning a boolean value.
110
128
  */
111
- deleteEdge(edge: EO): EO | undefined;
129
+ deleteVertex(vertexOrKey: VO | VertexKey): boolean;
112
130
  /**
113
131
  * Time Complexity: O(|E|) where |E| is the number of edges
114
132
  * Space Complexity: O(1)
@@ -147,34 +147,80 @@ export class DirectedGraph extends AbstractGraph {
147
147
  return removed;
148
148
  }
149
149
  /**
150
- * Time Complexity: O(|E|) where |E| is the number of edges
150
+ * Time Complexity: O(E) where E is the number of edges
151
151
  * Space Complexity: O(1)
152
152
  */
153
153
  /**
154
- * Time Complexity: O(|E|) where |E| is the number of edges
154
+ * Time Complexity: O(E) where E is the number of edges
155
155
  * Space Complexity: O(1)
156
156
  *
157
- * The function removes an edge from a graph and returns the removed edge, or undefined if the edge was not found.
158
- * @param {EO} edge - The `edge` parameter is an object that represents an edge in a graph. It has two properties: `src`
159
- * and `dest`, which represent the source and destination vertices of the edge, respectively.
160
- * @returns The method `deleteEdge` returns the removed edge (`EO`) if it exists, or `undefined` if the edge does not exist.
161
- */
162
- deleteEdge(edge) {
157
+ * The `deleteEdge` function removes an edge from a graph and returns the removed edge.
158
+ * @param {EO | VertexKey} edgeOrSrcVertexKey - The `edge` parameter can be either an `EO` object (edge object) or
159
+ * a `VertexKey` (key of a vertex).
160
+ * @param {VertexKey} [destVertexKey] - The `destVertexKey` parameter is an optional parameter that
161
+ * represents the key of the destination vertex of the edge. It is used to specify the destination
162
+ * vertex when the `edge` parameter is a vertex key. If `destVertexKey` is not provided, the function
163
+ * assumes that the `edge`
164
+ * @returns the removed edge (EO) or undefined if no edge was removed.
165
+ */
166
+ deleteEdge(edgeOrSrcVertexKey, destVertexKey) {
163
167
  let removed = undefined;
164
- const src = this._getVertex(edge.src);
165
- const dest = this._getVertex(edge.dest);
168
+ let src, dest;
169
+ if (this.isVertexKey(edgeOrSrcVertexKey)) {
170
+ if (this.isVertexKey(destVertexKey)) {
171
+ src = this._getVertex(edgeOrSrcVertexKey);
172
+ dest = this._getVertex(destVertexKey);
173
+ }
174
+ else {
175
+ return;
176
+ }
177
+ }
178
+ else {
179
+ src = this._getVertex(edgeOrSrcVertexKey.src);
180
+ dest = this._getVertex(edgeOrSrcVertexKey.dest);
181
+ }
166
182
  if (src && dest) {
167
183
  const srcOutEdges = this._outEdgeMap.get(src);
168
184
  if (srcOutEdges && srcOutEdges.length > 0) {
169
- arrayRemove(srcOutEdges, (edge) => edge.src === src.key);
185
+ arrayRemove(srcOutEdges, (edge) => edge.src === src.key && edge.dest === dest?.key);
170
186
  }
171
187
  const destInEdges = this._inEdgeMap.get(dest);
172
188
  if (destInEdges && destInEdges.length > 0) {
173
- removed = arrayRemove(destInEdges, (edge) => edge.dest === dest.key)[0];
189
+ removed = arrayRemove(destInEdges, (edge) => edge.src === src.key && edge.dest === dest.key)[0];
174
190
  }
175
191
  }
176
192
  return removed;
177
193
  }
194
+ /**
195
+ * Time Complexity: O(1) - Constant time for Map operations.
196
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
197
+ */
198
+ /**
199
+ * Time Complexity: O(1) - Constant time for Map operations.
200
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
201
+ *
202
+ * The `deleteVertex` function removes a vertex from a graph by its ID or by the vertex object itself.
203
+ * @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
204
+ * (`VertexKey`).
205
+ * @returns The method is returning a boolean value.
206
+ */
207
+ deleteVertex(vertexOrKey) {
208
+ let vertexKey;
209
+ let vertex;
210
+ if (this.isVertexKey(vertexOrKey)) {
211
+ vertex = this.getVertex(vertexOrKey);
212
+ vertexKey = vertexOrKey;
213
+ }
214
+ else {
215
+ vertex = vertexOrKey;
216
+ vertexKey = this._getVertexKey(vertexOrKey);
217
+ }
218
+ if (vertex) {
219
+ this._outEdgeMap.delete(vertex);
220
+ this._inEdgeMap.delete(vertex);
221
+ }
222
+ return this._vertices.delete(vertexKey);
223
+ }
178
224
  /**
179
225
  * Time Complexity: O(|E|) where |E| is the number of edges
180
226
  * Space Complexity: O(1)
@@ -85,18 +85,37 @@ export declare class UndirectedGraph<V = any, E = any, VO extends UndirectedVert
85
85
  */
86
86
  deleteEdgeBetween(v1: VO | VertexKey, v2: VO | VertexKey): EO | undefined;
87
87
  /**
88
- * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
88
+ * Time Complexity: O(E), where E is the number of edges incident to the given vertex.
89
89
  * Space Complexity: O(1)
90
90
  */
91
91
  /**
92
- * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
92
+ * Time Complexity: O(E), where E is the number of edges incident to the given vertex.
93
93
  * Space Complexity: O(1)
94
94
  *
95
- * The deleteEdge function removes an edge between two vertices in a graph.
96
- * @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
97
- * @returns The method is returning either the removed edge (of type EO) or undefined if the edge was not found.
95
+ * The function `deleteEdge` deletes an edge between two vertices in a graph.
96
+ * @param {EO | VertexKey} edgeOrOneSideVertexKey - The parameter `edgeOrOneSideVertexKey` can be
97
+ * either an edge object or a vertex key.
98
+ * @param {VertexKey} [otherSideVertexKey] - The parameter `otherSideVertexKey` is an optional
99
+ * parameter that represents the key of the vertex on the other side of the edge. It is used when the
100
+ * `edgeOrOneSideVertexKey` parameter is a vertex key, and it specifies the key of the vertex on the
101
+ * other side of the
102
+ * @returns The `deleteEdge` function returns either the deleted edge object (EO) or `undefined`.
103
+ */
104
+ deleteEdge(edgeOrOneSideVertexKey: EO | VertexKey, otherSideVertexKey?: VertexKey): EO | undefined;
105
+ /**
106
+ * Time Complexity: O(1) - Constant time for Map operations.
107
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
108
+ */
109
+ /**
110
+ * Time Complexity: O(1) - Constant time for Map operations.
111
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
112
+ *
113
+ * The `deleteVertex` function removes a vertex from a graph by its ID or by the vertex object itself.
114
+ * @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
115
+ * (`VertexKey`).
116
+ * @returns The method is returning a boolean value.
98
117
  */
99
- deleteEdge(edge: EO): EO | undefined;
118
+ deleteVertex(vertexOrKey: VO | VertexKey): boolean;
100
119
  /**
101
120
  * Time Complexity: O(1)
102
121
  * Space Complexity: O(1)
@@ -131,19 +131,82 @@ export class UndirectedGraph extends AbstractGraph {
131
131
  return removed;
132
132
  }
133
133
  /**
134
- * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
134
+ * Time Complexity: O(E), where E is the number of edges incident to the given vertex.
135
135
  * Space Complexity: O(1)
136
136
  */
137
137
  /**
138
- * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
138
+ * Time Complexity: O(E), where E is the number of edges incident to the given vertex.
139
139
  * Space Complexity: O(1)
140
140
  *
141
- * The deleteEdge function removes an edge between two vertices in a graph.
142
- * @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
143
- * @returns The method is returning either the removed edge (of type EO) or undefined if the edge was not found.
141
+ * The function `deleteEdge` deletes an edge between two vertices in a graph.
142
+ * @param {EO | VertexKey} edgeOrOneSideVertexKey - The parameter `edgeOrOneSideVertexKey` can be
143
+ * either an edge object or a vertex key.
144
+ * @param {VertexKey} [otherSideVertexKey] - The parameter `otherSideVertexKey` is an optional
145
+ * parameter that represents the key of the vertex on the other side of the edge. It is used when the
146
+ * `edgeOrOneSideVertexKey` parameter is a vertex key, and it specifies the key of the vertex on the
147
+ * other side of the
148
+ * @returns The `deleteEdge` function returns either the deleted edge object (EO) or `undefined`.
149
+ */
150
+ deleteEdge(edgeOrOneSideVertexKey, otherSideVertexKey) {
151
+ let oneSide, otherSide;
152
+ if (this.isVertexKey(edgeOrOneSideVertexKey)) {
153
+ if (this.isVertexKey(otherSideVertexKey)) {
154
+ oneSide = this._getVertex(edgeOrOneSideVertexKey);
155
+ otherSide = this._getVertex(otherSideVertexKey);
156
+ }
157
+ else {
158
+ return;
159
+ }
160
+ }
161
+ else {
162
+ oneSide = this._getVertex(edgeOrOneSideVertexKey.vertices[0]);
163
+ otherSide = this._getVertex(edgeOrOneSideVertexKey.vertices[1]);
164
+ }
165
+ if (oneSide && otherSide) {
166
+ return this.deleteEdgeBetween(oneSide, otherSide);
167
+ }
168
+ else {
169
+ return;
170
+ }
171
+ }
172
+ /**
173
+ * Time Complexity: O(1) - Constant time for Map operations.
174
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
144
175
  */
145
- deleteEdge(edge) {
146
- return this.deleteEdgeBetween(edge.vertices[0], edge.vertices[1]);
176
+ /**
177
+ * Time Complexity: O(1) - Constant time for Map operations.
178
+ * Space Complexity: O(1) - Constant space, as it creates only a few variables.
179
+ *
180
+ * The `deleteVertex` function removes a vertex from a graph by its ID or by the vertex object itself.
181
+ * @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
182
+ * (`VertexKey`).
183
+ * @returns The method is returning a boolean value.
184
+ */
185
+ deleteVertex(vertexOrKey) {
186
+ let vertexKey;
187
+ let vertex;
188
+ if (this.isVertexKey(vertexOrKey)) {
189
+ vertex = this.getVertex(vertexOrKey);
190
+ vertexKey = vertexOrKey;
191
+ }
192
+ else {
193
+ vertex = vertexOrKey;
194
+ vertexKey = this._getVertexKey(vertexOrKey);
195
+ }
196
+ const neighbors = this.getNeighbors(vertexOrKey);
197
+ if (vertex) {
198
+ neighbors.forEach(neighbor => {
199
+ const neighborEdges = this._edges.get(neighbor);
200
+ if (neighborEdges) {
201
+ const restEdges = neighborEdges.filter(edge => {
202
+ return !edge.vertices.includes(vertexKey);
203
+ });
204
+ this._edges.set(neighbor, restEdges);
205
+ }
206
+ });
207
+ this._edges.delete(vertex);
208
+ }
209
+ return this._vertices.delete(vertexKey);
147
210
  }
148
211
  /**
149
212
  * Time Complexity: O(1)
@@ -1,9 +1,9 @@
1
1
  import { BinaryTree, BinaryTreeNode } from '../data-structures';
2
- import { BinaryTreeNested, BinaryTreeNodeNested, BinaryTreeOptions, BiTreeDeleteResult, BTNCallback, BTNKey, BTNodeExemplar } from '../types';
3
- export interface IBinaryTree<V = any, N extends BinaryTreeNode<V, N> = BinaryTreeNodeNested<V>, TREE extends BinaryTree<V, N, TREE> = BinaryTreeNested<V, N>> {
4
- createNode(key: BTNKey, value?: N['value']): N;
5
- createTree(options?: Partial<BinaryTreeOptions>): TREE;
6
- add(keyOrNodeOrEntry: BTNodeExemplar<V, N>, count?: number): N | null | undefined;
7
- addMany(nodes: Iterable<BTNodeExemplar<V, N>>): (N | null | undefined)[];
2
+ import { BinaryTreeNested, BinaryTreeNodeNested, BinaryTreeOptions, BiTreeDeleteResult, BTNCallback, BTNodeExemplar } from '../types';
3
+ export interface IBinaryTree<K = number, V = any, N extends BinaryTreeNode<K, V, N> = BinaryTreeNodeNested<K, V>, TREE extends BinaryTree<K, V, N, TREE> = BinaryTreeNested<K, V, N>> {
4
+ createNode(key: K, value?: N['value']): N;
5
+ createTree(options?: Partial<BinaryTreeOptions<K>>): TREE;
6
+ add(keyOrNodeOrEntry: BTNodeExemplar<K, V, N>, count?: number): N | null | undefined;
7
+ addMany(nodes: Iterable<BTNodeExemplar<K, V, N>>): (N | null | undefined)[];
8
8
  delete<C extends BTNCallback<N>>(identifier: ReturnType<C> | null, callback: C): BiTreeDeleteResult<N>[];
9
9
  }
@@ -1,5 +1,8 @@
1
- import { BTNKey } from "./data-structures";
2
- export type Comparator<T> = (a: T, b: T) => number;
1
+ export type Comparator<K> = (a: K, b: K) => number;
2
+ export declare enum BSTVariant {
3
+ MIN = "MIN",
4
+ MAX = "MAX"
5
+ }
3
6
  export type DFSOrderPattern = 'pre' | 'in' | 'post';
4
7
  export type BTNCallback<N, D = any> = (node: N) => D;
5
8
  export declare enum CP {
@@ -19,9 +22,9 @@ export type BinaryTreePrintOptions = {
19
22
  isShowNull?: boolean;
20
23
  isShowRedBlackNIL?: boolean;
21
24
  };
22
- export type BTNodeEntry<T> = [BTNKey | null | undefined, T | undefined];
23
- export type BTNodeKeyOrNode<N> = BTNKey | null | undefined | N;
24
- export type BTNodeExemplar<T, N> = BTNodeEntry<T> | BTNodeKeyOrNode<N>;
25
- export type BTNodePureExemplar<T, N> = [BTNKey, T | undefined] | BTNodePureKeyOrNode<N>;
26
- export type BTNodePureKeyOrNode<N> = BTNKey | N;
27
- export type BSTNodeKeyOrNode<N> = BTNKey | undefined | N;
25
+ export type BTNodeEntry<K, V> = [K | null | undefined, V | undefined];
26
+ export type BTNodeKeyOrNode<K, N> = K | null | undefined | N;
27
+ export type BTNodeExemplar<K, V, N> = BTNodeEntry<K, V> | BTNodeKeyOrNode<K, N>;
28
+ export type BTNodePureExemplar<K, V, N> = [K, V | undefined] | BTNodePureKeyOrNode<K, N>;
29
+ export type BTNodePureKeyOrNode<K, N> = K | N;
30
+ export type BSTNodeKeyOrNode<K, N> = K | undefined | N;
@@ -1,3 +1,8 @@
1
+ export var BSTVariant;
2
+ (function (BSTVariant) {
3
+ BSTVariant["MIN"] = "MIN";
4
+ BSTVariant["MAX"] = "MAX";
5
+ })(BSTVariant || (BSTVariant = {}));
1
6
  export var CP;
2
7
  (function (CP) {
3
8
  CP["lt"] = "lt";
@@ -1,5 +1,5 @@
1
1
  import { AVLTree, AVLTreeNode } from '../../../data-structures';
2
2
  import { BSTOptions } from './bst';
3
- export type AVLTreeNodeNested<T> = AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
- export type AVLTreeNested<T, N extends AVLTreeNode<T, N>> = AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, AVLTree<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
- export type AVLTreeOptions = BSTOptions & {};
3
+ export type AVLTreeNodeNested<K, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
+ export type AVLTreeNested<K, V, N extends AVLTreeNode<K, V, N>> = AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, AVLTree<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
+ export type AVLTreeOptions<K> = BSTOptions<K> & {};
@@ -18,14 +18,14 @@ export declare enum FamilyPosition {
18
18
  ISOLATED = "ISOLATED",
19
19
  MAL_NODE = "MAL_NODE"
20
20
  }
21
- export type BTNKey = number;
22
21
  export type BiTreeDeleteResult<N> = {
23
22
  deleted: N | null | undefined;
24
23
  needBalanced: N | null | undefined;
25
24
  };
26
- export type BinaryTreeNodeNested<T> = BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
27
- export type BinaryTreeNested<T, N extends BinaryTreeNode<T, N>> = BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
28
- export type BinaryTreeOptions = {
25
+ export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
26
+ export type BinaryTreeNested<K, V, N extends BinaryTreeNode<K, V, N>> = BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, BinaryTree<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
27
+ export type BinaryTreeOptions<K> = {
29
28
  iterationType: IterationType;
29
+ extractor: (key: K) => number;
30
30
  };
31
31
  export type NodeDisplayLayout = [string[], number, number, number];
@@ -1,8 +1,8 @@
1
1
  import { BST, BSTNode } from '../../../data-structures';
2
- import type { BinaryTreeOptions, BTNKey } from './binary-tree';
3
- import { Comparator } from "../../common";
4
- export type BSTNodeNested<T> = BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
- export type BSTNested<T, N extends BSTNode<T, N>> = BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
6
- export type BSTOptions = BinaryTreeOptions & {
7
- comparator: Comparator<BTNKey>;
2
+ import type { BinaryTreeOptions } from './binary-tree';
3
+ import { BSTVariant } from "../../common";
4
+ export type BSTNodeNested<K, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
+ export type BSTNested<K, V, N extends BSTNode<K, V, N>> = BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
6
+ export type BSTOptions<K> = BinaryTreeOptions<K> & {
7
+ variant: BSTVariant;
8
8
  };
@@ -4,6 +4,6 @@ export declare enum RBTNColor {
4
4
  RED = 1,
5
5
  BLACK = 0
6
6
  }
7
- export type RedBlackTreeNodeNested<T> = RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, RedBlackTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
8
- export type RedBlackTreeNested<T, N extends RedBlackTreeNode<T, N>> = RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, RedBlackTree<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
9
- export type RBTreeOptions = BSTOptions & {};
7
+ export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
8
+ export type RedBlackTreeNested<K, V, N extends RedBlackTreeNode<K, V, N>> = RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
9
+ export type RBTreeOptions<K> = BSTOptions<K> & {};
@@ -1,5 +1,5 @@
1
1
  import { TreeMultimap, TreeMultimapNode } from '../../../data-structures';
2
2
  import { AVLTreeOptions } from './avl-tree';
3
- export type TreeMultimapNodeNested<T> = TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, TreeMultimapNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
- export type TreeMultimapNested<T, N extends TreeMultimapNode<T, N>> = TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, TreeMultimap<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
- export type TreeMultimapOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedNodeByKey'> & {};
3
+ export type TreeMultimapNodeNested<K, V> = TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, TreeMultimapNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
+ export type TreeMultimapNested<K, V, N extends TreeMultimapNode<K, V, N>> = TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, TreeMultimap<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
+ export type TreeMultimapOptions<K> = Omit<AVLTreeOptions<K>, 'isMergeDuplicatedNodeByKey'> & {};