data-structure-typed 1.35.1 → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/dist/data-structures/binary-tree/aa-tree.d.ts +2 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +21 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +13 -864
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/avl-tree.d.ts +94 -0
- package/dist/data-structures/binary-tree/avl-tree.js +90 -3
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/b-tree.d.ts +2 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +46 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +36 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/binary-tree.d.ts +536 -0
- package/dist/data-structures/binary-tree/binary-tree.js +1194 -2
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/bst.d.ts +133 -0
- package/dist/data-structures/binary-tree/bst.js +114 -0
- package/dist/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/data-structures/binary-tree/index.d.ts +12 -0
- package/dist/data-structures/binary-tree/rb-tree.d.ts +13 -0
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/segment-tree.d.ts +83 -0
- package/dist/data-structures/binary-tree/segment-tree.js +45 -0
- package/dist/data-structures/binary-tree/segment-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/splay-tree.d.ts +2 -0
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +209 -0
- package/dist/data-structures/binary-tree/tree-multiset.js +178 -0
- package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
- package/dist/data-structures/binary-tree/two-three-tree.d.ts +2 -0
- package/dist/data-structures/graph/abstract-graph.d.ts +332 -0
- package/dist/data-structures/graph/abstract-graph.js +270 -7
- package/dist/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/data-structures/graph/directed-graph.d.ts +200 -0
- package/dist/data-structures/graph/directed-graph.js +167 -0
- package/dist/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/data-structures/graph/index.d.ts +4 -0
- package/dist/data-structures/graph/map-graph.d.ts +79 -0
- package/dist/data-structures/graph/map-graph.js +54 -0
- package/dist/data-structures/graph/map-graph.js.map +1 -1
- package/dist/data-structures/graph/undirected-graph.d.ts +127 -0
- package/dist/data-structures/graph/undirected-graph.js +105 -0
- package/dist/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/data-structures/hash/coordinate-map.d.ts +45 -0
- package/dist/data-structures/hash/coordinate-map.js +35 -0
- package/dist/data-structures/hash/coordinate-map.js.map +1 -1
- package/dist/data-structures/hash/coordinate-set.d.ts +37 -0
- package/dist/data-structures/hash/coordinate-set.js +28 -0
- package/dist/data-structures/hash/coordinate-set.js.map +1 -1
- package/dist/data-structures/hash/hash-map.d.ts +56 -0
- package/dist/data-structures/hash/hash-map.js +29 -1
- package/dist/data-structures/hash/hash-map.js.map +1 -1
- package/dist/data-structures/hash/hash-table.d.ts +106 -0
- package/dist/data-structures/hash/hash-table.js +88 -6
- package/dist/data-structures/hash/hash-table.js.map +1 -1
- package/dist/data-structures/hash/index.d.ts +7 -0
- package/dist/data-structures/hash/pair.d.ts +2 -0
- package/dist/data-structures/hash/tree-map.d.ts +2 -0
- package/dist/data-structures/hash/tree-set.d.ts +2 -0
- package/dist/data-structures/heap/heap.d.ts +99 -0
- package/dist/data-structures/heap/heap.js +200 -78
- package/dist/data-structures/heap/heap.js.map +1 -1
- package/dist/data-structures/heap/index.d.ts +3 -0
- package/dist/data-structures/heap/max-heap.d.ts +12 -0
- package/dist/data-structures/heap/max-heap.js +16 -6
- package/dist/data-structures/heap/max-heap.js.map +1 -1
- package/dist/data-structures/heap/min-heap.d.ts +12 -0
- package/dist/data-structures/heap/min-heap.js +16 -6
- package/dist/data-structures/heap/min-heap.js.map +1 -1
- package/dist/data-structures/index.d.ts +11 -0
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +234 -0
- package/dist/data-structures/linked-list/doubly-linked-list.js +202 -0
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/data-structures/linked-list/index.d.ts +3 -0
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +157 -0
- package/dist/data-structures/linked-list/singly-linked-list.js +135 -0
- package/dist/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/data-structures/linked-list/skip-linked-list.d.ts +61 -0
- package/dist/data-structures/linked-list/skip-linked-list.js +36 -0
- package/dist/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/data-structures/matrix/index.d.ts +4 -0
- package/dist/data-structures/matrix/matrix.d.ts +21 -0
- package/dist/data-structures/matrix/matrix.js +15 -0
- package/dist/data-structures/matrix/matrix.js.map +1 -1
- package/dist/data-structures/matrix/matrix2d.d.ts +108 -0
- package/dist/data-structures/matrix/matrix2d.js +91 -2
- package/dist/data-structures/matrix/matrix2d.js.map +1 -1
- package/dist/data-structures/matrix/navigator.d.ts +52 -0
- package/dist/data-structures/matrix/navigator.js +28 -0
- package/dist/data-structures/matrix/navigator.js.map +1 -1
- package/dist/data-structures/matrix/vector2d.d.ts +201 -0
- package/dist/data-structures/matrix/vector2d.js +188 -1
- package/dist/data-structures/matrix/vector2d.js.map +1 -1
- package/dist/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +12 -0
- package/dist/data-structures/priority-queue/max-priority-queue.js +16 -17
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +12 -0
- package/dist/data-structures/priority-queue/min-priority-queue.js +16 -17
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +12 -0
- package/dist/data-structures/priority-queue/priority-queue.js +11 -174
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/data-structures/queue/deque.d.ts +165 -0
- package/dist/data-structures/queue/deque.js +124 -0
- package/dist/data-structures/queue/deque.js.map +1 -1
- package/dist/data-structures/queue/index.d.ts +2 -0
- package/dist/data-structures/queue/queue.d.ts +107 -0
- package/dist/data-structures/queue/queue.js +80 -0
- package/dist/data-structures/queue/queue.js.map +1 -1
- package/dist/data-structures/stack/index.d.ts +1 -0
- package/dist/data-structures/stack/stack.d.ts +63 -0
- package/dist/data-structures/stack/stack.js +50 -0
- package/dist/data-structures/stack/stack.js.map +1 -1
- package/dist/data-structures/tree/index.d.ts +1 -0
- package/dist/data-structures/tree/tree.d.ts +14 -0
- package/dist/data-structures/tree/tree.js +1 -0
- package/dist/data-structures/tree/tree.js.map +1 -1
- package/dist/data-structures/trie/index.d.ts +1 -0
- package/dist/data-structures/trie/trie.d.ts +61 -0
- package/dist/data-structures/trie/trie.js +36 -0
- package/dist/data-structures/trie/trie.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/interfaces/abstract-binary-tree.d.ts +7 -0
- package/dist/interfaces/abstract-graph.d.ts +5 -0
- package/dist/interfaces/avl-tree.d.ts +7 -0
- package/dist/interfaces/binary-tree.d.ts +6 -0
- package/dist/interfaces/bst.d.ts +6 -0
- package/dist/interfaces/directed-graph.d.ts +3 -0
- package/dist/interfaces/doubly-linked-list.d.ts +1 -0
- package/dist/interfaces/heap.d.ts +1 -0
- package/dist/interfaces/index.d.ts +15 -0
- package/dist/interfaces/navigator.d.ts +1 -0
- package/dist/interfaces/priority-queue.d.ts +1 -0
- package/dist/interfaces/rb-tree.d.ts +6 -0
- package/dist/interfaces/segment-tree.d.ts +1 -0
- package/dist/interfaces/singly-linked-list.d.ts +1 -0
- package/dist/interfaces/tree-multiset.d.ts +6 -0
- package/dist/interfaces/undirected-graph.d.ts +3 -0
- package/dist/types/data-structures/abstract-binary-tree.d.ts +32 -0
- package/dist/types/data-structures/abstract-binary-tree.js +6 -0
- package/dist/types/data-structures/abstract-binary-tree.js.map +1 -1
- package/dist/types/data-structures/abstract-graph.d.ts +11 -0
- package/dist/types/data-structures/avl-tree.d.ts +4 -0
- package/dist/types/data-structures/binary-tree.d.ts +6 -0
- package/dist/types/data-structures/bst.d.ts +13 -0
- package/dist/types/data-structures/directed-graph.d.ts +6 -0
- package/dist/types/data-structures/doubly-linked-list.d.ts +1 -0
- package/dist/types/data-structures/hash.d.ts +1 -0
- package/dist/types/data-structures/heap.d.ts +1 -0
- package/dist/types/data-structures/index.d.ts +16 -0
- package/dist/types/data-structures/map-graph.d.ts +1 -0
- package/dist/types/data-structures/navigator.d.ts +14 -0
- package/dist/types/data-structures/priority-queue.d.ts +7 -0
- package/dist/types/data-structures/rb-tree.d.ts +8 -0
- package/dist/types/data-structures/segment-tree.d.ts +1 -0
- package/dist/types/data-structures/singly-linked-list.d.ts +1 -0
- package/dist/types/data-structures/tree-multiset.d.ts +4 -0
- package/dist/types/helpers.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/dist/types/utils/validate-type.d.ts +19 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/utils.d.ts +19 -0
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +3 -509
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +1 -1175
- package/lib/data-structures/binary-tree/avl-tree.d.ts +1 -1
- package/lib/data-structures/binary-tree/binary-tree.d.ts +506 -1
- package/lib/data-structures/binary-tree/binary-tree.js +1173 -2
- package/lib/data-structures/binary-tree/bst.d.ts +1 -1
- package/lib/data-structures/binary-tree/rb-tree.d.ts +1 -1
- package/lib/data-structures/binary-tree/tree-multiset.d.ts +1 -1
- package/lib/data-structures/graph/abstract-graph.js +3 -5
- package/lib/data-structures/heap/heap.d.ts +84 -68
- package/lib/data-structures/heap/heap.js +168 -107
- package/lib/data-structures/heap/max-heap.d.ts +6 -17
- package/lib/data-structures/heap/max-heap.js +11 -17
- package/lib/data-structures/heap/min-heap.d.ts +6 -18
- package/lib/data-structures/heap/min-heap.js +11 -18
- package/lib/data-structures/priority-queue/max-priority-queue.d.ts +4 -7
- package/lib/data-structures/priority-queue/max-priority-queue.js +11 -30
- package/lib/data-structures/priority-queue/min-priority-queue.d.ts +4 -7
- package/lib/data-structures/priority-queue/min-priority-queue.js +11 -31
- package/lib/data-structures/priority-queue/priority-queue.d.ts +6 -174
- package/lib/data-structures/priority-queue/priority-queue.js +11 -315
- package/lib/types/data-structures/abstract-binary-tree.d.ts +1 -3
- package/lib/types/data-structures/binary-tree.d.ts +4 -2
- package/lib/types/data-structures/heap.d.ts +1 -3
- package/package.json +10 -6
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +4 -1527
- package/src/data-structures/binary-tree/avl-tree.ts +3 -3
- package/src/data-structures/binary-tree/binary-tree.ts +1524 -5
- package/src/data-structures/binary-tree/bst.ts +3 -3
- package/src/data-structures/binary-tree/rb-tree.ts +3 -3
- package/src/data-structures/binary-tree/tree-multiset.ts +3 -3
- package/src/data-structures/graph/abstract-graph.ts +3 -5
- package/src/data-structures/heap/heap.ts +167 -143
- package/src/data-structures/heap/max-heap.ts +15 -22
- package/src/data-structures/heap/min-heap.ts +15 -23
- package/src/data-structures/priority-queue/max-priority-queue.ts +13 -46
- package/src/data-structures/priority-queue/min-priority-queue.ts +13 -47
- package/src/data-structures/priority-queue/priority-queue.ts +7 -350
- package/src/types/data-structures/abstract-binary-tree.ts +1 -1
- package/src/types/data-structures/binary-tree.ts +2 -2
- package/src/types/data-structures/heap.ts +1 -5
- package/test/unit/data-structures/heap/heap.test.ts +26 -18
- package/test/unit/data-structures/heap/max-heap.test.ts +50 -42
- package/test/unit/data-structures/heap/min-heap.test.ts +38 -68
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +9 -10
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +14 -30
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.LICENSE.txt +15 -0
- package/umd/bundle.min.js.map +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data-structure-typed
|
|
3
|
+
*
|
|
4
|
+
* @author Kirk Qi
|
|
5
|
+
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
6
|
+
* @license MIT License
|
|
7
|
+
*/
|
|
8
|
+
import { Heap } from '../heap';
|
|
9
|
+
import { CompareFunction } from '../../types';
|
|
10
|
+
export declare class PriorityQueue<E> extends Heap<E> {
|
|
11
|
+
constructor(comparator: CompareFunction<E>);
|
|
12
|
+
}
|
|
@@ -1,180 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* data-structure-typed
|
|
4
|
+
*
|
|
5
|
+
* @author Kirk Qi
|
|
6
|
+
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
7
|
+
* @license MIT License
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.PriorityQueue = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const aKey = a, bKey = b;
|
|
9
|
-
return aKey - bKey;
|
|
10
|
-
};
|
|
11
|
-
const { nodes, comparator, isFix = true } = options;
|
|
12
|
-
this._comparator = comparator;
|
|
13
|
-
if (nodes && Array.isArray(nodes) && nodes.length > 0) {
|
|
14
|
-
this._nodes = [...nodes];
|
|
15
|
-
isFix && this._fix();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
get nodes() {
|
|
19
|
-
return this._nodes;
|
|
20
|
-
}
|
|
21
|
-
get size() {
|
|
22
|
-
return this.nodes.length;
|
|
23
|
-
}
|
|
24
|
-
static heapify(options) {
|
|
25
|
-
const heap = new PriorityQueue(options);
|
|
26
|
-
heap._fix();
|
|
27
|
-
return heap;
|
|
28
|
-
}
|
|
29
|
-
static isPriorityQueueified(options) {
|
|
30
|
-
return new PriorityQueue(Object.assign(Object.assign({}, options), { isFix: false })).isValid();
|
|
31
|
-
}
|
|
32
|
-
getNodes() {
|
|
33
|
-
return this._nodes;
|
|
34
|
-
}
|
|
35
|
-
add(node) {
|
|
36
|
-
this.nodes.push(node);
|
|
37
|
-
this._heapifyUp(this.size - 1);
|
|
38
|
-
}
|
|
39
|
-
has(node) {
|
|
40
|
-
return this.nodes.includes(node);
|
|
41
|
-
}
|
|
42
|
-
peek() {
|
|
43
|
-
return this.size ? this.nodes[0] : null;
|
|
44
|
-
}
|
|
45
|
-
poll() {
|
|
46
|
-
var _a, _b;
|
|
47
|
-
let res = null;
|
|
48
|
-
if (this.size > 1) {
|
|
49
|
-
this._swap(0, this.nodes.length - 1);
|
|
50
|
-
res = (_a = this.nodes.pop()) !== null && _a !== void 0 ? _a : null;
|
|
51
|
-
this._heapifyDown(0);
|
|
52
|
-
}
|
|
53
|
-
else if (this.size === 1) {
|
|
54
|
-
res = (_b = this.nodes.pop()) !== null && _b !== void 0 ? _b : null;
|
|
55
|
-
}
|
|
56
|
-
return res;
|
|
57
|
-
}
|
|
58
|
-
leaf() {
|
|
59
|
-
var _a;
|
|
60
|
-
return (_a = this.nodes[this.size - 1]) !== null && _a !== void 0 ? _a : null;
|
|
61
|
-
}
|
|
62
|
-
isEmpty() {
|
|
63
|
-
return this.size === 0;
|
|
64
|
-
}
|
|
65
|
-
clear() {
|
|
66
|
-
this._setNodes([]);
|
|
67
|
-
}
|
|
68
|
-
toArray() {
|
|
69
|
-
return [...this.nodes];
|
|
70
|
-
}
|
|
71
|
-
clone() {
|
|
72
|
-
return new PriorityQueue({
|
|
73
|
-
nodes: this.nodes,
|
|
74
|
-
comparator: this._comparator
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
isValid() {
|
|
78
|
-
for (let i = 0; i < this.nodes.length; i++) {
|
|
79
|
-
const leftChildIndex = this._getLeft(i);
|
|
80
|
-
const rightChildIndex = this._getRight(i);
|
|
81
|
-
if (this._isValidIndex(leftChildIndex) && !this._compare(leftChildIndex, i)) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
if (this._isValidIndex(rightChildIndex) && !this._compare(rightChildIndex, i)) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
sort() {
|
|
91
|
-
const visitedNode = [];
|
|
92
|
-
while (this.size !== 0) {
|
|
93
|
-
const top = this.poll();
|
|
94
|
-
if (top)
|
|
95
|
-
visitedNode.push(top);
|
|
96
|
-
}
|
|
97
|
-
return visitedNode;
|
|
98
|
-
}
|
|
99
|
-
dfs(dfsMode) {
|
|
100
|
-
const visitedNode = [];
|
|
101
|
-
const traverse = (cur) => {
|
|
102
|
-
var _a, _b, _c;
|
|
103
|
-
const leftChildIndex = this._getLeft(cur);
|
|
104
|
-
const rightChildIndex = this._getRight(cur);
|
|
105
|
-
switch (dfsMode) {
|
|
106
|
-
case 'in':
|
|
107
|
-
this._isValidIndex(leftChildIndex) && traverse(leftChildIndex);
|
|
108
|
-
visitedNode.push((_a = this.nodes[cur]) !== null && _a !== void 0 ? _a : null);
|
|
109
|
-
this._isValidIndex(rightChildIndex) && traverse(rightChildIndex);
|
|
110
|
-
break;
|
|
111
|
-
case 'pre':
|
|
112
|
-
visitedNode.push((_b = this.nodes[cur]) !== null && _b !== void 0 ? _b : null);
|
|
113
|
-
this._isValidIndex(leftChildIndex) && traverse(leftChildIndex);
|
|
114
|
-
this._isValidIndex(rightChildIndex) && traverse(rightChildIndex);
|
|
115
|
-
break;
|
|
116
|
-
case 'post':
|
|
117
|
-
this._isValidIndex(leftChildIndex) && traverse(leftChildIndex);
|
|
118
|
-
this._isValidIndex(rightChildIndex) && traverse(rightChildIndex);
|
|
119
|
-
visitedNode.push((_c = this.nodes[cur]) !== null && _c !== void 0 ? _c : null);
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
this._isValidIndex(0) && traverse(0);
|
|
124
|
-
return visitedNode;
|
|
125
|
-
}
|
|
126
|
-
_setNodes(value) {
|
|
127
|
-
this._nodes = value;
|
|
128
|
-
}
|
|
129
|
-
_compare(a, b) {
|
|
130
|
-
return this._comparator(this.nodes[a], this.nodes[b]) > 0;
|
|
131
|
-
}
|
|
132
|
-
_swap(a, b) {
|
|
133
|
-
const temp = this.nodes[a];
|
|
134
|
-
this.nodes[a] = this.nodes[b];
|
|
135
|
-
this.nodes[b] = temp;
|
|
136
|
-
}
|
|
137
|
-
_isValidIndex(index) {
|
|
138
|
-
return index > -1 && index < this.nodes.length;
|
|
139
|
-
}
|
|
140
|
-
_getParent(child) {
|
|
141
|
-
return Math.floor((child - 1) / 2);
|
|
142
|
-
}
|
|
143
|
-
_getLeft(parent) {
|
|
144
|
-
return 2 * parent + 1;
|
|
145
|
-
}
|
|
146
|
-
_getRight(parent) {
|
|
147
|
-
return 2 * parent + 2;
|
|
148
|
-
}
|
|
149
|
-
_getComparedChild(parent) {
|
|
150
|
-
let min = parent;
|
|
151
|
-
const left = this._getLeft(parent), right = this._getRight(parent);
|
|
152
|
-
if (left < this.size && this._compare(min, left)) {
|
|
153
|
-
min = left;
|
|
154
|
-
}
|
|
155
|
-
if (right < this.size && this._compare(min, right)) {
|
|
156
|
-
min = right;
|
|
157
|
-
}
|
|
158
|
-
return min;
|
|
159
|
-
}
|
|
160
|
-
_heapifyUp(start) {
|
|
161
|
-
while (start > 0 && this._compare(this._getParent(start), start)) {
|
|
162
|
-
const parent = this._getParent(start);
|
|
163
|
-
this._swap(start, parent);
|
|
164
|
-
start = parent;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
_heapifyDown(start) {
|
|
168
|
-
let min = this._getComparedChild(start);
|
|
169
|
-
while (this._compare(start, min)) {
|
|
170
|
-
this._swap(min, start);
|
|
171
|
-
start = min;
|
|
172
|
-
min = this._getComparedChild(start);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
_fix() {
|
|
176
|
-
for (let i = Math.floor(this.size / 2); i > -1; i--)
|
|
177
|
-
this._heapifyDown(i);
|
|
11
|
+
const heap_1 = require("../heap");
|
|
12
|
+
class PriorityQueue extends heap_1.Heap {
|
|
13
|
+
constructor(comparator) {
|
|
14
|
+
super(comparator);
|
|
178
15
|
}
|
|
179
16
|
}
|
|
180
17
|
exports.PriorityQueue = PriorityQueue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priority-queue.js","sourceRoot":"","sources":["../../../src/data-structures/priority-queue/priority-queue.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"priority-queue.js","sourceRoot":"","sources":["../../../src/data-structures/priority-queue/priority-queue.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,kCAA6B;AAG7B,MAAa,aAAiB,SAAQ,WAAO;IAC3C,YAAY,UAA8B;QACxC,KAAK,CAAC,UAAU,CAAC,CAAC;IACpB,CAAC;CACF;AAJD,sCAIC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data-structure-typed
|
|
3
|
+
*
|
|
4
|
+
* @author Tyler Zeng
|
|
5
|
+
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
|
+
* @license MIT License
|
|
7
|
+
*/
|
|
8
|
+
import { DoublyLinkedList } from '../linked-list';
|
|
9
|
+
export declare class Deque<E = any> extends DoublyLinkedList<E> {
|
|
10
|
+
}
|
|
11
|
+
export declare class ObjectDeque<E = number> {
|
|
12
|
+
constructor(capacity?: number);
|
|
13
|
+
private _nodes;
|
|
14
|
+
get nodes(): {
|
|
15
|
+
[p: number]: E;
|
|
16
|
+
};
|
|
17
|
+
private _capacity;
|
|
18
|
+
get capacity(): number;
|
|
19
|
+
set capacity(value: number);
|
|
20
|
+
private _first;
|
|
21
|
+
get first(): number;
|
|
22
|
+
set first(value: number);
|
|
23
|
+
private _last;
|
|
24
|
+
get last(): number;
|
|
25
|
+
set last(value: number);
|
|
26
|
+
private _size;
|
|
27
|
+
get size(): number;
|
|
28
|
+
/**
|
|
29
|
+
* The "addFirst" function adds a value to the beginning of an array-like data structure.
|
|
30
|
+
* @param {E} value - The `value` parameter represents the value that you want to add to the beginning of the data
|
|
31
|
+
* structure.
|
|
32
|
+
*/
|
|
33
|
+
addFirst(value: E): void;
|
|
34
|
+
/**
|
|
35
|
+
* The addLast function adds a value to the end of an array-like data structure.
|
|
36
|
+
* @param {E} value - The `value` parameter represents the value that you want to add to the end of the data structure.
|
|
37
|
+
*/
|
|
38
|
+
addLast(value: E): void;
|
|
39
|
+
/**
|
|
40
|
+
* The function `pollFirst()` removes and returns the first element in a data structure.
|
|
41
|
+
* @returns The value of the first element in the data structure.
|
|
42
|
+
*/
|
|
43
|
+
pollFirst(): E | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The `peekFirst` function returns the first element in an array-like data structure if it exists.
|
|
46
|
+
* @returns The element at the first position of the `_nodes` array.
|
|
47
|
+
*/
|
|
48
|
+
peekFirst(): E | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The `pollLast()` function removes and returns the last element in a data structure.
|
|
51
|
+
* @returns The value that was removed from the data structure.
|
|
52
|
+
*/
|
|
53
|
+
pollLast(): E | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The `peekLast()` function returns the last element in an array-like data structure.
|
|
56
|
+
* @returns The last element in the array "_nodes" is being returned.
|
|
57
|
+
*/
|
|
58
|
+
peekLast(): E | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The get function returns the element at the specified index in an array-like data structure.
|
|
61
|
+
* @param {number} index - The index parameter is a number that represents the position of the element you want to
|
|
62
|
+
* retrieve from the array.
|
|
63
|
+
* @returns The element at the specified index in the `_nodes` array is being returned. If there is no element at that
|
|
64
|
+
* index, `null` is returned.
|
|
65
|
+
*/
|
|
66
|
+
get(index: number): NonNullable<E> | null;
|
|
67
|
+
/**
|
|
68
|
+
* The function checks if the size of a data structure is less than or equal to zero.
|
|
69
|
+
* @returns The method is returning a boolean value indicating whether the size of the object is less than or equal to 0.
|
|
70
|
+
*/
|
|
71
|
+
isEmpty(): boolean;
|
|
72
|
+
protected _seNodes(value: {
|
|
73
|
+
[p: number]: E;
|
|
74
|
+
}): void;
|
|
75
|
+
protected _setSize(value: number): void;
|
|
76
|
+
}
|
|
77
|
+
export declare class ArrayDeque<E> {
|
|
78
|
+
protected _nodes: E[];
|
|
79
|
+
get size(): number;
|
|
80
|
+
/**
|
|
81
|
+
* O(n) time complexity of adding at the beginning and the end
|
|
82
|
+
*/
|
|
83
|
+
/**
|
|
84
|
+
* The function "addLast" adds a value to the end of an array.
|
|
85
|
+
* @param {E} value - The value parameter represents the value that you want to add to the end of the array.
|
|
86
|
+
* @returns The return value is the new length of the array after the value has been added.
|
|
87
|
+
*/
|
|
88
|
+
addLast(value: E): number;
|
|
89
|
+
/**
|
|
90
|
+
* The function "pollLast" returns and removes the last element from an array, or returns null if the array is empty.
|
|
91
|
+
* @returns The method `pollLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
92
|
+
*/
|
|
93
|
+
pollLast(): E | null;
|
|
94
|
+
/**
|
|
95
|
+
* The `pollFirst` function removes and returns the first element from an array, or returns null if the array is empty.
|
|
96
|
+
* @returns The `pollFirst()` function returns the first element of the `_nodes` array, or `null` if the array is
|
|
97
|
+
* empty.
|
|
98
|
+
*/
|
|
99
|
+
pollFirst(): E | null;
|
|
100
|
+
/**
|
|
101
|
+
* O(n) time complexity of adding at the beginning and the end
|
|
102
|
+
*/
|
|
103
|
+
/**
|
|
104
|
+
* The function "addFirst" adds a value to the beginning of an array.
|
|
105
|
+
* @param {E} value - The value parameter represents the value that you want to add to the beginning of the array.
|
|
106
|
+
* @returns The return value of the `addFirst` function is the new length of the array `_nodes` after adding the
|
|
107
|
+
* `value` at the beginning.
|
|
108
|
+
*/
|
|
109
|
+
addFirst(value: E): number;
|
|
110
|
+
/**
|
|
111
|
+
* The `peekFirst` function returns the first element of an array or null if the array is empty.
|
|
112
|
+
* @returns The function `peekFirst()` is returning the first element (`E`) of the `_nodes` array. If the array is
|
|
113
|
+
* empty, it will return `null`.
|
|
114
|
+
*/
|
|
115
|
+
peekFirst(): E | null;
|
|
116
|
+
/**
|
|
117
|
+
* The `peekLast` function returns the last element of an array or null if the array is empty.
|
|
118
|
+
* @returns The method `peekLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
119
|
+
*/
|
|
120
|
+
peekLast(): E | null;
|
|
121
|
+
/**
|
|
122
|
+
* O(1) time complexity of obtaining the value
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* The get function returns the element at the specified index in an array, or null if the index is out of bounds.
|
|
126
|
+
* @param {number} index - The index parameter is a number that represents the position of the element you want to
|
|
127
|
+
* retrieve from the array.
|
|
128
|
+
* @returns The method is returning the element at the specified index in the `_nodes` array. If the element exists, it
|
|
129
|
+
* will be returned. If the element does not exist (i.e., the index is out of bounds), `null` will be returned.
|
|
130
|
+
*/
|
|
131
|
+
get(index: number): E | null;
|
|
132
|
+
/**
|
|
133
|
+
* The set function assigns a value to a specific index in an array.
|
|
134
|
+
* @param {number} index - The index parameter is a number that represents the position of the element in the array
|
|
135
|
+
* that you want to set a new value for.
|
|
136
|
+
* @param {E} value - The value parameter represents the new value that you want to set at the specified index in the
|
|
137
|
+
* _nodes array.
|
|
138
|
+
* @returns The value that is being set at the specified index in the `_nodes` array.
|
|
139
|
+
*/
|
|
140
|
+
set(index: number, value: E): E;
|
|
141
|
+
/**
|
|
142
|
+
* The insert function adds a value at a specified index in an array.
|
|
143
|
+
* @param {number} index - The index parameter specifies the position at which the value should be inserted in the
|
|
144
|
+
* array. It is a number that represents the index of the array where the value should be inserted. The index starts
|
|
145
|
+
* from 0, so the first element of the array has an index of 0, the second element has
|
|
146
|
+
* @param {E} value - The value parameter represents the value that you want to insert into the array at the specified
|
|
147
|
+
* index.
|
|
148
|
+
* @returns The splice method returns an array containing the removed elements, if any. In this case, since no elements
|
|
149
|
+
* are being removed, an empty array will be returned.
|
|
150
|
+
*/
|
|
151
|
+
insert(index: number, value: E): E[];
|
|
152
|
+
/**
|
|
153
|
+
* The remove function removes an element from an array at a specified index.
|
|
154
|
+
* @param {number} index - The index parameter specifies the position of the element to be removed from the array. It
|
|
155
|
+
* is a number that represents the index of the element to be removed.
|
|
156
|
+
* @returns The method is returning an array containing the removed element.
|
|
157
|
+
*/
|
|
158
|
+
remove(index: number): E[];
|
|
159
|
+
/**
|
|
160
|
+
* The function checks if an array called "_nodes" is empty.
|
|
161
|
+
* @returns The method `isEmpty()` is returning a boolean value. It returns `true` if the length of the `_nodes` array
|
|
162
|
+
* is 0, indicating that the array is empty. Otherwise, it returns `false`.
|
|
163
|
+
*/
|
|
164
|
+
isEmpty(): boolean;
|
|
165
|
+
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArrayDeque = exports.ObjectDeque = exports.Deque = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* data-structure-typed
|
|
6
|
+
*
|
|
7
|
+
* @author Tyler Zeng
|
|
8
|
+
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
|
+
* @license MIT License
|
|
10
|
+
*/
|
|
4
11
|
const linked_list_1 = require("../linked-list");
|
|
12
|
+
// O(n) time complexity of obtaining the value
|
|
13
|
+
// O(1) time complexity of adding at the beginning and the end
|
|
5
14
|
class Deque extends linked_list_1.DoublyLinkedList {
|
|
6
15
|
}
|
|
7
16
|
exports.Deque = Deque;
|
|
17
|
+
// O(1) time complexity of obtaining the value
|
|
18
|
+
// O(n) time complexity of adding at the beginning and the end
|
|
19
|
+
// todo tested slowest one
|
|
8
20
|
class ObjectDeque {
|
|
9
21
|
constructor(capacity) {
|
|
10
22
|
this._nodes = {};
|
|
@@ -39,6 +51,11 @@ class ObjectDeque {
|
|
|
39
51
|
get size() {
|
|
40
52
|
return this._size;
|
|
41
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The "addFirst" function adds a value to the beginning of an array-like data structure.
|
|
56
|
+
* @param {E} value - The `value` parameter represents the value that you want to add to the beginning of the data
|
|
57
|
+
* structure.
|
|
58
|
+
*/
|
|
42
59
|
addFirst(value) {
|
|
43
60
|
if (this._size === 0) {
|
|
44
61
|
const mid = Math.floor(this._capacity / 2);
|
|
@@ -51,6 +68,10 @@ class ObjectDeque {
|
|
|
51
68
|
this._nodes[this._first] = value;
|
|
52
69
|
this._size++;
|
|
53
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* The addLast function adds a value to the end of an array-like data structure.
|
|
73
|
+
* @param {E} value - The `value` parameter represents the value that you want to add to the end of the data structure.
|
|
74
|
+
*/
|
|
54
75
|
addLast(value) {
|
|
55
76
|
if (this._size === 0) {
|
|
56
77
|
const mid = Math.floor(this._capacity / 2);
|
|
@@ -63,6 +84,10 @@ class ObjectDeque {
|
|
|
63
84
|
this._nodes[this._last] = value;
|
|
64
85
|
this._size++;
|
|
65
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* The function `pollFirst()` removes and returns the first element in a data structure.
|
|
89
|
+
* @returns The value of the first element in the data structure.
|
|
90
|
+
*/
|
|
66
91
|
pollFirst() {
|
|
67
92
|
if (!this._size)
|
|
68
93
|
return;
|
|
@@ -72,10 +97,18 @@ class ObjectDeque {
|
|
|
72
97
|
this._size--;
|
|
73
98
|
return value;
|
|
74
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* The `peekFirst` function returns the first element in an array-like data structure if it exists.
|
|
102
|
+
* @returns The element at the first position of the `_nodes` array.
|
|
103
|
+
*/
|
|
75
104
|
peekFirst() {
|
|
76
105
|
if (this._size)
|
|
77
106
|
return this._nodes[this._first];
|
|
78
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* The `pollLast()` function removes and returns the last element in a data structure.
|
|
110
|
+
* @returns The value that was removed from the data structure.
|
|
111
|
+
*/
|
|
79
112
|
pollLast() {
|
|
80
113
|
if (!this._size)
|
|
81
114
|
return;
|
|
@@ -85,13 +118,28 @@ class ObjectDeque {
|
|
|
85
118
|
this._size--;
|
|
86
119
|
return value;
|
|
87
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The `peekLast()` function returns the last element in an array-like data structure.
|
|
123
|
+
* @returns The last element in the array "_nodes" is being returned.
|
|
124
|
+
*/
|
|
88
125
|
peekLast() {
|
|
89
126
|
if (this._size)
|
|
90
127
|
return this._nodes[this._last];
|
|
91
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* The get function returns the element at the specified index in an array-like data structure.
|
|
131
|
+
* @param {number} index - The index parameter is a number that represents the position of the element you want to
|
|
132
|
+
* retrieve from the array.
|
|
133
|
+
* @returns The element at the specified index in the `_nodes` array is being returned. If there is no element at that
|
|
134
|
+
* index, `null` is returned.
|
|
135
|
+
*/
|
|
92
136
|
get(index) {
|
|
93
137
|
return this._nodes[this._first + index] || null;
|
|
94
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* The function checks if the size of a data structure is less than or equal to zero.
|
|
141
|
+
* @returns The method is returning a boolean value indicating whether the size of the object is less than or equal to 0.
|
|
142
|
+
*/
|
|
95
143
|
isEmpty() {
|
|
96
144
|
return this._size <= 0;
|
|
97
145
|
}
|
|
@@ -103,6 +151,8 @@ class ObjectDeque {
|
|
|
103
151
|
}
|
|
104
152
|
}
|
|
105
153
|
exports.ObjectDeque = ObjectDeque;
|
|
154
|
+
// O(1) time complexity of obtaining the value
|
|
155
|
+
// O(n) time complexity of adding at the beginning and the end
|
|
106
156
|
class ArrayDeque {
|
|
107
157
|
constructor() {
|
|
108
158
|
this._nodes = [];
|
|
@@ -110,41 +160,115 @@ class ArrayDeque {
|
|
|
110
160
|
get size() {
|
|
111
161
|
return this._nodes.length;
|
|
112
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* O(n) time complexity of adding at the beginning and the end
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* The function "addLast" adds a value to the end of an array.
|
|
168
|
+
* @param {E} value - The value parameter represents the value that you want to add to the end of the array.
|
|
169
|
+
* @returns The return value is the new length of the array after the value has been added.
|
|
170
|
+
*/
|
|
113
171
|
addLast(value) {
|
|
114
172
|
return this._nodes.push(value);
|
|
115
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* The function "pollLast" returns and removes the last element from an array, or returns null if the array is empty.
|
|
176
|
+
* @returns The method `pollLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
177
|
+
*/
|
|
116
178
|
pollLast() {
|
|
117
179
|
var _a;
|
|
118
180
|
return (_a = this._nodes.pop()) !== null && _a !== void 0 ? _a : null;
|
|
119
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* The `pollFirst` function removes and returns the first element from an array, or returns null if the array is empty.
|
|
184
|
+
* @returns The `pollFirst()` function returns the first element of the `_nodes` array, or `null` if the array is
|
|
185
|
+
* empty.
|
|
186
|
+
*/
|
|
120
187
|
pollFirst() {
|
|
121
188
|
var _a;
|
|
122
189
|
return (_a = this._nodes.shift()) !== null && _a !== void 0 ? _a : null;
|
|
123
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* O(n) time complexity of adding at the beginning and the end
|
|
193
|
+
*/
|
|
194
|
+
/**
|
|
195
|
+
* The function "addFirst" adds a value to the beginning of an array.
|
|
196
|
+
* @param {E} value - The value parameter represents the value that you want to add to the beginning of the array.
|
|
197
|
+
* @returns The return value of the `addFirst` function is the new length of the array `_nodes` after adding the
|
|
198
|
+
* `value` at the beginning.
|
|
199
|
+
*/
|
|
124
200
|
addFirst(value) {
|
|
125
201
|
return this._nodes.unshift(value);
|
|
126
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* The `peekFirst` function returns the first element of an array or null if the array is empty.
|
|
205
|
+
* @returns The function `peekFirst()` is returning the first element (`E`) of the `_nodes` array. If the array is
|
|
206
|
+
* empty, it will return `null`.
|
|
207
|
+
*/
|
|
127
208
|
peekFirst() {
|
|
128
209
|
var _a;
|
|
129
210
|
return (_a = this._nodes[0]) !== null && _a !== void 0 ? _a : null;
|
|
130
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* The `peekLast` function returns the last element of an array or null if the array is empty.
|
|
214
|
+
* @returns The method `peekLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
215
|
+
*/
|
|
131
216
|
peekLast() {
|
|
132
217
|
var _a;
|
|
133
218
|
return (_a = this._nodes[this._nodes.length - 1]) !== null && _a !== void 0 ? _a : null;
|
|
134
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* O(1) time complexity of obtaining the value
|
|
222
|
+
*/
|
|
223
|
+
/**
|
|
224
|
+
* The get function returns the element at the specified index in an array, or null if the index is out of bounds.
|
|
225
|
+
* @param {number} index - The index parameter is a number that represents the position of the element you want to
|
|
226
|
+
* retrieve from the array.
|
|
227
|
+
* @returns The method is returning the element at the specified index in the `_nodes` array. If the element exists, it
|
|
228
|
+
* will be returned. If the element does not exist (i.e., the index is out of bounds), `null` will be returned.
|
|
229
|
+
*/
|
|
135
230
|
get(index) {
|
|
136
231
|
var _a;
|
|
137
232
|
return (_a = this._nodes[index]) !== null && _a !== void 0 ? _a : null;
|
|
138
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* The set function assigns a value to a specific index in an array.
|
|
236
|
+
* @param {number} index - The index parameter is a number that represents the position of the element in the array
|
|
237
|
+
* that you want to set a new value for.
|
|
238
|
+
* @param {E} value - The value parameter represents the new value that you want to set at the specified index in the
|
|
239
|
+
* _nodes array.
|
|
240
|
+
* @returns The value that is being set at the specified index in the `_nodes` array.
|
|
241
|
+
*/
|
|
139
242
|
set(index, value) {
|
|
140
243
|
return (this._nodes[index] = value);
|
|
141
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* The insert function adds a value at a specified index in an array.
|
|
247
|
+
* @param {number} index - The index parameter specifies the position at which the value should be inserted in the
|
|
248
|
+
* array. It is a number that represents the index of the array where the value should be inserted. The index starts
|
|
249
|
+
* from 0, so the first element of the array has an index of 0, the second element has
|
|
250
|
+
* @param {E} value - The value parameter represents the value that you want to insert into the array at the specified
|
|
251
|
+
* index.
|
|
252
|
+
* @returns The splice method returns an array containing the removed elements, if any. In this case, since no elements
|
|
253
|
+
* are being removed, an empty array will be returned.
|
|
254
|
+
*/
|
|
142
255
|
insert(index, value) {
|
|
143
256
|
return this._nodes.splice(index, 0, value);
|
|
144
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* The remove function removes an element from an array at a specified index.
|
|
260
|
+
* @param {number} index - The index parameter specifies the position of the element to be removed from the array. It
|
|
261
|
+
* is a number that represents the index of the element to be removed.
|
|
262
|
+
* @returns The method is returning an array containing the removed element.
|
|
263
|
+
*/
|
|
145
264
|
remove(index) {
|
|
146
265
|
return this._nodes.splice(index, 1);
|
|
147
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* The function checks if an array called "_nodes" is empty.
|
|
269
|
+
* @returns The method `isEmpty()` is returning a boolean value. It returns `true` if the length of the `_nodes` array
|
|
270
|
+
* is 0, indicating that the array is empty. Otherwise, it returns `false`.
|
|
271
|
+
*/
|
|
148
272
|
isEmpty() {
|
|
149
273
|
return this._nodes.length === 0;
|
|
150
274
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deque.js","sourceRoot":"","sources":["../../../src/data-structures/queue/deque.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deque.js","sourceRoot":"","sources":["../../../src/data-structures/queue/deque.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,gDAAgD;AAEhD,8CAA8C;AAC9C,8DAA8D;AAC9D,MAAa,KAAe,SAAQ,8BAAmB;CAAG;AAA1D,sBAA0D;AAE1D,8CAA8C;AAC9C,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