data-structure-typed 1.54.2 → 2.0.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/LICENSE +2 -2
- package/README.md +14 -1
- package/README_zh-CN.md +1 -1
- package/benchmark/report.html +28 -1
- package/benchmark/report.json +327 -18
- package/dist/cjs/data-structures/base/iterable-element-base.d.ts +14 -40
- package/dist/cjs/data-structures/base/iterable-element-base.js +14 -11
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/cjs/data-structures/base/linear-base.d.ts +277 -0
- package/dist/cjs/data-structures/base/linear-base.js +553 -0
- package/dist/cjs/data-structures/base/linear-base.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.d.ts +21 -20
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +8 -7
- 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 +23 -19
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +51 -38
- 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 +89 -21
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +76 -8
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +173 -225
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +244 -149
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +62 -56
- package/dist/cjs/data-structures/binary-tree/bst.js +89 -133
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +19 -25
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +7 -13
- 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 +19 -19
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +12 -12
- 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 +186 -25
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +211 -41
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.js +2 -2
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.d.ts +3 -11
- package/dist/cjs/data-structures/heap/heap.js +0 -10
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/max-heap.d.ts +2 -2
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/min-heap.d.ts +2 -2
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +65 -94
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +131 -146
- 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 +79 -75
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +217 -169
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
- 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 +2 -2
- 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 -2
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +130 -91
- package/dist/cjs/data-structures/queue/deque.js +269 -169
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +84 -40
- package/dist/cjs/data-structures/queue/queue.js +134 -50
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/data-structures/stack/stack.d.ts +3 -11
- package/dist/cjs/data-structures/stack/stack.js +0 -10
- package/dist/cjs/data-structures/stack/stack.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +4 -3
- package/dist/cjs/data-structures/trie/trie.js +3 -0
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/types/data-structures/base/base.d.ts +9 -4
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -0
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +1 -1
- package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -1
- package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
- package/dist/cjs/types/data-structures/linked-list/singly-linked-list.d.ts +2 -2
- package/dist/cjs/types/data-structures/queue/deque.d.ts +2 -3
- package/dist/cjs/types/data-structures/queue/queue.d.ts +2 -2
- package/dist/cjs/utils/utils.d.ts +2 -2
- package/dist/esm/data-structures/base/iterable-element-base.d.ts +14 -40
- package/dist/esm/data-structures/base/iterable-element-base.js +14 -11
- package/dist/esm/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/esm/data-structures/base/linear-base.d.ts +277 -0
- package/dist/esm/data-structures/base/linear-base.js +549 -0
- package/dist/esm/data-structures/base/linear-base.js.map +1 -0
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +21 -20
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js +9 -8
- 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 +23 -19
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +52 -38
- 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 +89 -21
- package/dist/esm/data-structures/binary-tree/avl-tree.js +77 -9
- package/dist/esm/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/binary-tree.d.ts +173 -225
- package/dist/esm/data-structures/binary-tree/binary-tree.js +248 -153
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/bst.d.ts +62 -56
- package/dist/esm/data-structures/binary-tree/bst.js +90 -132
- package/dist/esm/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/red-black-tree.d.ts +19 -25
- package/dist/esm/data-structures/binary-tree/red-black-tree.js +8 -14
- 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 +19 -19
- package/dist/esm/data-structures/binary-tree/tree-counter.js +13 -13
- 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 +186 -25
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +212 -41
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/esm/data-structures/graph/abstract-graph.js +2 -2
- package/dist/esm/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/esm/data-structures/heap/heap.d.ts +3 -11
- package/dist/esm/data-structures/heap/heap.js +0 -10
- package/dist/esm/data-structures/heap/heap.js.map +1 -1
- package/dist/esm/data-structures/heap/max-heap.d.ts +2 -2
- package/dist/esm/data-structures/heap/max-heap.js.map +1 -1
- package/dist/esm/data-structures/heap/min-heap.d.ts +2 -2
- package/dist/esm/data-structures/heap/min-heap.js.map +1 -1
- package/dist/esm/data-structures/linked-list/doubly-linked-list.d.ts +65 -94
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js +132 -148
- 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 +79 -75
- package/dist/esm/data-structures/linked-list/singly-linked-list.js +217 -170
- package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
- 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 +2 -2
- 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 -2
- package/dist/esm/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/esm/data-structures/queue/deque.d.ts +130 -91
- package/dist/esm/data-structures/queue/deque.js +269 -169
- package/dist/esm/data-structures/queue/deque.js.map +1 -1
- package/dist/esm/data-structures/queue/queue.d.ts +84 -40
- package/dist/esm/data-structures/queue/queue.js +135 -51
- package/dist/esm/data-structures/queue/queue.js.map +1 -1
- package/dist/esm/data-structures/stack/stack.d.ts +3 -11
- package/dist/esm/data-structures/stack/stack.js +0 -10
- package/dist/esm/data-structures/stack/stack.js.map +1 -1
- package/dist/esm/data-structures/trie/trie.d.ts +4 -3
- package/dist/esm/data-structures/trie/trie.js +3 -0
- package/dist/esm/data-structures/trie/trie.js.map +1 -1
- package/dist/esm/types/data-structures/base/base.d.ts +9 -4
- package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
- package/dist/esm/types/data-structures/binary-tree/binary-tree.d.ts +1 -0
- package/dist/esm/types/data-structures/binary-tree/bst.d.ts +1 -1
- package/dist/esm/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -1
- package/dist/esm/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
- package/dist/esm/types/data-structures/linked-list/singly-linked-list.d.ts +2 -2
- package/dist/esm/types/data-structures/queue/deque.d.ts +2 -3
- package/dist/esm/types/data-structures/queue/queue.d.ts +2 -2
- package/dist/esm/utils/utils.d.ts +2 -2
- package/dist/umd/data-structure-typed.js +1548 -920
- package/dist/umd/data-structure-typed.min.js +5 -12
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +7 -7
- package/src/data-structures/base/iterable-element-base.ts +29 -20
- package/src/data-structures/base/linear-base.ts +649 -0
- package/src/data-structures/binary-tree/avl-tree-counter.ts +30 -23
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +74 -49
- package/src/data-structures/binary-tree/avl-tree.ts +99 -29
- package/src/data-structures/binary-tree/binary-tree.ts +474 -257
- package/src/data-structures/binary-tree/bst.ts +150 -152
- package/src/data-structures/binary-tree/red-black-tree.ts +27 -35
- package/src/data-structures/binary-tree/tree-counter.ts +33 -27
- package/src/data-structures/binary-tree/tree-multi-map.ts +235 -53
- package/src/data-structures/graph/abstract-graph.ts +2 -2
- package/src/data-structures/heap/heap.ts +3 -14
- package/src/data-structures/heap/max-heap.ts +2 -2
- package/src/data-structures/heap/min-heap.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +144 -160
- package/src/data-structures/linked-list/singly-linked-list.ts +241 -185
- package/src/data-structures/priority-queue/max-priority-queue.ts +2 -5
- package/src/data-structures/priority-queue/min-priority-queue.ts +2 -5
- package/src/data-structures/priority-queue/priority-queue.ts +2 -2
- package/src/data-structures/queue/deque.ts +286 -183
- package/src/data-structures/queue/queue.ts +149 -63
- package/src/data-structures/stack/stack.ts +3 -18
- package/src/data-structures/trie/trie.ts +7 -3
- package/src/types/data-structures/base/base.ts +17 -8
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
- package/src/types/data-structures/binary-tree/binary-tree.ts +1 -0
- package/src/types/data-structures/binary-tree/bst.ts +1 -1
- package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -1
- package/src/types/data-structures/linked-list/doubly-linked-list.ts +2 -2
- package/src/types/data-structures/linked-list/singly-linked-list.ts +2 -2
- package/src/types/data-structures/queue/deque.ts +2 -3
- package/src/types/data-structures/queue/queue.ts +2 -2
- package/src/utils/utils.ts +2 -2
- package/test/integration/all-in-one.test.ts +1 -1
- package/test/integration/avl-tree.test.ts +1 -1
- package/test/integration/bst.test.ts +2 -2
- package/test/integration/compile.mjs +21 -21
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +71 -0
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +81 -0
- package/test/performance/{reportor.js → reportor.mjs} +264 -8
- package/test/performance/reportor.ts +1 -1
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +7 -7
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +172 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +72 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +132 -82
- package/test/unit/data-structures/binary-tree/bst.test.ts +12 -12
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +5 -13
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +168 -10
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +135 -27
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +111 -11
- package/test/unit/data-structures/queue/deque.test.ts +241 -60
- package/test/unit/data-structures/queue/queue.test.ts +118 -19
- package/test/unit/unrestricted-interconversion.test.ts +1 -1
- package/test/utils/json2html.ts +0 -154
- package/test/performance/data-structures/binary-tree/avl-tree.test.js +0 -45
- /package/test/performance/data-structures/binary-tree/{rb-tree.test.ts → red-black-tree.test.ts} +0 -0
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
|
-
import type { AVLTreeCounterOptions, BinaryTreeDeleteResult, BSTNOptKeyOrNode,
|
|
8
|
+
import type { AVLTreeCounterOptions, BinaryTreeDeleteResult, BSTNOptKeyOrNode, EntryCallback, IterationType } from '../../types';
|
|
9
9
|
import { IBinaryTree } from '../../interfaces';
|
|
10
10
|
import { AVLTree, AVLTreeNode } from './avl-tree';
|
|
11
11
|
export declare class AVLTreeCounterNode<K = any, V = any> extends AVLTreeNode<K, V> {
|
|
12
|
+
parent?: AVLTreeCounterNode<K, V>;
|
|
12
13
|
/**
|
|
13
14
|
* The constructor function initializes a BinaryTreeNode object with a key, value, and count.
|
|
14
15
|
* @param {K} key - The `key` parameter is of type `K` and represents the unique identifier
|
|
@@ -20,13 +21,12 @@ export declare class AVLTreeCounterNode<K = any, V = any> extends AVLTreeNode<K,
|
|
|
20
21
|
* parameter when creating a new instance of the `BinaryTreeNode` class.
|
|
21
22
|
*/
|
|
22
23
|
constructor(key: K, value?: V, count?: number);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
set right(v: OptNodeOrNull<AVLTreeCounterNode<K, V>>);
|
|
24
|
+
_left?: AVLTreeCounterNode<K, V> | null | undefined;
|
|
25
|
+
get left(): AVLTreeCounterNode<K, V> | null | undefined;
|
|
26
|
+
set left(v: AVLTreeCounterNode<K, V> | null | undefined);
|
|
27
|
+
_right?: AVLTreeCounterNode<K, V> | null | undefined;
|
|
28
|
+
get right(): AVLTreeCounterNode<K, V> | null | undefined;
|
|
29
|
+
set right(v: AVLTreeCounterNode<K, V> | null | undefined);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* The only distinction between a AVLTreeCounter and a AVLTree lies in the ability of the former to store duplicate nodes through the utilization of counters.
|
|
@@ -40,7 +40,7 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
40
40
|
* behavior of the AVLTreeCounter. It can include properties such as `compareKeys` and
|
|
41
41
|
* `compareValues` functions to define custom comparison logic for keys and values, respectively.
|
|
42
42
|
*/
|
|
43
|
-
constructor(keysNodesEntriesOrRaws?: Iterable<
|
|
43
|
+
constructor(keysNodesEntriesOrRaws?: Iterable<K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, options?: AVLTreeCounterOptions<K, V, R>);
|
|
44
44
|
protected _count: number;
|
|
45
45
|
/**
|
|
46
46
|
* The function calculates the sum of the count property of all nodes in a tree using depth-first
|
|
@@ -79,21 +79,21 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
79
79
|
createTree(options?: AVLTreeCounterOptions<K, V, R>): AVLTreeCounter<K, V, R, MK, MV, MR>;
|
|
80
80
|
/**
|
|
81
81
|
* The function checks if the input is an instance of AVLTreeCounterNode.
|
|
82
|
-
* @param {
|
|
83
|
-
* `keyNodeOrEntry` can be of type `R` or `
|
|
82
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The parameter
|
|
83
|
+
* `keyNodeOrEntry` can be of type `R` or `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`.
|
|
84
84
|
* @returns a boolean value indicating whether the input parameter `keyNodeOrEntry` is
|
|
85
85
|
* an instance of the `AVLTreeCounterNode` class.
|
|
86
86
|
*/
|
|
87
|
-
isNode(keyNodeOrEntry:
|
|
87
|
+
isNode(keyNodeOrEntry: K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined): keyNodeOrEntry is AVLTreeCounterNode<K, V>;
|
|
88
88
|
/**
|
|
89
89
|
* Time Complexity: O(log n)
|
|
90
90
|
* Space Complexity: O(1)
|
|
91
91
|
*
|
|
92
92
|
* The function overrides the add method of a TypeScript class to add a new node to a data structure
|
|
93
93
|
* and update the count.
|
|
94
|
-
* @param {
|
|
94
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The
|
|
95
95
|
* `keyNodeOrEntry` parameter can accept a value of type `R`, which can be any type. It
|
|
96
|
-
* can also accept a value of type `
|
|
96
|
+
* can also accept a value of type `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`, which represents a key, node,
|
|
97
97
|
* entry, or raw element
|
|
98
98
|
* @param {V} [value] - The `value` parameter represents the value associated with the key in the
|
|
99
99
|
* data structure. It is an optional parameter, so it can be omitted if not needed.
|
|
@@ -102,14 +102,14 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
102
102
|
* be added once. However, you can specify a different value for `count` if you want to add
|
|
103
103
|
* @returns a boolean value.
|
|
104
104
|
*/
|
|
105
|
-
add(keyNodeOrEntry:
|
|
105
|
+
add(keyNodeOrEntry: K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, value?: V, count?: number): boolean;
|
|
106
106
|
/**
|
|
107
107
|
* Time Complexity: O(log n)
|
|
108
108
|
* Space Complexity: O(1)
|
|
109
109
|
*
|
|
110
110
|
* The function overrides the delete method in a binary tree data structure, handling deletion of
|
|
111
111
|
* nodes and maintaining balance in the tree.
|
|
112
|
-
* @param {
|
|
112
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The `predicate`
|
|
113
113
|
* parameter in the `delete` method is used to specify the condition for deleting a node from the
|
|
114
114
|
* binary tree. It can be a key, node, or entry that determines which
|
|
115
115
|
* node(s) should be deleted.
|
|
@@ -122,7 +122,7 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
122
122
|
* method returns an array of `BinaryTreeDeleteResult` objects, each containing information about the
|
|
123
123
|
* deleted node and whether balancing is needed in the tree.
|
|
124
124
|
*/
|
|
125
|
-
delete(keyNodeOrEntry:
|
|
125
|
+
delete(keyNodeOrEntry: K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, ignoreCount?: boolean): BinaryTreeDeleteResult<AVLTreeCounterNode<K, V>>[];
|
|
126
126
|
/**
|
|
127
127
|
* Time Complexity: O(1)
|
|
128
128
|
* Space Complexity: O(1)
|
|
@@ -134,6 +134,7 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
134
134
|
/**
|
|
135
135
|
* Time Complexity: O(n log n)
|
|
136
136
|
* Space Complexity: O(log n)
|
|
137
|
+
*
|
|
137
138
|
* The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
|
|
138
139
|
* tree using either a recursive or iterative approach.
|
|
139
140
|
* @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
|
|
@@ -174,8 +175,8 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
174
175
|
/**
|
|
175
176
|
* The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
|
|
176
177
|
* a node object.
|
|
177
|
-
* @param {
|
|
178
|
-
* `keyNodeOrEntry` parameter can be of type `R` or `
|
|
178
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The
|
|
179
|
+
* `keyNodeOrEntry` parameter can be of type `R` or `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`.
|
|
179
180
|
* @param {V} [value] - The `value` parameter is an optional value that can be passed to the
|
|
180
181
|
* `override` function. It represents the value associated with the key in the data structure. If no
|
|
181
182
|
* value is provided, it will default to `undefined`.
|
|
@@ -183,7 +184,7 @@ export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV =
|
|
|
183
184
|
* times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
|
|
184
185
|
* @returns either a AVLTreeCounterNode<K, V> object or undefined.
|
|
185
186
|
*/
|
|
186
|
-
protected _keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry:
|
|
187
|
+
protected _keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry: K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, value?: V, count?: number): [AVLTreeCounterNode<K, V> | undefined, V | undefined];
|
|
187
188
|
/**
|
|
188
189
|
* Time Complexity: O(1)
|
|
189
190
|
* Space Complexity: O(1)
|
|
@@ -105,8 +105,8 @@ class AVLTreeCounter extends avl_tree_1.AVLTree {
|
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* The function checks if the input is an instance of AVLTreeCounterNode.
|
|
108
|
-
* @param {
|
|
109
|
-
* `keyNodeOrEntry` can be of type `R` or `
|
|
108
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The parameter
|
|
109
|
+
* `keyNodeOrEntry` can be of type `R` or `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`.
|
|
110
110
|
* @returns a boolean value indicating whether the input parameter `keyNodeOrEntry` is
|
|
111
111
|
* an instance of the `AVLTreeCounterNode` class.
|
|
112
112
|
*/
|
|
@@ -119,9 +119,9 @@ class AVLTreeCounter extends avl_tree_1.AVLTree {
|
|
|
119
119
|
*
|
|
120
120
|
* The function overrides the add method of a TypeScript class to add a new node to a data structure
|
|
121
121
|
* and update the count.
|
|
122
|
-
* @param {
|
|
122
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The
|
|
123
123
|
* `keyNodeOrEntry` parameter can accept a value of type `R`, which can be any type. It
|
|
124
|
-
* can also accept a value of type `
|
|
124
|
+
* can also accept a value of type `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`, which represents a key, node,
|
|
125
125
|
* entry, or raw element
|
|
126
126
|
* @param {V} [value] - The `value` parameter represents the value associated with the key in the
|
|
127
127
|
* data structure. It is an optional parameter, so it can be omitted if not needed.
|
|
@@ -147,7 +147,7 @@ class AVLTreeCounter extends avl_tree_1.AVLTree {
|
|
|
147
147
|
*
|
|
148
148
|
* The function overrides the delete method in a binary tree data structure, handling deletion of
|
|
149
149
|
* nodes and maintaining balance in the tree.
|
|
150
|
-
* @param {
|
|
150
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The `predicate`
|
|
151
151
|
* parameter in the `delete` method is used to specify the condition for deleting a node from the
|
|
152
152
|
* binary tree. It can be a key, node, or entry that determines which
|
|
153
153
|
* node(s) should be deleted.
|
|
@@ -232,6 +232,7 @@ class AVLTreeCounter extends avl_tree_1.AVLTree {
|
|
|
232
232
|
/**
|
|
233
233
|
* Time Complexity: O(n log n)
|
|
234
234
|
* Space Complexity: O(log n)
|
|
235
|
+
*
|
|
235
236
|
* The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
|
|
236
237
|
* tree using either a recursive or iterative approach.
|
|
237
238
|
* @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
|
|
@@ -329,8 +330,8 @@ class AVLTreeCounter extends avl_tree_1.AVLTree {
|
|
|
329
330
|
/**
|
|
330
331
|
* The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
|
|
331
332
|
* a node object.
|
|
332
|
-
* @param {
|
|
333
|
-
* `keyNodeOrEntry` parameter can be of type `R` or `
|
|
333
|
+
* @param {K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined} keyNodeOrEntry - The
|
|
334
|
+
* `keyNodeOrEntry` parameter can be of type `R` or `K | AVLTreeCounterNode<K, V> | [K | null | undefined, V | undefined] | null | undefined`.
|
|
334
335
|
* @param {V} [value] - The `value` parameter is an optional value that can be passed to the
|
|
335
336
|
* `override` function. It represents the value associated with the key in the data structure. If no
|
|
336
337
|
* value is provided, it will default to `undefined`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avl-tree-counter.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree-counter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"avl-tree-counter.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree-counter.ts"],"names":[],"mappings":";;;AA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,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;gBAC/B,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YACnC,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACgB,YAAY,CAC7B,OAAiC,EACjC,OAAiC;QAEjC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC9C,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF;AApZD,wCAoZC"}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
|
-
import { AVLTreeMultiMapOptions
|
|
8
|
+
import { AVLTreeMultiMapOptions } from '../../types';
|
|
9
9
|
import { AVLTree, AVLTreeNode } from './avl-tree';
|
|
10
10
|
import { IBinaryTree } from '../../interfaces';
|
|
11
11
|
export declare class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K, V[]> {
|
|
12
|
+
parent?: AVLTreeMultiMapNode<K, V>;
|
|
12
13
|
/**
|
|
13
14
|
* This TypeScript constructor initializes an object with a key of type K and an array of values of
|
|
14
15
|
* type V.
|
|
@@ -19,13 +20,12 @@ export declare class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K
|
|
|
19
20
|
* type `V`.
|
|
20
21
|
*/
|
|
21
22
|
constructor(key: K, value: V[]);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
set right(v: OptNodeOrNull<AVLTreeMultiMapNode<K, V>>);
|
|
23
|
+
_left?: AVLTreeMultiMapNode<K, V> | null | undefined;
|
|
24
|
+
get left(): AVLTreeMultiMapNode<K, V> | null | undefined;
|
|
25
|
+
set left(v: AVLTreeMultiMapNode<K, V> | null | undefined);
|
|
26
|
+
_right?: AVLTreeMultiMapNode<K, V> | null | undefined;
|
|
27
|
+
get right(): AVLTreeMultiMapNode<K, V> | null | undefined;
|
|
28
|
+
set right(v: AVLTreeMultiMapNode<K, V> | null | undefined);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
@@ -42,7 +42,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV
|
|
|
42
42
|
* `AVLTreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
|
|
43
43
|
* additional options for configuring the AVLTreeMultiMap instance.
|
|
44
44
|
*/
|
|
45
|
-
constructor(keysNodesEntriesOrRaws?: Iterable<
|
|
45
|
+
constructor(keysNodesEntriesOrRaws?: Iterable<K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | R>, options?: AVLTreeMultiMapOptions<K, V[], R>);
|
|
46
46
|
/**
|
|
47
47
|
* Time Complexity: O(1)
|
|
48
48
|
* Space Complexity: O(1)
|
|
@@ -60,15 +60,19 @@ export declare class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV
|
|
|
60
60
|
* Time Complexity: O(1)
|
|
61
61
|
* Space Complexity: O(1)
|
|
62
62
|
*
|
|
63
|
-
* The
|
|
64
|
-
* specified key and
|
|
65
|
-
* @param {K} key - The `key` parameter
|
|
66
|
-
*
|
|
67
|
-
* @
|
|
68
|
-
*
|
|
63
|
+
* The `createNode` function in TypeScript overrides the default implementation to create a new
|
|
64
|
+
* AVLTreeMultiMapNode with a specified key and value array.
|
|
65
|
+
* @param {K} key - The `key` parameter represents the key of the node being created in the
|
|
66
|
+
* AVLTreeMultiMap.
|
|
67
|
+
* @param {V[]} value - The `value` parameter in the `createNode` method represents an array of
|
|
68
|
+
* values associated with a specific key in the AVLTreeMultiMapNode. If no value is provided when
|
|
69
|
+
* calling the method, an empty array `[]` is used as the default value.
|
|
70
|
+
* @returns An AVLTreeMultiMapNode object is being returned, with the specified key and value. If the
|
|
71
|
+
* AVLTreeMultiMap is in map mode, an empty array is used as the value, otherwise the provided value
|
|
72
|
+
* array is used.
|
|
69
73
|
*/
|
|
70
|
-
createNode(key: K): AVLTreeMultiMapNode<K, V>;
|
|
71
|
-
add(
|
|
74
|
+
createNode(key: K, value?: V[]): AVLTreeMultiMapNode<K, V>;
|
|
75
|
+
add(keyNodeOrEntry: K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined): boolean;
|
|
72
76
|
add(key: K, value: V): boolean;
|
|
73
77
|
/**
|
|
74
78
|
* Time Complexity: O(log n)
|
|
@@ -76,7 +80,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV
|
|
|
76
80
|
*
|
|
77
81
|
* The function `deleteValue` removes a specific value from a key in an AVLTreeMultiMap data
|
|
78
82
|
* structure and deletes the entire node if no values are left for that key.
|
|
79
|
-
* @param {
|
|
83
|
+
* @param {K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | K} keyNodeOrEntry - The `keyNodeOrEntry`
|
|
80
84
|
* parameter in the `deleteValue` function can be either a `BTNRep` object representing a key-value
|
|
81
85
|
* pair in the AVLTreeMultiMapNode, or just the key itself.
|
|
82
86
|
* @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
|
|
@@ -87,7 +91,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV
|
|
|
87
91
|
* `value` was successfully deleted from the array of values associated with the `keyNodeOrEntry`. If
|
|
88
92
|
* the value was not found in the array, it returns `false`.
|
|
89
93
|
*/
|
|
90
|
-
deleteValue(keyNodeOrEntry:
|
|
94
|
+
deleteValue(keyNodeOrEntry: K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | K, value: V): boolean;
|
|
91
95
|
/**
|
|
92
96
|
* Time Complexity: O(n)
|
|
93
97
|
* Space Complexity: O(n)
|
|
@@ -72,37 +72,40 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
|
|
|
72
72
|
* provided options.
|
|
73
73
|
*/
|
|
74
74
|
createTree(options) {
|
|
75
|
-
return new AVLTreeMultiMap([], Object.assign({ iterationType: this.iterationType, specifyComparable: this._specifyComparable, toEntryFn: this._toEntryFn, isReverse: this._isReverse }, options));
|
|
75
|
+
return new AVLTreeMultiMap([], Object.assign({ iterationType: this.iterationType, specifyComparable: this._specifyComparable, toEntryFn: this._toEntryFn, isReverse: this._isReverse, isMapMode: this._isMapMode }, options));
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Time Complexity: O(1)
|
|
79
79
|
* Space Complexity: O(1)
|
|
80
80
|
*
|
|
81
|
-
* The
|
|
82
|
-
* specified key and
|
|
83
|
-
* @param {K} key - The `key` parameter
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
86
|
-
*
|
|
81
|
+
* The `createNode` function in TypeScript overrides the default implementation to create a new
|
|
82
|
+
* AVLTreeMultiMapNode with a specified key and value array.
|
|
83
|
+
* @param {K} key - The `key` parameter represents the key of the node being created in the
|
|
84
|
+
* AVLTreeMultiMap.
|
|
85
|
+
* @param {V[]} value - The `value` parameter in the `createNode` method represents an array of
|
|
86
|
+
* values associated with a specific key in the AVLTreeMultiMapNode. If no value is provided when
|
|
87
|
+
* calling the method, an empty array `[]` is used as the default value.
|
|
88
|
+
* @returns An AVLTreeMultiMapNode object is being returned, with the specified key and value. If the
|
|
89
|
+
* AVLTreeMultiMap is in map mode, an empty array is used as the value, otherwise the provided value
|
|
90
|
+
* array is used.
|
|
87
91
|
*/
|
|
88
|
-
createNode(key) {
|
|
89
|
-
return new AVLTreeMultiMapNode(key, []);
|
|
92
|
+
createNode(key, value = []) {
|
|
93
|
+
return new AVLTreeMultiMapNode(key, this._isMapMode ? [] : value);
|
|
90
94
|
}
|
|
91
95
|
/**
|
|
92
96
|
* Time Complexity: O(log n)
|
|
93
97
|
* Space Complexity: O(log n)
|
|
94
98
|
*
|
|
95
|
-
* The function `add` in TypeScript overrides the superclass method to add key-value pairs
|
|
96
|
-
*
|
|
97
|
-
* @param
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* `values`
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* addition operation was successful or not.
|
|
99
|
+
* The function `add` in this TypeScript code overrides the superclass method to add key-value pairs
|
|
100
|
+
* to an AVLTreeMultiMap, handling different input types and scenarios.
|
|
101
|
+
* @param [key] - The `key` parameter in the `override add` method represents the key of the entry to
|
|
102
|
+
* be added to the AVLTreeMultiMap. It can be of type `K`, which is the key type of the map. The key
|
|
103
|
+
* can be a single key value, a node of the AVLTree
|
|
104
|
+
* @param {V[]} [values] - The `values` parameter in the `add` method represents an array of values
|
|
105
|
+
* that you want to add to the AVLTreeMultiMap. It can contain one or more values associated with a
|
|
106
|
+
* specific key.
|
|
107
|
+
* @returns The `add` method is returning a boolean value, which indicates whether the operation was
|
|
108
|
+
* successful or not.
|
|
106
109
|
*/
|
|
107
110
|
add(keyNodeOrEntry, value) {
|
|
108
111
|
if (this.isRealNode(keyNodeOrEntry))
|
|
@@ -110,30 +113,40 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
|
|
|
110
113
|
const _commonAdd = (key, values) => {
|
|
111
114
|
if (key === undefined || key === null)
|
|
112
115
|
return false;
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
existingValues.push(value);
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
const existingNode = this.getNode(key);
|
|
120
|
-
if (this.isRealNode(existingNode)) {
|
|
121
|
-
if (existingValues === undefined) {
|
|
122
|
-
super.add(key, values);
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
if (values !== undefined) {
|
|
116
|
+
const _addToValues = () => {
|
|
117
|
+
const existingValues = this.get(key);
|
|
118
|
+
if (existingValues !== undefined && values !== undefined) {
|
|
126
119
|
for (const value of values)
|
|
127
120
|
existingValues.push(value);
|
|
128
121
|
return true;
|
|
129
122
|
}
|
|
123
|
+
return false;
|
|
124
|
+
};
|
|
125
|
+
const _addByNode = () => {
|
|
126
|
+
const existingNode = this.getNode(key);
|
|
127
|
+
if (this.isRealNode(existingNode)) {
|
|
128
|
+
const existingValues = this.get(existingNode);
|
|
129
|
+
if (existingValues === undefined) {
|
|
130
|
+
super.add(key, values);
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (values !== undefined) {
|
|
134
|
+
for (const value of values)
|
|
135
|
+
existingValues.push(value);
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
130
142
|
else {
|
|
131
|
-
return
|
|
143
|
+
return super.add(key, values);
|
|
132
144
|
}
|
|
145
|
+
};
|
|
146
|
+
if (this._isMapMode) {
|
|
147
|
+
return _addByNode() || _addToValues();
|
|
133
148
|
}
|
|
134
|
-
|
|
135
|
-
return super.add(key, values);
|
|
136
|
-
}
|
|
149
|
+
return _addToValues() || _addByNode();
|
|
137
150
|
};
|
|
138
151
|
if (this.isEntry(keyNodeOrEntry)) {
|
|
139
152
|
const [key, values] = keyNodeOrEntry;
|
|
@@ -147,7 +160,7 @@ class AVLTreeMultiMap extends avl_tree_1.AVLTree {
|
|
|
147
160
|
*
|
|
148
161
|
* The function `deleteValue` removes a specific value from a key in an AVLTreeMultiMap data
|
|
149
162
|
* structure and deletes the entire node if no values are left for that key.
|
|
150
|
-
* @param {
|
|
163
|
+
* @param {K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | K} keyNodeOrEntry - The `keyNodeOrEntry`
|
|
151
164
|
* parameter in the `deleteValue` function can be either a `BTNRep` object representing a key-value
|
|
152
165
|
* pair in the AVLTreeMultiMapNode, or just the key itself.
|
|
153
166
|
* @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avl-tree-multi-map.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree-multi-map.ts"],"names":[],"mappings":";;;AAQA,yCAAkD;AAGlD,MAAa,mBAAsC,SAAQ,sBAAmB;
|
|
1
|
+
{"version":3,"file":"avl-tree-multi-map.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree-multi-map.ts"],"names":[],"mappings":";;;AAQA,yCAAkD;AAGlD,MAAa,mBAAsC,SAAQ,sBAAmB;IAG5E;;;;;;;;OAQG;IACH,YAAY,GAAM,EAAE,KAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAZX,WAAM,GAA+B,SAAS,CAAC;QAe/C,UAAK,GAAkD,SAAS,CAAC;QAajE,WAAM,GAAkD,SAAS,CAAC;IAf3E,CAAC;IAID,IAAa,IAAI;QACf,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAa,IAAI,CAAC,CAA+C;QAC/D,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;IAID,IAAa,KAAK;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAa,KAAK,CAAC,CAA+C;QAChE,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF;AAzCD,kDAyCC;AAED;;GAEG;AACH,MAAa,eACX,SAAQ,kBAAgC;IAGxC;;;;;;;;;;OAUG;IACH,YACE,yBAEI,EAAE,EACN,OAA2C;QAE3C,KAAK,CAAC,EAAE,kCAAO,OAAO,KAAE,SAAS,EAAE,IAAI,IAAG,CAAC;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