deque-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.
- package/dist/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
- package/dist/data-structures/binary-tree/avl-tree-counter.js +407 -0
- package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -189
- package/dist/data-structures/binary-tree/avl-tree-multi-map.js +133 -357
- package/dist/data-structures/binary-tree/avl-tree.d.ts +108 -78
- package/dist/data-structures/binary-tree/avl-tree.js +126 -79
- package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +3 -0
- package/dist/data-structures/binary-tree/binary-tree.d.ts +243 -190
- package/dist/data-structures/binary-tree/binary-tree.js +273 -229
- package/dist/data-structures/binary-tree/bst.d.ts +141 -122
- package/dist/data-structures/binary-tree/bst.js +170 -134
- package/dist/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/data-structures/binary-tree/index.js +2 -0
- package/dist/data-structures/binary-tree/red-black-tree.d.ts +84 -80
- package/dist/data-structures/binary-tree/red-black-tree.js +101 -79
- package/dist/data-structures/binary-tree/tree-counter.d.ts +212 -0
- package/dist/data-structures/binary-tree/tree-counter.js +444 -0
- package/dist/data-structures/binary-tree/tree-multi-map.d.ts +78 -186
- package/dist/data-structures/binary-tree/tree-multi-map.js +140 -388
- package/dist/data-structures/graph/directed-graph.d.ts +3 -0
- package/dist/data-structures/graph/directed-graph.js +3 -0
- package/dist/data-structures/graph/map-graph.d.ts +3 -0
- package/dist/data-structures/graph/map-graph.js +3 -0
- package/dist/data-structures/graph/undirected-graph.d.ts +3 -0
- package/dist/data-structures/graph/undirected-graph.js +3 -0
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +3 -0
- package/dist/data-structures/linked-list/singly-linked-list.js +3 -0
- package/dist/data-structures/linked-list/skip-linked-list.d.ts +3 -0
- package/dist/data-structures/linked-list/skip-linked-list.js +3 -0
- package/dist/data-structures/matrix/matrix.d.ts +3 -0
- package/dist/data-structures/matrix/matrix.js +3 -0
- package/dist/data-structures/matrix/navigator.d.ts +3 -0
- package/dist/data-structures/matrix/navigator.js +3 -0
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
- package/dist/data-structures/priority-queue/max-priority-queue.js +3 -0
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
- package/dist/data-structures/priority-queue/min-priority-queue.js +3 -0
- package/dist/data-structures/trie/trie.d.ts +0 -4
- package/dist/data-structures/trie/trie.js +0 -4
- package/dist/interfaces/binary-tree.d.ts +7 -6
- package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
- package/dist/types/data-structures/binary-tree/avl-tree-counter.js +2 -0
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -3
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +0 -2
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +0 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +3 -2
- package/dist/types/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/types/data-structures/binary-tree/index.js +2 -0
- package/dist/types/data-structures/binary-tree/rb-tree.d.ts +1 -3
- package/dist/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
- package/dist/types/data-structures/binary-tree/tree-counter.js +2 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -3
- package/package.json +2 -2
- package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +148 -394
- package/src/data-structures/binary-tree/avl-tree.ts +152 -112
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
- package/src/data-structures/binary-tree/binary-tree.ts +446 -379
- package/src/data-structures/binary-tree/bst.ts +224 -201
- package/src/data-structures/binary-tree/index.ts +2 -0
- package/src/data-structures/binary-tree/red-black-tree.ts +138 -114
- package/src/data-structures/binary-tree/tree-counter.ts +504 -0
- package/src/data-structures/binary-tree/tree-multi-map.ts +156 -428
- package/src/data-structures/graph/directed-graph.ts +3 -0
- package/src/data-structures/graph/map-graph.ts +3 -0
- package/src/data-structures/graph/undirected-graph.ts +3 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +3 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
- package/src/data-structures/matrix/matrix.ts +3 -0
- package/src/data-structures/matrix/navigator.ts +3 -0
- package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
- package/src/data-structures/trie/trie.ts +0 -4
- package/src/interfaces/binary-tree.ts +10 -11
- package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -4
- package/src/types/data-structures/binary-tree/avl-tree.ts +0 -3
- package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
- package/src/types/data-structures/binary-tree/bst.ts +5 -3
- package/src/types/data-structures/binary-tree/index.ts +2 -0
- package/src/types/data-structures/binary-tree/rb-tree.ts +1 -4
- package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
- package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -4
|
@@ -5,210 +5,102 @@
|
|
|
5
5
|
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
9
|
-
import { IBinaryTree } from '../../interfaces';
|
|
8
|
+
import type { BTNRep, OptNodeOrNull, TreeMultiMapOptions } from '../../types';
|
|
10
9
|
import { RedBlackTree, RedBlackTreeNode } from './red-black-tree';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param {
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param [
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
get count(): number;
|
|
31
|
-
/**
|
|
32
|
-
* The above function sets the value of the count property.
|
|
33
|
-
* @param {number} value - The value parameter is of type number, which means it can accept any
|
|
34
|
-
* numeric value.
|
|
35
|
-
*/
|
|
36
|
-
set count(value: number);
|
|
10
|
+
import { IBinaryTree } from '../../interfaces';
|
|
11
|
+
export declare class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<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?: TreeMultiMapNode<K, V>;
|
|
23
|
+
_left?: OptNodeOrNull<TreeMultiMapNode<K, V>>;
|
|
24
|
+
get left(): OptNodeOrNull<TreeMultiMapNode<K, V>>;
|
|
25
|
+
set left(v: OptNodeOrNull<TreeMultiMapNode<K, V>>);
|
|
26
|
+
_right?: OptNodeOrNull<TreeMultiMapNode<K, V>>;
|
|
27
|
+
get right(): OptNodeOrNull<TreeMultiMapNode<K, V>>;
|
|
28
|
+
set right(v: OptNodeOrNull<TreeMultiMapNode<K, V>>);
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V, NODE>>, options?: TreeMultiMapOptions<K, V, R>);
|
|
49
|
-
protected _count: number;
|
|
50
|
-
/**
|
|
51
|
-
* The function calculates the sum of the count property of all nodes in a tree structure.
|
|
52
|
-
* @returns the sum of the count property of all nodes in the tree.
|
|
53
|
-
*/
|
|
54
|
-
get count(): number;
|
|
55
|
-
/**
|
|
56
|
-
* Time Complexity: O(n)
|
|
57
|
-
* Space Complexity: O(1)
|
|
58
|
-
*
|
|
59
|
-
* The function calculates the sum of the count property of all nodes in a tree using depth-first
|
|
60
|
-
* search.
|
|
61
|
-
* @returns the sum of the count property of all nodes in the tree.
|
|
62
|
-
*/
|
|
63
|
-
getComputedCount(): number;
|
|
64
|
-
/**
|
|
65
|
-
* The function creates a new TreeMultiMapNode with the specified key, value, color, and count.
|
|
66
|
-
* @param {K} key - The key parameter represents the key of the node being created. It is of type K,
|
|
67
|
-
* which is a generic type representing the type of keys in the tree.
|
|
68
|
-
* @param {V} [value] - The `value` parameter is an optional parameter that represents the value
|
|
69
|
-
* associated with the key in the node. It is of type `V`, which can be any data type.
|
|
70
|
-
* @param {RBTNColor} [color=BLACK] - The color parameter is used to specify the color of the node in
|
|
71
|
-
* a Red-Black Tree. It can have two possible values: 'RED' or 'BLACK'. The default value is 'BLACK'.
|
|
72
|
-
* @param {number} [count] - The `count` parameter represents the number of occurrences of a key in
|
|
73
|
-
* the tree. It is an optional parameter and is used to keep track of the number of values associated
|
|
74
|
-
* with a key in the tree.
|
|
75
|
-
* @returns A new instance of the TreeMultiMapNode class, casted as NODE.
|
|
76
|
-
*/
|
|
77
|
-
createNode(key: K, value?: V, color?: RBTNColor, count?: number): NODE;
|
|
78
|
-
/**
|
|
79
|
-
* The function creates a new instance of a TreeMultiMap with the specified options and returns it.
|
|
80
|
-
* @param [options] - The `options` parameter is an optional object that contains additional
|
|
81
|
-
* configuration options for creating the `TreeMultiMap`. It is of type `TreeMultiMapOptions<K, V,
|
|
82
|
-
* R>`.
|
|
83
|
-
* @returns a new instance of the `TreeMultiMap` class, with the provided options merged with the
|
|
84
|
-
* existing `iterationType` property. The returned value is casted as `TREE`.
|
|
85
|
-
*/
|
|
86
|
-
createTree(options?: TreeMultiMapOptions<K, V, R>): TreeMultiMap<K, V, R, NODE>;
|
|
87
|
-
/**
|
|
88
|
-
* The function checks if the input is an instance of the TreeMultiMapNode class.
|
|
89
|
-
* @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
|
|
90
|
-
* `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
|
|
91
|
-
* @returns a boolean value indicating whether the input parameter `keyNodeEntryOrRaw` is
|
|
92
|
-
* an instance of the `TreeMultiMapNode` class.
|
|
93
|
-
*/
|
|
94
|
-
isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Find elements in a range
|
|
34
|
+
* const tmm = new TreeMultiMap<number>([10, 5, 15, 3, 7, 12, 18]);
|
|
35
|
+
* console.log(tmm.search(new Range(5, 10))); // [5, 10, 7]
|
|
36
|
+
* console.log(tmm.search(new Range(4, 12))); // [5, 10, 12, 7]
|
|
37
|
+
* console.log(tmm.search(new Range(15, 20))); // [15, 18]
|
|
38
|
+
*/
|
|
39
|
+
export declare class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends RedBlackTree<K, V[], R, MK, MV[], MR> implements IBinaryTree<K, V[], R, MK, MV, MR> {
|
|
95
40
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* `
|
|
103
|
-
*
|
|
104
|
-
*
|
|
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 if no value is provided
|
|
107
|
-
* for `count`, the key-value pair will be added once.
|
|
108
|
-
* @returns The method is returning a boolean value. It returns true if the addition of the new node
|
|
109
|
-
* was successful, and false otherwise.
|
|
41
|
+
* The constructor initializes an TreeMultiMap with the provided keys, nodes, entries, or raw data
|
|
42
|
+
* and options.
|
|
43
|
+
* @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter in the constructor is an
|
|
44
|
+
* iterable that can contain either key-value pairs represented as `BTNRep<K, V[],
|
|
45
|
+
* TreeMultiMapNode<K, V>>` or raw data represented as `R`. This parameter is used to initialize
|
|
46
|
+
* the RedBlackTreeMulti
|
|
47
|
+
* @param [options] - The `options` parameter in the constructor is of type
|
|
48
|
+
* `TreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
|
|
49
|
+
* additional options for configuring the TreeMultiMap instance.
|
|
110
50
|
*/
|
|
111
|
-
|
|
51
|
+
constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V[], TreeMultiMapNode<K, V>> | R>, options?: TreeMultiMapOptions<K, V[], R>);
|
|
112
52
|
/**
|
|
113
|
-
* Time Complexity: O(
|
|
53
|
+
* Time Complexity: O(1)
|
|
114
54
|
* Space Complexity: O(1)
|
|
115
55
|
*
|
|
116
|
-
* The
|
|
117
|
-
*
|
|
118
|
-
* @param
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* `ignoreCount` is `false
|
|
125
|
-
* @returns The `override delete` method returns an array of `BinaryTreeDeleteResult<NODE>` objects.
|
|
56
|
+
* The `createTree` function in TypeScript overrides the default implementation to create a new
|
|
57
|
+
* TreeMultiMap with specified options.
|
|
58
|
+
* @param [options] - The `options` parameter in the `createTree` method is of type
|
|
59
|
+
* `TreeMultiMapOptions<K, V[], R>`. This parameter allows you to pass additional configuration
|
|
60
|
+
* options when creating a new `TreeMultiMap` instance. It includes properties such as
|
|
61
|
+
* `iterationType`, `specifyComparable
|
|
62
|
+
* @returns A new instance of `TreeMultiMap` is being returned, with an empty array as the initial
|
|
63
|
+
* data and the provided options merged with the existing properties of the current object.
|
|
126
64
|
*/
|
|
127
|
-
|
|
65
|
+
createTree(options?: TreeMultiMapOptions<K, V[], R>): TreeMultiMap<K, V, R, MK, MV, MR>;
|
|
128
66
|
/**
|
|
129
67
|
* Time Complexity: O(1)
|
|
130
68
|
* Space Complexity: O(1)
|
|
131
69
|
*
|
|
132
|
-
* The
|
|
133
|
-
*
|
|
70
|
+
* The function `createNode` overrides the method to create a new `TreeMultiMapNode` with a specified
|
|
71
|
+
* key and an empty array of values.
|
|
72
|
+
* @param {K} key - The `key` parameter in the `createNode` method represents the key of the node
|
|
73
|
+
* that will be created in the TreeMultiMap data structure.
|
|
74
|
+
* @returns A new instance of `TreeMultiMapNode<K, V>` is being returned, with the specified key and
|
|
75
|
+
* an empty array as its value.
|
|
134
76
|
*/
|
|
135
|
-
|
|
77
|
+
createNode(key: K): TreeMultiMapNode<K, V>;
|
|
78
|
+
add(node: BTNRep<K, V[], TreeMultiMapNode<K, V>>): boolean;
|
|
79
|
+
add(key: K, value: V): boolean;
|
|
136
80
|
/**
|
|
137
|
-
* Time Complexity: O(
|
|
81
|
+
* Time Complexity: O(log n)
|
|
138
82
|
* Space Complexity: O(log n)
|
|
139
83
|
*
|
|
140
|
-
* The `
|
|
141
|
-
*
|
|
142
|
-
* @param {
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* `
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
* The function overrides the clone method to create a deep copy of a tree object.
|
|
155
|
-
* @returns The `clone()` method is returning a cloned instance of the `TREE` object.
|
|
156
|
-
*/
|
|
157
|
-
clone(): TreeMultiMap<K, V, R, NODE>;
|
|
158
|
-
/**
|
|
159
|
-
* The `map` function in TypeScript overrides the default behavior to create a new TreeMultiMap with
|
|
160
|
-
* modified entries based on a provided callback.
|
|
161
|
-
* @param callback - The `callback` parameter is a function that will be called for each entry in the
|
|
162
|
-
* map. It takes four arguments:
|
|
163
|
-
* @param [options] - The `options` parameter in the `override map` function is of type
|
|
164
|
-
* `TreeMultiMapOptions<MK, MV, MR>`. This parameter allows you to provide additional configuration
|
|
165
|
-
* options when creating a new `TreeMultiMap` instance within the `map` function. These options could
|
|
166
|
-
* include things like
|
|
167
|
-
* @param {any} [thisArg] - The `thisArg` parameter in the `override map` function is used to specify
|
|
168
|
-
* the value of `this` when executing the `callback` function. It allows you to set the context
|
|
169
|
-
* (value of `this`) for the callback function when it is called within the `map` function. This
|
|
170
|
-
* @returns A new TreeMultiMap instance is being returned, which is populated with entries generated
|
|
171
|
-
* by the provided callback function.
|
|
172
|
-
*/
|
|
173
|
-
map<MK, MV, MR>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: TreeMultiMapOptions<MK, MV, MR>, thisArg?: any): TreeMultiMap<MK, MV, MR, TreeMultiMapNode<MK, MV, TreeMultiMapNodeNested<MK, MV>>>;
|
|
174
|
-
/**
|
|
175
|
-
* The function `keyValueNodeEntryRawToNodeAndValue` takes in a key, value, and count and returns a
|
|
176
|
-
* node based on the input.
|
|
177
|
-
* @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
|
|
178
|
-
* `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
|
|
179
|
-
* @param {V} [value] - The `value` parameter is an optional value that represents the value
|
|
180
|
-
* associated with the key in the node. It is used when creating a new node or updating the value of
|
|
181
|
-
* an existing node.
|
|
182
|
-
* @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
|
|
183
|
-
* times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
|
|
184
|
-
* @returns either a NODE object or undefined.
|
|
185
|
-
*/
|
|
186
|
-
protected _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
|
|
187
|
-
/**
|
|
188
|
-
* Time Complexity: O(1)
|
|
189
|
-
* Space Complexity: O(1)
|
|
190
|
-
*
|
|
191
|
-
* The `_swapProperties` function swaps the properties (key, value, count, color) between two nodes
|
|
192
|
-
* in a binary search tree.
|
|
193
|
-
* @param {R | BSTNOptKeyOrNode<K, NODE>} srcNode - The `srcNode` parameter represents the source node
|
|
194
|
-
* that will be swapped with the `destNode`. It can be either an instance of the `R` class or an
|
|
195
|
-
* instance of the `BSTNOptKeyOrNode<K, NODE>` class.
|
|
196
|
-
* @param {R | BSTNOptKeyOrNode<K, NODE>} destNode - The `destNode` parameter represents the destination
|
|
197
|
-
* node where the properties will be swapped with the source node.
|
|
198
|
-
* @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
|
|
199
|
-
* If either `srcNode` or `destNode` is undefined, it returns undefined.
|
|
200
|
-
*/
|
|
201
|
-
protected _swapProperties(srcNode: R | BSTNOptKeyOrNode<K, NODE>, destNode: R | BSTNOptKeyOrNode<K, NODE>): NODE | undefined;
|
|
84
|
+
* The function `deleteValue` removes a specific value from a key in a TreeMultiMap data structure
|
|
85
|
+
* and deletes the entire node if no values are left for that key.
|
|
86
|
+
* @param {BTNRep<K, V[], TreeMultiMapNode<K, V>> | K} keyNodeOrEntry - The `keyNodeOrEntry`
|
|
87
|
+
* parameter in the `deleteValue` function can be either a `BTNRep` object containing a key and an
|
|
88
|
+
* array of values, or just a key itself.
|
|
89
|
+
* @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
|
|
90
|
+
* value that you want to remove from the multi-map data structure associated with a particular key.
|
|
91
|
+
* The function checks if the value exists in the array of values associated with the key, and if
|
|
92
|
+
* found, removes it from the array.
|
|
93
|
+
* @returns The `deleteValue` function returns a boolean value - `true` if the specified `value` was
|
|
94
|
+
* successfully deleted from the values associated with the `keyNodeOrEntry`, and `false` otherwise.
|
|
95
|
+
*/
|
|
96
|
+
deleteValue(keyNodeOrEntry: BTNRep<K, V[], TreeMultiMapNode<K, V>> | K, value: V): boolean;
|
|
202
97
|
/**
|
|
203
|
-
* Time Complexity: O(
|
|
204
|
-
* Space Complexity: O(
|
|
98
|
+
* Time Complexity: O(n)
|
|
99
|
+
* Space Complexity: O(n)
|
|
205
100
|
*
|
|
206
|
-
* The function
|
|
207
|
-
* @param {NODE} oldNode - The `oldNode` parameter is the node that you want to replace in the data
|
|
101
|
+
* The function `clone` overrides the default cloning behavior to create a deep copy of a tree
|
|
208
102
|
* structure.
|
|
209
|
-
* @
|
|
210
|
-
* @returns The method is returning the result of calling the `_replaceNode` method from the
|
|
211
|
-
* superclass, which is of type `NODE`.
|
|
103
|
+
* @returns The `cloned` object is being returned.
|
|
212
104
|
*/
|
|
213
|
-
|
|
105
|
+
clone(): TreeMultiMap<K, V, R, MK, MV, MR>;
|
|
214
106
|
}
|