data-structure-typed 2.0.5 → 2.1.0
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/CHANGELOG.md +1 -1
- package/COMMANDS.md +17 -0
- package/benchmark/report.html +13 -77
- package/benchmark/report.json +145 -177
- package/dist/cjs/data-structures/base/iterable-element-base.d.ts +186 -83
- package/dist/cjs/data-structures/base/iterable-element-base.js +149 -107
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.d.ts +95 -119
- package/dist/cjs/data-structures/base/iterable-entry-base.js +59 -116
- package/dist/cjs/data-structures/base/iterable-entry-base.js.map +1 -1
- package/dist/cjs/data-structures/base/linear-base.d.ts +250 -192
- package/dist/cjs/data-structures/base/linear-base.js +137 -274
- package/dist/cjs/data-structures/base/linear-base.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.d.ts +126 -158
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +171 -205
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -69
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +135 -87
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +138 -149
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +208 -195
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +476 -632
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +594 -865
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +258 -306
- package/dist/cjs/data-structures/binary-tree/bst.js +505 -481
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +107 -179
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +114 -209
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-counter.d.ts +132 -154
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +172 -203
- package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +72 -69
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +105 -85
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +238 -233
- package/dist/cjs/data-structures/graph/abstract-graph.js +267 -237
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +108 -224
- package/dist/cjs/data-structures/graph/directed-graph.js +146 -233
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/map-graph.d.ts +49 -55
- package/dist/cjs/data-structures/graph/map-graph.js +56 -59
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +103 -146
- package/dist/cjs/data-structures/graph/undirected-graph.js +129 -149
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/data-structures/hash/hash-map.d.ts +164 -338
- package/dist/cjs/data-structures/hash/hash-map.js +270 -457
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.d.ts +214 -289
- package/dist/cjs/data-structures/heap/heap.js +340 -349
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/max-heap.d.ts +11 -47
- package/dist/cjs/data-structures/heap/max-heap.js +11 -66
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/min-heap.d.ts +12 -47
- package/dist/cjs/data-structures/heap/min-heap.js +11 -66
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +231 -347
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +368 -494
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +261 -310
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +447 -466
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +0 -107
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +0 -100
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +12 -56
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +11 -78
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +11 -57
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +10 -79
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +2 -61
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +8 -83
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +227 -254
- package/dist/cjs/data-structures/queue/deque.js +309 -348
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +180 -201
- package/dist/cjs/data-structures/queue/queue.js +265 -248
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/data-structures/stack/stack.d.ts +124 -102
- package/dist/cjs/data-structures/stack/stack.js +181 -125
- package/dist/cjs/data-structures/stack/stack.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +164 -165
- package/dist/cjs/data-structures/trie/trie.js +189 -172
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +56 -6
- package/dist/cjs/interfaces/graph.d.ts +16 -0
- package/dist/cjs/types/data-structures/base/base.d.ts +1 -1
- package/dist/cjs/types/data-structures/graph/abstract-graph.d.ts +4 -0
- package/dist/cjs/types/utils/utils.d.ts +1 -0
- package/dist/cjs/utils/utils.d.ts +1 -1
- package/dist/cjs/utils/utils.js +2 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/data-structures/base/iterable-element-base.d.ts +186 -83
- package/dist/esm/data-structures/base/iterable-element-base.js +155 -107
- package/dist/esm/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/esm/data-structures/base/iterable-entry-base.d.ts +95 -119
- package/dist/esm/data-structures/base/iterable-entry-base.js +59 -116
- package/dist/esm/data-structures/base/iterable-entry-base.js.map +1 -1
- package/dist/esm/data-structures/base/linear-base.d.ts +250 -192
- package/dist/esm/data-structures/base/linear-base.js +137 -274
- package/dist/esm/data-structures/base/linear-base.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +126 -158
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js +171 -212
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -69
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +133 -94
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree.d.ts +138 -149
- package/dist/esm/data-structures/binary-tree/avl-tree.js +206 -200
- package/dist/esm/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/binary-tree.d.ts +476 -632
- package/dist/esm/data-structures/binary-tree/binary-tree.js +598 -874
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/bst.d.ts +258 -306
- package/dist/esm/data-structures/binary-tree/bst.js +507 -487
- package/dist/esm/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/red-black-tree.d.ts +107 -179
- package/dist/esm/data-structures/binary-tree/red-black-tree.js +114 -215
- package/dist/esm/data-structures/binary-tree/red-black-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/tree-counter.d.ts +132 -154
- package/dist/esm/data-structures/binary-tree/tree-counter.js +175 -209
- package/dist/esm/data-structures/binary-tree/tree-counter.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/tree-multi-map.d.ts +72 -69
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +103 -92
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/esm/data-structures/graph/abstract-graph.d.ts +238 -233
- package/dist/esm/data-structures/graph/abstract-graph.js +267 -237
- package/dist/esm/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/directed-graph.d.ts +108 -224
- package/dist/esm/data-structures/graph/directed-graph.js +145 -233
- package/dist/esm/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/map-graph.d.ts +49 -55
- package/dist/esm/data-structures/graph/map-graph.js +56 -59
- package/dist/esm/data-structures/graph/map-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/undirected-graph.d.ts +103 -146
- package/dist/esm/data-structures/graph/undirected-graph.js +128 -149
- package/dist/esm/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/esm/data-structures/hash/hash-map.d.ts +164 -338
- package/dist/esm/data-structures/hash/hash-map.js +270 -457
- package/dist/esm/data-structures/hash/hash-map.js.map +1 -1
- package/dist/esm/data-structures/heap/heap.d.ts +214 -289
- package/dist/esm/data-structures/heap/heap.js +329 -349
- package/dist/esm/data-structures/heap/heap.js.map +1 -1
- package/dist/esm/data-structures/heap/max-heap.d.ts +11 -47
- package/dist/esm/data-structures/heap/max-heap.js +11 -66
- package/dist/esm/data-structures/heap/max-heap.js.map +1 -1
- package/dist/esm/data-structures/heap/min-heap.d.ts +12 -47
- package/dist/esm/data-structures/heap/min-heap.js +11 -66
- package/dist/esm/data-structures/heap/min-heap.js.map +1 -1
- package/dist/esm/data-structures/linked-list/doubly-linked-list.d.ts +231 -347
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js +368 -495
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/esm/data-structures/linked-list/singly-linked-list.d.ts +261 -310
- package/dist/esm/data-structures/linked-list/singly-linked-list.js +448 -467
- package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/esm/data-structures/linked-list/skip-linked-list.d.ts +0 -107
- package/dist/esm/data-structures/linked-list/skip-linked-list.js +0 -100
- package/dist/esm/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/max-priority-queue.d.ts +12 -56
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js +11 -78
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/min-priority-queue.d.ts +11 -57
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js +10 -79
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/priority-queue.d.ts +2 -61
- package/dist/esm/data-structures/priority-queue/priority-queue.js +8 -83
- package/dist/esm/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/esm/data-structures/queue/deque.d.ts +227 -254
- package/dist/esm/data-structures/queue/deque.js +313 -348
- package/dist/esm/data-structures/queue/deque.js.map +1 -1
- package/dist/esm/data-structures/queue/queue.d.ts +180 -201
- package/dist/esm/data-structures/queue/queue.js +263 -248
- package/dist/esm/data-structures/queue/queue.js.map +1 -1
- package/dist/esm/data-structures/stack/stack.d.ts +124 -102
- package/dist/esm/data-structures/stack/stack.js +181 -125
- package/dist/esm/data-structures/stack/stack.js.map +1 -1
- package/dist/esm/data-structures/trie/trie.d.ts +164 -165
- package/dist/esm/data-structures/trie/trie.js +193 -172
- package/dist/esm/data-structures/trie/trie.js.map +1 -1
- package/dist/esm/interfaces/binary-tree.d.ts +56 -6
- package/dist/esm/interfaces/graph.d.ts +16 -0
- package/dist/esm/types/data-structures/base/base.d.ts +1 -1
- package/dist/esm/types/data-structures/graph/abstract-graph.d.ts +4 -0
- package/dist/esm/types/utils/utils.d.ts +1 -0
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.js +2 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/umd/data-structure-typed.js +4685 -6477
- package/dist/umd/data-structure-typed.min.js +8 -6
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +3 -4
- package/src/data-structures/base/iterable-element-base.ts +238 -115
- package/src/data-structures/base/iterable-entry-base.ts +96 -120
- package/src/data-structures/base/linear-base.ts +271 -277
- package/src/data-structures/binary-tree/avl-tree-counter.ts +198 -216
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +192 -101
- package/src/data-structures/binary-tree/avl-tree.ts +239 -206
- package/src/data-structures/binary-tree/binary-tree.ts +660 -889
- package/src/data-structures/binary-tree/bst.ts +568 -570
- package/src/data-structures/binary-tree/red-black-tree.ts +161 -222
- package/src/data-structures/binary-tree/tree-counter.ts +199 -218
- package/src/data-structures/binary-tree/tree-multi-map.ts +131 -97
- package/src/data-structures/graph/abstract-graph.ts +339 -264
- package/src/data-structures/graph/directed-graph.ts +146 -236
- package/src/data-structures/graph/map-graph.ts +63 -60
- package/src/data-structures/graph/undirected-graph.ts +129 -152
- package/src/data-structures/hash/hash-map.ts +274 -496
- package/src/data-structures/heap/heap.ts +389 -402
- package/src/data-structures/heap/max-heap.ts +12 -76
- package/src/data-structures/heap/min-heap.ts +13 -76
- package/src/data-structures/linked-list/doubly-linked-list.ts +426 -530
- package/src/data-structures/linked-list/singly-linked-list.ts +495 -517
- package/src/data-structures/linked-list/skip-linked-list.ts +1 -108
- package/src/data-structures/priority-queue/max-priority-queue.ts +12 -87
- package/src/data-structures/priority-queue/min-priority-queue.ts +11 -88
- package/src/data-structures/priority-queue/priority-queue.ts +3 -92
- package/src/data-structures/queue/deque.ts +381 -357
- package/src/data-structures/queue/queue.ts +310 -264
- package/src/data-structures/stack/stack.ts +217 -131
- package/src/data-structures/trie/trie.ts +240 -175
- package/src/interfaces/binary-tree.ts +240 -6
- package/src/interfaces/graph.ts +37 -0
- package/src/types/data-structures/base/base.ts +5 -5
- package/src/types/data-structures/graph/abstract-graph.ts +5 -0
- package/src/types/utils/utils.ts +2 -0
- package/src/utils/utils.ts +9 -14
- package/test/integration/index.html +1 -1
- package/test/performance/benchmark-runner.ts +528 -0
- package/test/performance/reportor.mjs +43 -43
- package/test/performance/runner-config.json +39 -0
- package/test/performance/single-suite-runner.ts +69 -0
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +350 -90
- package/test/unit/data-structures/binary-tree/bst.test.ts +12 -9
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +25 -24
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +3 -3
- package/test/unit/data-structures/graph/abstract-graph.test.ts +0 -4
- package/test/unit/data-structures/graph/directed-graph.test.ts +1 -1
- package/test/unit/data-structures/heap/heap.test.ts +14 -21
- package/test/unit/data-structures/heap/max-heap.test.ts +5 -9
- package/test/unit/data-structures/heap/min-heap.test.ts +1 -4
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +14 -14
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -7
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +8 -11
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -4
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +1 -4
- package/test/unit/data-structures/queue/queue.test.ts +4 -5
- package/test/unit/utils/utils.test.ts +0 -1
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +0 -71
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +0 -81
|
@@ -5,30 +5,60 @@
|
|
|
5
5
|
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
|
-
import type { TreeMultiMapOptions } from '../../types';
|
|
8
|
+
import type { ElemOf, EntryCallback, RedBlackTreeOptions, TreeMultiMapOptions } from '../../types';
|
|
9
9
|
import { RedBlackTree, RedBlackTreeNode } from './red-black-tree';
|
|
10
10
|
import { IBinaryTree } from '../../interfaces';
|
|
11
|
+
/**
|
|
12
|
+
* Node used by TreeMultiMap; stores the key with a bucket of values (array).
|
|
13
|
+
* @remarks Time O(1), Space O(1)
|
|
14
|
+
* @template K
|
|
15
|
+
* @template V
|
|
16
|
+
*/
|
|
11
17
|
export declare class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<K, V[]> {
|
|
12
18
|
parent?: TreeMultiMapNode<K, V>;
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param {V[]} value - The `value` parameter in the constructor represents an array of values of
|
|
20
|
-
* type `V`.
|
|
20
|
+
* Create a TreeMultiMap node with an optional value bucket.
|
|
21
|
+
* @remarks Time O(1), Space O(1)
|
|
22
|
+
* @param key - Key of the node.
|
|
23
|
+
* @param [value] - Initial array of values.
|
|
24
|
+
* @returns New TreeMultiMapNode instance.
|
|
21
25
|
*/
|
|
22
26
|
constructor(key: K, value?: V[]);
|
|
23
27
|
_left?: TreeMultiMapNode<K, V> | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get the left child pointer.
|
|
30
|
+
* @remarks Time O(1), Space O(1)
|
|
31
|
+
* @returns Left child node, or null/undefined.
|
|
32
|
+
*/
|
|
24
33
|
get left(): TreeMultiMapNode<K, V> | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Set the left child and update its parent pointer.
|
|
36
|
+
* @remarks Time O(1), Space O(1)
|
|
37
|
+
* @param v - New left child node, or null/undefined.
|
|
38
|
+
* @returns void
|
|
39
|
+
*/
|
|
25
40
|
set left(v: TreeMultiMapNode<K, V> | null | undefined);
|
|
26
41
|
_right?: TreeMultiMapNode<K, V> | null | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get the right child pointer.
|
|
44
|
+
* @remarks Time O(1), Space O(1)
|
|
45
|
+
* @returns Right child node, or null/undefined.
|
|
46
|
+
*/
|
|
27
47
|
get right(): TreeMultiMapNode<K, V> | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Set the right child and update its parent pointer.
|
|
50
|
+
* @remarks Time O(1), Space O(1)
|
|
51
|
+
* @param v - New right child node, or null/undefined.
|
|
52
|
+
* @returns void
|
|
53
|
+
*/
|
|
28
54
|
set right(v: TreeMultiMapNode<K, V> | null | undefined);
|
|
29
55
|
}
|
|
30
56
|
/**
|
|
31
|
-
*
|
|
57
|
+
* Red-Black Tree–based multimap (key → array of values). Preserves O(log N) updates and supports map-like mode.
|
|
58
|
+
* @remarks Time O(1), Space O(1)
|
|
59
|
+
* @template K
|
|
60
|
+
* @template V
|
|
61
|
+
* @template R
|
|
32
62
|
* @example
|
|
33
63
|
* // players ranked by score with their equipment
|
|
34
64
|
* type Equipment = {
|
|
@@ -194,74 +224,47 @@ export declare class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode
|
|
|
194
224
|
* // ]
|
|
195
225
|
* // ]
|
|
196
226
|
*/
|
|
197
|
-
export declare class TreeMultiMap<K = any, V = any, R
|
|
227
|
+
export declare class TreeMultiMap<K = any, V = any, R extends object = object> extends RedBlackTree<K, V[], R> implements IBinaryTree<K, V[], R> {
|
|
198
228
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* @param keysNodesEntriesOrRaws -
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* the RedBlackTreeMulti
|
|
205
|
-
* @param [options] - The `options` parameter in the constructor is of type
|
|
206
|
-
* `TreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
|
|
207
|
-
* additional options for configuring the TreeMultiMap instance.
|
|
229
|
+
* Create a TreeMultiMap and optionally bulk-insert items.
|
|
230
|
+
* @remarks Time O(N log N), Space O(N)
|
|
231
|
+
* @param [keysNodesEntriesOrRaws] - Iterable of keys/nodes/entries/raw items to insert.
|
|
232
|
+
* @param [options] - Options for TreeMultiMap (comparator, reverse, map mode).
|
|
233
|
+
* @returns New TreeMultiMap instance.
|
|
208
234
|
*/
|
|
209
235
|
constructor(keysNodesEntriesOrRaws?: Iterable<K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | R>, options?: TreeMultiMapOptions<K, V[], R>);
|
|
210
|
-
|
|
211
|
-
* Time Complexity: O(1)
|
|
212
|
-
* Space Complexity: O(1)
|
|
213
|
-
*
|
|
214
|
-
* The `createTree` function in TypeScript overrides the default implementation to create a new
|
|
215
|
-
* TreeMultiMap with specified options.
|
|
216
|
-
* @param [options] - The `options` parameter in the `createTree` method is of type
|
|
217
|
-
* `TreeMultiMapOptions<K, V[], R>`. This parameter allows you to pass additional configuration
|
|
218
|
-
* options when creating a new `TreeMultiMap` instance. It includes properties such as
|
|
219
|
-
* `iterationType`, `specifyComparable
|
|
220
|
-
* @returns A new instance of `TreeMultiMap` is being returned, with an empty array as the initial
|
|
221
|
-
* data and the provided options merged with the existing properties of the current object.
|
|
222
|
-
*/
|
|
223
|
-
createTree(options?: TreeMultiMapOptions<K, V[], R>): TreeMultiMap<K, V, R, MK, MV, MR>;
|
|
224
|
-
/**
|
|
225
|
-
* Time Complexity: O(1)
|
|
226
|
-
* Space Complexity: O(1)
|
|
227
|
-
*
|
|
228
|
-
* The function `createNode` overrides the creation of a new TreeMultiMapNode with a specified key
|
|
229
|
-
* and value array.
|
|
230
|
-
* @param {K} key - The `key` parameter represents the key of the node being created in the
|
|
231
|
-
* `TreeMultiMap`.
|
|
232
|
-
* @param {V[]} value - The `value` parameter in the `createNode` method represents an array of
|
|
233
|
-
* values associated with a specific key in the TreeMultiMap data structure.
|
|
234
|
-
* @returns A new instance of `TreeMultiMapNode<K, V>` is being returned with the specified key and
|
|
235
|
-
* value. If `_isMapMode` is true, an empty array is passed as the value, otherwise the provided
|
|
236
|
-
* value is used.
|
|
237
|
-
*/
|
|
238
|
-
createNode(key: K, value?: V[]): TreeMultiMapNode<K, V>;
|
|
236
|
+
_createNode(key: K, value?: V[]): TreeMultiMapNode<K, V>;
|
|
239
237
|
add(keyNodeOrEntry: K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined): boolean;
|
|
240
238
|
add(key: K, value: V): boolean;
|
|
241
239
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @param {K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined} keyNodeOrEntry - The `keyNodeOrEntry`
|
|
248
|
-
* parameter in the `deleteValue` function can be either a `BTNRep` object containing a key and an
|
|
249
|
-
* array of values, or just a key itself.
|
|
250
|
-
* @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
|
|
251
|
-
* value that you want to remove from the multi-map data structure associated with a particular key.
|
|
252
|
-
* The function checks if the value exists in the array of values associated with the key, and if
|
|
253
|
-
* found, removes it from the array.
|
|
254
|
-
* @returns The `deleteValue` function returns a boolean value - `true` if the specified `value` was
|
|
255
|
-
* successfully deleted from the values associated with the `keyNodeOrEntry`, and `false` otherwise.
|
|
240
|
+
* Delete a single value from the bucket at a given key. Removes the key if the bucket becomes empty.
|
|
241
|
+
* @remarks Time O(log N), Space O(1)
|
|
242
|
+
* @param keyNodeOrEntry - Key, node, or [key, values] entry to locate the bucket.
|
|
243
|
+
* @param value - Value to remove from the bucket.
|
|
244
|
+
* @returns True if the value was removed; false if not found.
|
|
256
245
|
*/
|
|
257
246
|
deleteValue(keyNodeOrEntry: K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined, value: V): boolean;
|
|
247
|
+
map<MK = K, MVArr extends unknown[] = V[], MR extends object = object>(callback: EntryCallback<K, V[] | undefined, [MK, MVArr]>, options?: Partial<RedBlackTreeOptions<MK, MVArr, MR>>, thisArg?: unknown): TreeMultiMap<MK, ElemOf<MVArr>, MR>;
|
|
248
|
+
map<MK = K, MV = V[], MR extends object = object>(callback: EntryCallback<K, V[] | undefined, [MK, MV]>, options?: Partial<RedBlackTreeOptions<MK, MV, MR>>, thisArg?: unknown): RedBlackTree<MK, MV, MR>;
|
|
249
|
+
/**
|
|
250
|
+
* (Protected) Create an empty instance of the same concrete class.
|
|
251
|
+
* @remarks Time O(1), Space O(1)
|
|
252
|
+
* @template TK
|
|
253
|
+
* @template TV
|
|
254
|
+
* @template TR
|
|
255
|
+
* @param [options] - Optional constructor options for the like-kind instance.
|
|
256
|
+
* @returns An empty like-kind instance.
|
|
257
|
+
*/
|
|
258
|
+
protected _createInstance<TK = K, TV = V, TR extends object = R>(options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): this;
|
|
258
259
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
* @
|
|
260
|
+
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
261
|
+
* @remarks Time O(N log N), Space O(N)
|
|
262
|
+
* @template TK
|
|
263
|
+
* @template TV
|
|
264
|
+
* @template TR
|
|
265
|
+
* @param iter - Iterable used to seed the new tree.
|
|
266
|
+
* @param [options] - Options merged with the current snapshot.
|
|
267
|
+
* @returns A like-kind RedBlackTree built from the iterable.
|
|
265
268
|
*/
|
|
266
|
-
|
|
269
|
+
protected _createLike<TK = K, TV = V, TR extends object = R>(iter?: Iterable<TK | RedBlackTreeNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): RedBlackTree<TK, TV, TR>;
|
|
267
270
|
}
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data-structure-typed
|
|
3
|
+
*
|
|
4
|
+
* @author Pablo Zeng
|
|
5
|
+
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
|
+
* @license MIT License
|
|
7
|
+
*/
|
|
1
8
|
import { RedBlackTree, RedBlackTreeNode } from './red-black-tree';
|
|
9
|
+
/**
|
|
10
|
+
* Node used by TreeMultiMap; stores the key with a bucket of values (array).
|
|
11
|
+
* @remarks Time O(1), Space O(1)
|
|
12
|
+
* @template K
|
|
13
|
+
* @template V
|
|
14
|
+
*/
|
|
2
15
|
export class TreeMultiMapNode extends RedBlackTreeNode {
|
|
3
16
|
parent = undefined;
|
|
4
17
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param {V[]} value - The `value` parameter in the constructor represents an array of values of
|
|
11
|
-
* type `V`.
|
|
18
|
+
* Create a TreeMultiMap node with an optional value bucket.
|
|
19
|
+
* @remarks Time O(1), Space O(1)
|
|
20
|
+
* @param key - Key of the node.
|
|
21
|
+
* @param [value] - Initial array of values.
|
|
22
|
+
* @returns New TreeMultiMapNode instance.
|
|
12
23
|
*/
|
|
13
24
|
constructor(key, value) {
|
|
14
25
|
super(key, value);
|
|
15
26
|
}
|
|
16
27
|
_left = undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get the left child pointer.
|
|
30
|
+
* @remarks Time O(1), Space O(1)
|
|
31
|
+
* @returns Left child node, or null/undefined.
|
|
32
|
+
*/
|
|
17
33
|
get left() {
|
|
18
34
|
return this._left;
|
|
19
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Set the left child and update its parent pointer.
|
|
38
|
+
* @remarks Time O(1), Space O(1)
|
|
39
|
+
* @param v - New left child node, or null/undefined.
|
|
40
|
+
* @returns void
|
|
41
|
+
*/
|
|
20
42
|
set left(v) {
|
|
21
43
|
if (v) {
|
|
22
44
|
v.parent = this;
|
|
@@ -24,9 +46,20 @@ export class TreeMultiMapNode extends RedBlackTreeNode {
|
|
|
24
46
|
this._left = v;
|
|
25
47
|
}
|
|
26
48
|
_right = undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Get the right child pointer.
|
|
51
|
+
* @remarks Time O(1), Space O(1)
|
|
52
|
+
* @returns Right child node, or null/undefined.
|
|
53
|
+
*/
|
|
27
54
|
get right() {
|
|
28
55
|
return this._right;
|
|
29
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Set the right child and update its parent pointer.
|
|
59
|
+
* @remarks Time O(1), Space O(1)
|
|
60
|
+
* @param v - New right child node, or null/undefined.
|
|
61
|
+
* @returns void
|
|
62
|
+
*/
|
|
30
63
|
set right(v) {
|
|
31
64
|
if (v) {
|
|
32
65
|
v.parent = this;
|
|
@@ -35,7 +68,11 @@ export class TreeMultiMapNode extends RedBlackTreeNode {
|
|
|
35
68
|
}
|
|
36
69
|
}
|
|
37
70
|
/**
|
|
38
|
-
*
|
|
71
|
+
* Red-Black Tree–based multimap (key → array of values). Preserves O(log N) updates and supports map-like mode.
|
|
72
|
+
* @remarks Time O(1), Space O(1)
|
|
73
|
+
* @template K
|
|
74
|
+
* @template V
|
|
75
|
+
* @template R
|
|
39
76
|
* @example
|
|
40
77
|
* // players ranked by score with their equipment
|
|
41
78
|
* type Equipment = {
|
|
@@ -203,15 +240,11 @@ export class TreeMultiMapNode extends RedBlackTreeNode {
|
|
|
203
240
|
*/
|
|
204
241
|
export class TreeMultiMap extends RedBlackTree {
|
|
205
242
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* @param keysNodesEntriesOrRaws -
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* the RedBlackTreeMulti
|
|
212
|
-
* @param [options] - The `options` parameter in the constructor is of type
|
|
213
|
-
* `TreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
|
|
214
|
-
* additional options for configuring the TreeMultiMap instance.
|
|
243
|
+
* Create a TreeMultiMap and optionally bulk-insert items.
|
|
244
|
+
* @remarks Time O(N log N), Space O(N)
|
|
245
|
+
* @param [keysNodesEntriesOrRaws] - Iterable of keys/nodes/entries/raw items to insert.
|
|
246
|
+
* @param [options] - Options for TreeMultiMap (comparator, reverse, map mode).
|
|
247
|
+
* @returns New TreeMultiMap instance.
|
|
215
248
|
*/
|
|
216
249
|
constructor(keysNodesEntriesOrRaws = [], options) {
|
|
217
250
|
super([], { ...options });
|
|
@@ -219,59 +252,15 @@ export class TreeMultiMap extends RedBlackTree {
|
|
|
219
252
|
this.addMany(keysNodesEntriesOrRaws);
|
|
220
253
|
}
|
|
221
254
|
}
|
|
222
|
-
|
|
223
|
-
* Time Complexity: O(1)
|
|
224
|
-
* Space Complexity: O(1)
|
|
225
|
-
*
|
|
226
|
-
* The `createTree` function in TypeScript overrides the default implementation to create a new
|
|
227
|
-
* TreeMultiMap with specified options.
|
|
228
|
-
* @param [options] - The `options` parameter in the `createTree` method is of type
|
|
229
|
-
* `TreeMultiMapOptions<K, V[], R>`. This parameter allows you to pass additional configuration
|
|
230
|
-
* options when creating a new `TreeMultiMap` instance. It includes properties such as
|
|
231
|
-
* `iterationType`, `specifyComparable
|
|
232
|
-
* @returns A new instance of `TreeMultiMap` is being returned, with an empty array as the initial
|
|
233
|
-
* data and the provided options merged with the existing properties of the current object.
|
|
234
|
-
*/
|
|
235
|
-
createTree(options) {
|
|
236
|
-
return new TreeMultiMap([], {
|
|
237
|
-
iterationType: this.iterationType,
|
|
238
|
-
specifyComparable: this._specifyComparable,
|
|
239
|
-
toEntryFn: this._toEntryFn,
|
|
240
|
-
isReverse: this._isReverse,
|
|
241
|
-
isMapMode: this._isMapMode,
|
|
242
|
-
...options
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Time Complexity: O(1)
|
|
247
|
-
* Space Complexity: O(1)
|
|
248
|
-
*
|
|
249
|
-
* The function `createNode` overrides the creation of a new TreeMultiMapNode with a specified key
|
|
250
|
-
* and value array.
|
|
251
|
-
* @param {K} key - The `key` parameter represents the key of the node being created in the
|
|
252
|
-
* `TreeMultiMap`.
|
|
253
|
-
* @param {V[]} value - The `value` parameter in the `createNode` method represents an array of
|
|
254
|
-
* values associated with a specific key in the TreeMultiMap data structure.
|
|
255
|
-
* @returns A new instance of `TreeMultiMapNode<K, V>` is being returned with the specified key and
|
|
256
|
-
* value. If `_isMapMode` is true, an empty array is passed as the value, otherwise the provided
|
|
257
|
-
* value is used.
|
|
258
|
-
*/
|
|
259
|
-
createNode(key, value = []) {
|
|
255
|
+
_createNode(key, value = []) {
|
|
260
256
|
return new TreeMultiMapNode(key, this._isMapMode ? [] : value);
|
|
261
257
|
}
|
|
262
258
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* @param [key] - The `key` parameter in the `override add` method represents the key of the entry to
|
|
269
|
-
* be added to the TreeMultiMap. It can be of type `K`, which is the key type of the TreeMultiMap, or
|
|
270
|
-
* it can be a TreeMultiMapNode containing the key and its
|
|
271
|
-
* @param {V[]} [values] - The `values` parameter in the `add` method represents an array of values
|
|
272
|
-
* that you want to add to the TreeMultiMap. It can contain one or more values of type `V`.
|
|
273
|
-
* @returns The `add` method is returning a boolean value, which indicates whether the operation was
|
|
274
|
-
* successful or not.
|
|
259
|
+
* Insert a value or a list of values into the multimap. If the key exists, values are appended.
|
|
260
|
+
* @remarks Time O(log N + M), Space O(1)
|
|
261
|
+
* @param keyNodeOrEntry - Key, node, or [key, values] entry.
|
|
262
|
+
* @param [value] - Single value to add when a bare key is provided.
|
|
263
|
+
* @returns True if inserted or appended; false if ignored.
|
|
275
264
|
*/
|
|
276
265
|
add(keyNodeOrEntry, value) {
|
|
277
266
|
if (this.isRealNode(keyNodeOrEntry))
|
|
@@ -321,20 +310,11 @@ export class TreeMultiMap extends RedBlackTree {
|
|
|
321
310
|
return _commonAdd(keyNodeOrEntry, value !== undefined ? [value] : undefined);
|
|
322
311
|
}
|
|
323
312
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* @param {K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined} keyNodeOrEntry - The `keyNodeOrEntry`
|
|
330
|
-
* parameter in the `deleteValue` function can be either a `BTNRep` object containing a key and an
|
|
331
|
-
* array of values, or just a key itself.
|
|
332
|
-
* @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
|
|
333
|
-
* value that you want to remove from the multi-map data structure associated with a particular key.
|
|
334
|
-
* The function checks if the value exists in the array of values associated with the key, and if
|
|
335
|
-
* found, removes it from the array.
|
|
336
|
-
* @returns The `deleteValue` function returns a boolean value - `true` if the specified `value` was
|
|
337
|
-
* successfully deleted from the values associated with the `keyNodeOrEntry`, and `false` otherwise.
|
|
313
|
+
* Delete a single value from the bucket at a given key. Removes the key if the bucket becomes empty.
|
|
314
|
+
* @remarks Time O(log N), Space O(1)
|
|
315
|
+
* @param keyNodeOrEntry - Key, node, or [key, values] entry to locate the bucket.
|
|
316
|
+
* @param value - Value to remove from the bucket.
|
|
317
|
+
* @returns True if the value was removed; false if not found.
|
|
338
318
|
*/
|
|
339
319
|
deleteValue(keyNodeOrEntry, value) {
|
|
340
320
|
const values = this.get(keyNodeOrEntry);
|
|
@@ -343,7 +323,6 @@ export class TreeMultiMap extends RedBlackTree {
|
|
|
343
323
|
if (index === -1)
|
|
344
324
|
return false;
|
|
345
325
|
values.splice(index, 1);
|
|
346
|
-
// If no values left, remove the entire node
|
|
347
326
|
if (values.length === 0)
|
|
348
327
|
this.delete(keyNodeOrEntry);
|
|
349
328
|
return true;
|
|
@@ -351,17 +330,49 @@ export class TreeMultiMap extends RedBlackTree {
|
|
|
351
330
|
return false;
|
|
352
331
|
}
|
|
353
332
|
/**
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* @
|
|
333
|
+
* Create a new tree by mapping each [key, values] bucket.
|
|
334
|
+
* @remarks Time O(N log N), Space O(N)
|
|
335
|
+
* @template MK
|
|
336
|
+
* @template MV
|
|
337
|
+
* @template MR
|
|
338
|
+
* @param callback - Function mapping (key, values, index, tree) → [newKey, newValue].
|
|
339
|
+
* @param [options] - Options for the output tree.
|
|
340
|
+
* @param [thisArg] - Value for `this` inside the callback.
|
|
341
|
+
* @returns A new RedBlackTree (or TreeMultiMap when mapping to array values; see overloads).
|
|
342
|
+
*/
|
|
343
|
+
map(callback, options, thisArg) {
|
|
344
|
+
const out = this._createLike([], options);
|
|
345
|
+
let i = 0;
|
|
346
|
+
for (const [k, v] of this)
|
|
347
|
+
out.add(callback.call(thisArg, k, v, i++, this));
|
|
348
|
+
return out;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* (Protected) Create an empty instance of the same concrete class.
|
|
352
|
+
* @remarks Time O(1), Space O(1)
|
|
353
|
+
* @template TK
|
|
354
|
+
* @template TV
|
|
355
|
+
* @template TR
|
|
356
|
+
* @param [options] - Optional constructor options for the like-kind instance.
|
|
357
|
+
* @returns An empty like-kind instance.
|
|
358
|
+
*/
|
|
359
|
+
_createInstance(options) {
|
|
360
|
+
const Ctor = this.constructor;
|
|
361
|
+
return new Ctor([], { ...(this._snapshotOptions?.() ?? {}), ...(options ?? {}) });
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
365
|
+
* @remarks Time O(N log N), Space O(N)
|
|
366
|
+
* @template TK
|
|
367
|
+
* @template TV
|
|
368
|
+
* @template TR
|
|
369
|
+
* @param iter - Iterable used to seed the new tree.
|
|
370
|
+
* @param [options] - Options merged with the current snapshot.
|
|
371
|
+
* @returns A like-kind RedBlackTree built from the iterable.
|
|
360
372
|
*/
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
this.
|
|
364
|
-
return cloned;
|
|
373
|
+
_createLike(iter = [], options) {
|
|
374
|
+
const Ctor = this.constructor;
|
|
375
|
+
return new Ctor(iter, { ...(this._snapshotOptions?.() ?? {}), ...(options ?? {}) });
|
|
365
376
|
}
|
|
366
377
|
}
|
|
367
378
|
//# sourceMappingURL=tree-multi-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-multi-map.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/tree-multi-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree-multi-map.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/tree-multi-map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE;;;;;GAKG;AACH,MAAM,OAAO,gBAAmC,SAAQ,gBAAwB;IACrE,MAAM,GAA4B,SAAS,CAAC;IAErD;;;;;;OAMG;IACH,YAAY,GAAM,EAAE,KAAW;QAC7B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpB,CAAC;IAEQ,KAAK,GAA+C,SAAS,CAAC;IAEvE;;;;OAIG;IACH,IAAa,IAAI;QACf,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,IAAa,IAAI,CAAC,CAA4C;QAC5D,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,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