stack-typed 1.53.9 → 1.54.1

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 (84) hide show
  1. package/dist/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
  2. package/dist/data-structures/binary-tree/avl-tree-counter.js +407 -0
  3. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -189
  4. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +133 -357
  5. package/dist/data-structures/binary-tree/avl-tree.d.ts +108 -78
  6. package/dist/data-structures/binary-tree/avl-tree.js +126 -79
  7. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
  8. package/dist/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  9. package/dist/data-structures/binary-tree/binary-tree.d.ts +243 -190
  10. package/dist/data-structures/binary-tree/binary-tree.js +273 -229
  11. package/dist/data-structures/binary-tree/bst.d.ts +141 -122
  12. package/dist/data-structures/binary-tree/bst.js +170 -134
  13. package/dist/data-structures/binary-tree/index.d.ts +2 -0
  14. package/dist/data-structures/binary-tree/index.js +2 -0
  15. package/dist/data-structures/binary-tree/red-black-tree.d.ts +84 -80
  16. package/dist/data-structures/binary-tree/red-black-tree.js +101 -79
  17. package/dist/data-structures/binary-tree/tree-counter.d.ts +212 -0
  18. package/dist/data-structures/binary-tree/tree-counter.js +444 -0
  19. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +78 -186
  20. package/dist/data-structures/binary-tree/tree-multi-map.js +140 -388
  21. package/dist/data-structures/graph/directed-graph.d.ts +3 -0
  22. package/dist/data-structures/graph/directed-graph.js +3 -0
  23. package/dist/data-structures/graph/map-graph.d.ts +3 -0
  24. package/dist/data-structures/graph/map-graph.js +3 -0
  25. package/dist/data-structures/graph/undirected-graph.d.ts +3 -0
  26. package/dist/data-structures/graph/undirected-graph.js +3 -0
  27. package/dist/data-structures/linked-list/singly-linked-list.d.ts +3 -0
  28. package/dist/data-structures/linked-list/singly-linked-list.js +3 -0
  29. package/dist/data-structures/linked-list/skip-linked-list.d.ts +3 -0
  30. package/dist/data-structures/linked-list/skip-linked-list.js +3 -0
  31. package/dist/data-structures/matrix/matrix.d.ts +3 -0
  32. package/dist/data-structures/matrix/matrix.js +3 -0
  33. package/dist/data-structures/matrix/navigator.d.ts +3 -0
  34. package/dist/data-structures/matrix/navigator.js +3 -0
  35. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
  36. package/dist/data-structures/priority-queue/max-priority-queue.js +3 -0
  37. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
  38. package/dist/data-structures/priority-queue/min-priority-queue.js +3 -0
  39. package/dist/data-structures/trie/trie.d.ts +0 -4
  40. package/dist/data-structures/trie/trie.js +0 -4
  41. package/dist/interfaces/binary-tree.d.ts +7 -6
  42. package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  43. package/dist/types/data-structures/binary-tree/avl-tree-counter.js +2 -0
  44. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -3
  45. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +0 -2
  46. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +0 -2
  47. package/dist/types/data-structures/binary-tree/bst.d.ts +3 -2
  48. package/dist/types/data-structures/binary-tree/index.d.ts +2 -0
  49. package/dist/types/data-structures/binary-tree/index.js +2 -0
  50. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +1 -3
  51. package/dist/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  52. package/dist/types/data-structures/binary-tree/tree-counter.js +2 -0
  53. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -3
  54. package/package.json +2 -2
  55. package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
  56. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +148 -394
  57. package/src/data-structures/binary-tree/avl-tree.ts +152 -112
  58. package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
  59. package/src/data-structures/binary-tree/binary-tree.ts +446 -379
  60. package/src/data-structures/binary-tree/bst.ts +224 -201
  61. package/src/data-structures/binary-tree/index.ts +2 -0
  62. package/src/data-structures/binary-tree/red-black-tree.ts +138 -114
  63. package/src/data-structures/binary-tree/tree-counter.ts +504 -0
  64. package/src/data-structures/binary-tree/tree-multi-map.ts +156 -428
  65. package/src/data-structures/graph/directed-graph.ts +3 -0
  66. package/src/data-structures/graph/map-graph.ts +3 -0
  67. package/src/data-structures/graph/undirected-graph.ts +3 -0
  68. package/src/data-structures/linked-list/singly-linked-list.ts +3 -0
  69. package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
  70. package/src/data-structures/matrix/matrix.ts +3 -0
  71. package/src/data-structures/matrix/navigator.ts +3 -0
  72. package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
  73. package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
  74. package/src/data-structures/trie/trie.ts +0 -4
  75. package/src/interfaces/binary-tree.ts +10 -11
  76. package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
  77. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -4
  78. package/src/types/data-structures/binary-tree/avl-tree.ts +0 -3
  79. package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
  80. package/src/types/data-structures/binary-tree/bst.ts +5 -3
  81. package/src/types/data-structures/binary-tree/index.ts +2 -0
  82. package/src/types/data-structures/binary-tree/rb-tree.ts +1 -4
  83. package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
  84. package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -4
@@ -5,214 +5,96 @@
5
5
  * @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { AVLTreeMultiMapNodeNested, AVLTreeMultiMapOptions, BinaryTreeDeleteResult, BSTNOptKeyOrNode, BTNRep, EntryCallback, IterationType } from '../../types';
9
- import { IBinaryTree } from '../../interfaces';
8
+ import { AVLTreeMultiMapOptions, BTNRep, OptNodeOrNull } from '../../types';
10
9
  import { AVLTree, AVLTreeNode } from './avl-tree';
11
- export declare class AVLTreeMultiMapNode<K = any, V = any, NODE extends AVLTreeMultiMapNode<K, V, NODE> = AVLTreeMultiMapNodeNested<K, V>> extends AVLTreeNode<K, V, NODE> {
12
- /**
13
- * The constructor function initializes a BinaryTreeNode object with a key, value, and count.
14
- * @param {K} key - The `key` parameter is of type `K` and represents the unique identifier
15
- * of the binary tree node.
16
- * @param {V} [value] - The `value` parameter is an optional parameter of type `V`. It represents the value of the binary
17
- * tree node. If no value is provided, it will be `undefined`.
18
- * @param {number} [count=1] - The `count` parameter is a number that represents the number of times a particular value
19
- * occurs in a binary tree node. It has a default value of 1, which means that if no value is provided for the `count`
20
- * parameter when creating a new instance of the `BinaryTreeNode` class.
21
- */
22
- constructor(key: K, value?: V, count?: number);
23
- protected _count: number;
24
- /**
25
- * The function returns the value of the protected variable _count.
26
- * @returns The count property of the object, which is of type number.
27
- */
28
- get count(): number;
29
- /**
30
- * The above function sets the value of the count property.
31
- * @param {number} value - The value parameter is of type number, which means it can accept any
32
- * numeric value.
33
- */
34
- set count(value: number);
10
+ import { IBinaryTree } from '../../interfaces';
11
+ export declare class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K, V[]> {
12
+ /**
13
+ * This TypeScript constructor initializes an object with a key of type K and an array of values of
14
+ * type V.
15
+ * @param {K} key - The `key` parameter is typically used to store a unique identifier or key for the
16
+ * data being stored in the data structure. It helps in quickly accessing or retrieving the
17
+ * associated value in the data structure.
18
+ * @param {V[]} value - The `value` parameter in the constructor represents an array of values of
19
+ * type `V`.
20
+ */
21
+ constructor(key: K, value: V[]);
22
+ parent?: AVLTreeMultiMapNode<K, V>;
23
+ _left?: OptNodeOrNull<AVLTreeMultiMapNode<K, V>>;
24
+ get left(): OptNodeOrNull<AVLTreeMultiMapNode<K, V>>;
25
+ set left(v: OptNodeOrNull<AVLTreeMultiMapNode<K, V>>);
26
+ _right?: OptNodeOrNull<AVLTreeMultiMapNode<K, V>>;
27
+ get right(): OptNodeOrNull<AVLTreeMultiMapNode<K, V>>;
28
+ set right(v: OptNodeOrNull<AVLTreeMultiMapNode<K, V>>);
35
29
  }
36
30
  /**
37
- * The only distinction between a AVLTreeMultiMap and a AVLTree lies in the ability of the former to store duplicate nodes through the utilization of counters.
31
+ *
38
32
  */
39
- export declare class AVLTreeMultiMap<K = any, V = any, R = object, NODE extends AVLTreeMultiMapNode<K, V, NODE> = AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNodeNested<K, V>>> extends AVLTree<K, V, R, NODE> implements IBinaryTree<K, V, R, NODE> {
33
+ export declare class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends AVLTree<K, V[], R, MK, MV[], MR> implements IBinaryTree<K, V[], R, MK, MV, MR> {
40
34
  /**
41
- * The constructor initializes a new AVLTreeMultiMap object with optional initial elements.
42
- * @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter is an
43
- * iterable object that can contain either keys, nodes, entries, or raw elements.
44
- * @param [options] - The `options` parameter is an optional object that can be used to customize the
45
- * behavior of the AVLTreeMultiMap. It can include properties such as `compareKeys` and
46
- * `compareValues` functions to define custom comparison logic for keys and values, respectively.
35
+ * The constructor initializes an AVLTreeMultiMap with the provided keys, nodes, entries, or raw data
36
+ * and options.
37
+ * @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter in the constructor is an
38
+ * iterable that can contain either key-value pairs represented as `BTNRep<K, V[],
39
+ * AVLTreeMultiMapNode<K, V>>` or raw data represented as `R`. This parameter is used to initialize
40
+ * the AVLTreeMulti
41
+ * @param [options] - The `options` parameter in the constructor is of type
42
+ * `AVLTreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
43
+ * additional options for configuring the AVLTreeMultiMap instance.
47
44
  */
48
- constructor(keysNodesEntriesOrRaws?: Iterable<R | BTNRep<K, V, NODE>>, options?: AVLTreeMultiMapOptions<K, V, R>);
49
- protected _count: number;
45
+ constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V[], AVLTreeMultiMapNode<K, V>> | R>, options?: AVLTreeMultiMapOptions<K, V[], R>);
50
46
  /**
51
- * The function calculates the sum of the count property of all nodes in a tree using depth-first
52
- * search.
53
- * @returns the sum of the count property of all nodes in the tree.
54
- */
55
- get count(): number;
56
- /**
57
- * Time Complexity: O(n)
58
- * Space Complexity: O(1)
59
- *
60
- * The function calculates the sum of the count property of all nodes in a tree using depth-first
61
- * search.
62
- * @returns the sum of the count property of all nodes in the tree.
63
- */
64
- getComputedCount(): number;
65
- /**
66
- * The function creates a new AVLTreeMultiMapNode with the specified key, value, and count.
67
- * @param {K} key - The key parameter represents the key of the node being created. It is of type K,
68
- * which is a generic type that can be replaced with any specific type when using the function.
69
- * @param {V} [value] - The `value` parameter is an optional parameter that represents the value
70
- * associated with the key in the node. It is of type `V`, which can be any data type.
71
- * @param {number} [count] - The `count` parameter represents the number of occurrences of a
72
- * key-value pair in the AVLTreeMultiMapNode. It is an optional parameter, so it can be omitted when
73
- * calling the `createNode` method. If provided, it specifies the initial count for the node.
74
- * @returns a new instance of the AVLTreeMultiMapNode class, casted as NODE.
75
- */
76
- createNode(key: K, value?: V, count?: number): NODE;
77
- /**
78
- * The function creates a new AVLTreeMultiMap object with the specified options and returns it.
79
- * @param [options] - The `options` parameter is an optional object that contains additional
80
- * configuration options for creating the AVLTreeMultiMap. It can have the following properties:
81
- * @returns a new instance of the AVLTreeMultiMap class, with the specified options, as a TREE
82
- * object.
83
- */
84
- createTree(options?: AVLTreeMultiMapOptions<K, V, R>): AVLTreeMultiMap<K, V, R, NODE>;
85
- /**
86
- * The function checks if the input is an instance of AVLTreeMultiMapNode.
87
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
88
- * `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
89
- * @returns a boolean value indicating whether the input parameter `keyNodeEntryOrRaw` is
90
- * an instance of the `AVLTreeMultiMapNode` class.
91
- */
92
- isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
93
- /**
94
- * Time Complexity: O(log n)
95
- * Space Complexity: O(1)
96
- *
97
- * The function overrides the add method of a TypeScript class to add a new node to a data structure
98
- * and update the count.
99
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The
100
- * `keyNodeEntryOrRaw` parameter can accept a value of type `R`, which can be any type. It
101
- * can also accept a value of type `BTNRep<K, V, NODE>`, which represents a key, node,
102
- * entry, or raw element
103
- * @param {V} [value] - The `value` parameter represents the value associated with the key in the
104
- * data structure. It is an optional parameter, so it can be omitted if not needed.
105
- * @param [count=1] - The `count` parameter represents the number of times the key-value pair should
106
- * be added to the data structure. By default, it is set to 1, meaning that the key-value pair will
107
- * be added once. However, you can specify a different value for `count` if you want to add
108
- * @returns a boolean value.
109
- */
110
- add(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): boolean;
111
- /**
112
- * Time Complexity: O(log n)
47
+ * Time Complexity: O(1)
113
48
  * Space Complexity: O(1)
114
49
  *
115
- * The function overrides the delete method in a binary tree data structure, handling deletion of
116
- * nodes and maintaining balance in the tree.
117
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The `predicate`
118
- * parameter in the `delete` method is used to specify the condition for deleting a node from the
119
- * binary tree. It can be a key, node, or entry that determines which
120
- * node(s) should be deleted.
121
- * @param [ignoreCount=false] - The `ignoreCount` parameter in the `override delete` method is a
122
- * boolean flag that determines whether to ignore the count of the node being deleted. If
123
- * `ignoreCount` is set to `true`, the method will delete the node regardless of its count. If
124
- * `ignoreCount` is set to
125
- * @returns The `delete` method overrides the default delete behavior in a binary tree data
126
- * structure. It takes a predicate or node to be deleted and an optional flag to ignore count. The
127
- * method returns an array of `BinaryTreeDeleteResult` objects, each containing information about the
128
- * deleted node and whether balancing is needed in the tree.
50
+ * The function `createTree` in TypeScript overrides the creation of an AVLTreeMultiMap with
51
+ * specified options.
52
+ * @param [options] - The `options` parameter in the `createTree` function is of type
53
+ * `AVLTreeMultiMapOptions<K, V[], R>`. This means it is an object that can have properties of type
54
+ * `K`, `V[]`, and `R`. The function creates a new `AVL
55
+ * @returns The `createTree` method is returning a new instance of `AVLTreeMultiMap` with the
56
+ * provided options.
129
57
  */
130
- delete(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, ignoreCount?: boolean): BinaryTreeDeleteResult<NODE>[];
58
+ createTree(options?: AVLTreeMultiMapOptions<K, V[], R>): AVLTreeMultiMap<K, V, R, MK, MV, MR>;
131
59
  /**
132
60
  * Time Complexity: O(1)
133
61
  * Space Complexity: O(1)
134
62
  *
135
- * The "clear" function overrides the parent class's "clear" function and also resets the count to
136
- * zero.
63
+ * The function `createNode` overrides the method to create a new AVLTreeMultiMapNode with a
64
+ * specified key and an empty array of values.
65
+ * @param {K} key - The `key` parameter in the `createNode` method represents the key of the node
66
+ * that will be created in the AVLTreeMultiMap.
67
+ * @returns An AVLTreeMultiMapNode object is being returned, initialized with the provided key and an
68
+ * empty array.
137
69
  */
138
- clear(): void;
70
+ createNode(key: K): AVLTreeMultiMapNode<K, V>;
71
+ add(node: BTNRep<K, V[], AVLTreeMultiMapNode<K, V>>): boolean;
72
+ add(key: K, value: V): boolean;
139
73
  /**
140
- * Time Complexity: O(n log n)
74
+ * Time Complexity: O(log n)
141
75
  * Space Complexity: O(log n)
142
- * The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
143
- * tree using either a recursive or iterative approach.
144
- * @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
145
- * specifies the type of iteration to use when building the balanced binary search tree. It has a
146
- * default value of `this.iterationType`, which means it will use the iteration type currently set in
147
- * the object.
148
- * @returns The function `perfectlyBalance` returns a boolean value. It returns `true` if the
149
- * balancing operation is successful, and `false` if there are no nodes to balance.
150
- */
151
- perfectlyBalance(iterationType?: IterationType): boolean;
152
- /**
153
- * Time complexity: O(n)
154
- * Space complexity: O(n)
155
- *
156
- * The function overrides the clone method to create a deep copy of a tree object.
157
- * @returns The `clone()` method is returning a cloned instance of the `TREE` object.
158
- */
159
- clone(): AVLTreeMultiMap<K, V, R, NODE>;
160
- /**
161
- * The `map` function in TypeScript overrides the default behavior to create a new AVLTreeMultiMap
162
- * with modified entries based on a provided callback.
163
- * @param callback - The `callback` parameter is a function that will be called for each entry in the
164
- * AVLTreeMultiMap. It takes four arguments:
165
- * @param [options] - The `options` parameter in the `override map` function is of type
166
- * `AVLTreeMultiMapOptions<MK, MV, MR>`. This parameter allows you to provide additional
167
- * configuration options when creating a new `AVLTreeMultiMap` instance within the `map` function.
168
- * These options
169
- * @param {any} [thisArg] - The `thisArg` parameter in the `override map` function is used to specify
170
- * the value of `this` when executing the `callback` function. It allows you to set the context
171
- * (value of `this`) for the callback function. This can be useful when you want to access properties
172
- * or
173
- * @returns The `map` method is returning a new `AVLTreeMultiMap` instance with the entries
174
- * transformed by the provided `callback` function. Each entry in the original tree is passed to the
175
- * `callback` function along with the index and the original tree itself. The transformed entries are
176
- * then added to the new `AVLTreeMultiMap` instance, which is returned at the end.
177
- */
178
- map<MK, MV, MR>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: AVLTreeMultiMapOptions<MK, MV, MR>, thisArg?: any): AVLTreeMultiMap<MK, MV, MR, AVLTreeMultiMapNode<MK, MV, AVLTreeMultiMapNodeNested<MK, MV>>>;
179
- /**
180
- * The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
181
- * a node object.
182
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The
183
- * `keyNodeEntryOrRaw` parameter can be of type `R` or `BTNRep<K, V, NODE>`.
184
- * @param {V} [value] - The `value` parameter is an optional value that can be passed to the
185
- * `override` function. It represents the value associated with the key in the data structure. If no
186
- * value is provided, it will default to `undefined`.
187
- * @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
188
- * times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
189
- * @returns either a NODE object or undefined.
190
- */
191
- protected _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
192
- /**
193
- * Time Complexity: O(1)
194
- * Space Complexity: O(1)
195
76
  *
196
- * The `_swapProperties` function swaps the properties (key, value, count, height) between two nodes
197
- * in a binary search tree.
198
- * @param {R | BSTNOptKeyOrNode<K, NODE>} srcNode - The `srcNode` parameter represents the source node
199
- * that will be swapped with the `destNode`.
200
- * @param {R | BSTNOptKeyOrNode<K, NODE>} destNode - The `destNode` parameter represents the destination
201
- * node where the properties will be swapped with the source node.
202
- * @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
203
- * If either `srcNode` or `destNode` is undefined, it returns `undefined`.
204
- */
205
- protected _swapProperties(srcNode: R | BSTNOptKeyOrNode<K, NODE>, destNode: R | BSTNOptKeyOrNode<K, NODE>): NODE | undefined;
77
+ * The function `deleteValue` removes a specific value from a key in an AVLTreeMultiMap data
78
+ * structure and deletes the entire node if no values are left for that key.
79
+ * @param {BTNRep<K, V[], AVLTreeMultiMapNode<K, V>> | K} keyNodeOrEntry - The `keyNodeOrEntry`
80
+ * parameter in the `deleteValue` function can be either a `BTNRep` object representing a key-value
81
+ * pair in the AVLTreeMultiMapNode, or just the key itself.
82
+ * @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
83
+ * value that you want to delete from the multi-map data structure associated with a particular key.
84
+ * The function checks if the value exists in the array of values associated with the key, and if
85
+ * found, removes it from the array.
86
+ * @returns The `deleteValue` function returns a boolean value. It returns `true` if the specified
87
+ * `value` was successfully deleted from the array of values associated with the `keyNodeOrEntry`. If
88
+ * the value was not found in the array, it returns `false`.
89
+ */
90
+ deleteValue(keyNodeOrEntry: BTNRep<K, V[], AVLTreeMultiMapNode<K, V>> | K, value: V): boolean;
206
91
  /**
207
- * Time Complexity: O(1)
208
- * Space Complexity: O(1)
92
+ * Time Complexity: O(n)
93
+ * Space Complexity: O(n)
209
94
  *
210
- * The function replaces an old node with a new node and updates the count property of the new node.
211
- * @param {NODE} oldNode - The oldNode parameter represents the node that needs to be replaced in the
212
- * data structure. It is of type NODE.
213
- * @param {NODE} newNode - The `newNode` parameter is an instance of the `NODE` class.
214
- * @returns The method is returning the result of calling the `_replaceNode` method from the
215
- * superclass, which is of type `NODE`.
95
+ * The function `clone` overrides the default cloning behavior to create a deep copy of a tree
96
+ * structure.
97
+ * @returns A cloned tree object is being returned.
216
98
  */
217
- protected _replaceNode(oldNode: NODE, newNode: NODE): NODE;
99
+ clone(): AVLTreeMultiMap<K, V, R, MK, MV, MR>;
218
100
  }