red-black-tree-typed 1.53.7 → 1.54.2

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 (119) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +52 -0
  3. package/dist/common/index.js +5 -0
  4. package/dist/data-structures/base/iterable-entry-base.js +4 -4
  5. package/dist/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
  6. package/dist/data-structures/binary-tree/avl-tree-counter.js +407 -0
  7. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -170
  8. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +133 -328
  9. package/dist/data-structures/binary-tree/avl-tree.d.ts +103 -69
  10. package/dist/data-structures/binary-tree/avl-tree.js +130 -70
  11. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
  12. package/dist/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  13. package/dist/data-structures/binary-tree/binary-tree.d.ts +268 -202
  14. package/dist/data-structures/binary-tree/binary-tree.js +311 -263
  15. package/dist/data-structures/binary-tree/bst.d.ts +193 -139
  16. package/dist/data-structures/binary-tree/bst.js +248 -164
  17. package/dist/data-structures/binary-tree/index.d.ts +3 -1
  18. package/dist/data-structures/binary-tree/index.js +3 -1
  19. package/dist/data-structures/binary-tree/red-black-tree.d.ts +286 -0
  20. package/dist/data-structures/binary-tree/{rb-tree.js → red-black-tree.js} +176 -107
  21. package/dist/data-structures/binary-tree/tree-counter.d.ts +212 -0
  22. package/dist/data-structures/binary-tree/tree-counter.js +444 -0
  23. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +78 -170
  24. package/dist/data-structures/binary-tree/tree-multi-map.js +145 -367
  25. package/dist/data-structures/graph/abstract-graph.js +2 -2
  26. package/dist/data-structures/graph/directed-graph.d.ts +3 -0
  27. package/dist/data-structures/graph/directed-graph.js +3 -0
  28. package/dist/data-structures/graph/map-graph.d.ts +3 -0
  29. package/dist/data-structures/graph/map-graph.js +3 -0
  30. package/dist/data-structures/graph/undirected-graph.d.ts +3 -0
  31. package/dist/data-structures/graph/undirected-graph.js +3 -0
  32. package/dist/data-structures/hash/hash-map.d.ts +31 -1
  33. package/dist/data-structures/hash/hash-map.js +35 -5
  34. package/dist/data-structures/heap/heap.d.ts +20 -3
  35. package/dist/data-structures/heap/heap.js +31 -11
  36. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +46 -11
  37. package/dist/data-structures/linked-list/doubly-linked-list.js +68 -21
  38. package/dist/data-structures/linked-list/singly-linked-list.d.ts +47 -11
  39. package/dist/data-structures/linked-list/singly-linked-list.js +73 -26
  40. package/dist/data-structures/linked-list/skip-linked-list.d.ts +3 -0
  41. package/dist/data-structures/linked-list/skip-linked-list.js +3 -0
  42. package/dist/data-structures/matrix/matrix.d.ts +3 -0
  43. package/dist/data-structures/matrix/matrix.js +3 -0
  44. package/dist/data-structures/matrix/navigator.d.ts +3 -0
  45. package/dist/data-structures/matrix/navigator.js +3 -0
  46. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
  47. package/dist/data-structures/priority-queue/max-priority-queue.js +3 -0
  48. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
  49. package/dist/data-structures/priority-queue/min-priority-queue.js +3 -0
  50. package/dist/data-structures/queue/deque.d.ts +37 -8
  51. package/dist/data-structures/queue/deque.js +73 -29
  52. package/dist/data-structures/queue/queue.d.ts +41 -1
  53. package/dist/data-structures/queue/queue.js +51 -9
  54. package/dist/data-structures/stack/stack.d.ts +27 -10
  55. package/dist/data-structures/stack/stack.js +39 -20
  56. package/dist/data-structures/trie/trie.d.ts +8 -7
  57. package/dist/data-structures/trie/trie.js +8 -7
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +4 -4
  60. package/dist/interfaces/binary-tree.d.ts +8 -8
  61. package/dist/types/data-structures/base/base.d.ts +1 -1
  62. package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  63. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -4
  64. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +0 -3
  65. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +0 -3
  66. package/dist/types/data-structures/binary-tree/bst.d.ts +4 -4
  67. package/dist/types/data-structures/binary-tree/index.d.ts +3 -1
  68. package/dist/types/data-structures/binary-tree/index.js +3 -1
  69. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +3 -0
  70. package/dist/types/data-structures/binary-tree/red-black-tree.js +2 -0
  71. package/dist/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  72. package/dist/types/data-structures/binary-tree/tree-counter.js +2 -0
  73. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -5
  74. package/package.json +3 -3
  75. package/src/common/index.ts +7 -1
  76. package/src/data-structures/base/iterable-entry-base.ts +4 -4
  77. package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
  78. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +151 -370
  79. package/src/data-structures/binary-tree/avl-tree.ts +162 -105
  80. package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
  81. package/src/data-structures/binary-tree/binary-tree.ts +488 -416
  82. package/src/data-structures/binary-tree/bst.ts +326 -251
  83. package/src/data-structures/binary-tree/index.ts +3 -1
  84. package/src/data-structures/binary-tree/{rb-tree.ts → red-black-tree.ts} +219 -145
  85. package/src/data-structures/binary-tree/tree-counter.ts +504 -0
  86. package/src/data-structures/binary-tree/tree-multi-map.ts +159 -401
  87. package/src/data-structures/graph/abstract-graph.ts +2 -2
  88. package/src/data-structures/graph/directed-graph.ts +3 -0
  89. package/src/data-structures/graph/map-graph.ts +3 -0
  90. package/src/data-structures/graph/undirected-graph.ts +3 -0
  91. package/src/data-structures/hash/hash-map.ts +37 -7
  92. package/src/data-structures/heap/heap.ts +33 -10
  93. package/src/data-structures/linked-list/doubly-linked-list.ts +75 -21
  94. package/src/data-structures/linked-list/singly-linked-list.ts +80 -27
  95. package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
  96. package/src/data-structures/matrix/matrix.ts +3 -0
  97. package/src/data-structures/matrix/navigator.ts +3 -0
  98. package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
  99. package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
  100. package/src/data-structures/queue/deque.ts +72 -28
  101. package/src/data-structures/queue/queue.ts +50 -7
  102. package/src/data-structures/stack/stack.ts +39 -20
  103. package/src/data-structures/trie/trie.ts +8 -7
  104. package/src/index.ts +4 -4
  105. package/src/interfaces/binary-tree.ts +10 -21
  106. package/src/types/data-structures/base/base.ts +1 -1
  107. package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
  108. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -6
  109. package/src/types/data-structures/binary-tree/avl-tree.ts +0 -5
  110. package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
  111. package/src/types/data-structures/binary-tree/bst.ts +6 -6
  112. package/src/types/data-structures/binary-tree/index.ts +3 -1
  113. package/src/types/data-structures/binary-tree/red-black-tree.ts +5 -0
  114. package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
  115. package/src/types/data-structures/binary-tree/tree-multi-map.ts +2 -7
  116. package/dist/data-structures/binary-tree/rb-tree.d.ts +0 -209
  117. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +0 -6
  118. package/src/types/data-structures/binary-tree/rb-tree.ts +0 -10
  119. /package/dist/types/data-structures/binary-tree/{rb-tree.js → avl-tree-counter.js} +0 -0
@@ -5,195 +5,96 @@
5
5
  * @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { AVLTreeMultiMapNested, AVLTreeMultiMapNodeNested, AVLTreeMultiMapOptions, BinaryTreeDeleteResult, BSTNOptKeyOrNode, BTNRep, 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>>, TREE extends AVLTreeMultiMap<K, V, R, NODE, TREE> = AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMapNested<K, V, R, NODE>>> extends AVLTree<K, V, R, NODE, TREE> implements IBinaryTree<K, V, R, NODE, TREE> {
40
- /**
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.
47
- */
48
- constructor(keysNodesEntriesOrRaws?: Iterable<R | BTNRep<K, V, NODE>>, options?: AVLTreeMultiMapOptions<K, V, R>);
49
- protected _count: number;
50
- /**
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>): TREE;
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> {
85
34
  /**
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.
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.
91
44
  */
92
- isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
45
+ constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V[], AVLTreeMultiMapNode<K, V>> | R>, options?: AVLTreeMultiMapOptions<K, V[], R>);
93
46
  /**
94
- * The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
95
- * a node object.
96
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The
97
- * `keyNodeEntryOrRaw` parameter can be of type `R` or `BTNRep<K, V, NODE>`.
98
- * @param {V} [value] - The `value` parameter is an optional value that can be passed to the
99
- * `override` function. It represents the value associated with the key in the data structure. If no
100
- * value is provided, it will default to `undefined`.
101
- * @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
102
- * times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
103
- * @returns either a NODE object or undefined.
104
- */
105
- keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
106
- /**
107
- * Time Complexity: O(log n)
108
- * Space Complexity: O(1)
109
- *
110
- * The function overrides the add method of a TypeScript class to add a new node to a data structure
111
- * and update the count.
112
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The
113
- * `keyNodeEntryOrRaw` parameter can accept a value of type `R`, which can be any type. It
114
- * can also accept a value of type `BTNRep<K, V, NODE>`, which represents a key, node,
115
- * entry, or raw element
116
- * @param {V} [value] - The `value` parameter represents the value associated with the key in the
117
- * data structure. It is an optional parameter, so it can be omitted if not needed.
118
- * @param [count=1] - The `count` parameter represents the number of times the key-value pair should
119
- * be added to the data structure. By default, it is set to 1, meaning that the key-value pair will
120
- * be added once. However, you can specify a different value for `count` if you want to add
121
- * @returns a boolean value.
122
- */
123
- add(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): boolean;
124
- /**
125
- * Time Complexity: O(log n)
47
+ * Time Complexity: O(1)
126
48
  * Space Complexity: O(1)
127
49
  *
128
- * The function overrides the delete method in a binary tree data structure, handling deletion of
129
- * nodes and maintaining balance in the tree.
130
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The `predicate`
131
- * parameter in the `delete` method is used to specify the condition for deleting a node from the
132
- * binary tree. It can be a key, node, or entry that determines which
133
- * node(s) should be deleted.
134
- * @param [ignoreCount=false] - The `ignoreCount` parameter in the `override delete` method is a
135
- * boolean flag that determines whether to ignore the count of the node being deleted. If
136
- * `ignoreCount` is set to `true`, the method will delete the node regardless of its count. If
137
- * `ignoreCount` is set to
138
- * @returns The `delete` method overrides the default delete behavior in a binary tree data
139
- * structure. It takes a predicate or node to be deleted and an optional flag to ignore count. The
140
- * method returns an array of `BinaryTreeDeleteResult` objects, each containing information about the
141
- * 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.
142
57
  */
143
- 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>;
144
59
  /**
145
60
  * Time Complexity: O(1)
146
61
  * Space Complexity: O(1)
147
62
  *
148
- * The "clear" function overrides the parent class's "clear" function and also resets the count to
149
- * 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.
150
69
  */
151
- 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;
152
73
  /**
153
- * Time Complexity: O(n log n)
74
+ * Time Complexity: O(log n)
154
75
  * Space Complexity: O(log n)
155
- * The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
156
- * tree using either a recursive or iterative approach.
157
- * @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
158
- * specifies the type of iteration to use when building the balanced binary search tree. It has a
159
- * default value of `this.iterationType`, which means it will use the iteration type currently set in
160
- * the object.
161
- * @returns The function `perfectlyBalance` returns a boolean value. It returns `true` if the
162
- * balancing operation is successful, and `false` if there are no nodes to balance.
163
- */
164
- perfectlyBalance(iterationType?: IterationType): boolean;
165
- /**
166
- * Time complexity: O(n)
167
- * Space complexity: O(n)
168
- *
169
- * The function overrides the clone method to create a deep copy of a tree object.
170
- * @returns The `clone()` method is returning a cloned instance of the `TREE` object.
171
- */
172
- clone(): TREE;
173
- /**
174
- * Time Complexity: O(1)
175
- * Space Complexity: O(1)
176
76
  *
177
- * The `_swapProperties` function swaps the properties (key, value, count, height) between two nodes
178
- * in a binary search tree.
179
- * @param {R | BSTNOptKeyOrNode<K, NODE>} srcNode - The `srcNode` parameter represents the source node
180
- * that will be swapped with the `destNode`.
181
- * @param {R | BSTNOptKeyOrNode<K, NODE>} destNode - The `destNode` parameter represents the destination
182
- * node where the properties will be swapped with the source node.
183
- * @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
184
- * If either `srcNode` or `destNode` is undefined, it returns `undefined`.
185
- */
186
- 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;
187
91
  /**
188
- * Time Complexity: O(1)
189
- * Space Complexity: O(1)
92
+ * Time Complexity: O(n)
93
+ * Space Complexity: O(n)
190
94
  *
191
- * The function replaces an old node with a new node and updates the count property of the new node.
192
- * @param {NODE} oldNode - The oldNode parameter represents the node that needs to be replaced in the
193
- * data structure. It is of type NODE.
194
- * @param {NODE} newNode - The `newNode` parameter is an instance of the `NODE` class.
195
- * @returns The method is returning the result of calling the `_replaceNode` method from the
196
- * 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.
197
98
  */
198
- protected _replaceNode(oldNode: NODE, newNode: NODE): NODE;
99
+ clone(): AVLTreeMultiMap<K, V, R, MK, MV, MR>;
199
100
  }