data-structure-typed 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +378 -7
- package/dist/data-structures/binary-tree/binary-tree.d.ts +30 -30
- package/dist/data-structures/binary-tree/binary-tree.js +55 -55
- package/dist/data-structures/binary-tree/segment-tree.d.ts +17 -17
- package/dist/data-structures/binary-tree/segment-tree.js +30 -30
- package/dist/data-structures/graph/abstract-graph.d.ts +6 -6
- package/dist/data-structures/graph/abstract-graph.js +6 -6
- package/dist/data-structures/graph/directed-graph.d.ts +4 -4
- package/dist/data-structures/graph/directed-graph.js +6 -6
- package/dist/data-structures/graph/undirected-graph.d.ts +3 -3
- package/dist/data-structures/hash/coordinate-map.d.ts +2 -2
- package/dist/data-structures/hash/coordinate-set.d.ts +2 -2
- package/dist/data-structures/heap/heap.d.ts +14 -14
- package/dist/data-structures/heap/heap.js +12 -12
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +9 -9
- package/dist/data-structures/linked-list/doubly-linked-list.js +12 -12
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +7 -7
- package/dist/data-structures/priority-queue/priority-queue.d.ts +7 -7
- package/dist/data-structures/priority-queue/priority-queue.js +6 -6
- package/dist/data-structures/queue/deque.d.ts +1 -1
- package/dist/utils/types/utils.d.ts +0 -52
- package/dist/utils/types/utils.js +0 -52
- package/dist/utils/utils.d.ts +1 -97
- package/dist/utils/utils.js +1 -547
- package/package.json +3 -4
- package/src/assets/overview-diagram-of-data-structures.png +0 -0
- package/src/data-structures/binary-tree/binary-tree.ts +83 -76
- package/src/data-structures/binary-tree/segment-tree.ts +55 -36
- package/src/data-structures/graph/abstract-graph.ts +21 -19
- package/src/data-structures/graph/directed-graph.ts +23 -18
- package/src/data-structures/graph/undirected-graph.ts +16 -11
- package/src/data-structures/hash/coordinate-map.ts +11 -8
- package/src/data-structures/hash/coordinate-set.ts +11 -8
- package/src/data-structures/heap/heap.ts +34 -28
- package/src/data-structures/linked-list/doubly-linked-list.ts +40 -26
- package/src/data-structures/linked-list/singly-linked-list.ts +32 -23
- package/src/data-structures/priority-queue/priority-queue.ts +17 -14
- package/src/data-structures/queue/deque.ts +14 -4
- package/src/utils/types/utils.ts +1 -175
- package/src/utils/utils.ts +1 -484
- package/tests/unit/data-structures/binary-tree/bst.test.ts +40 -31
- package/tests/unit/data-structures/graph/directed-graph.test.ts +31 -34
|
@@ -73,12 +73,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
73
73
|
enumerable: false,
|
|
74
74
|
configurable: true
|
|
75
75
|
});
|
|
76
|
-
/**
|
|
77
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
78
|
-
*/
|
|
79
|
-
BinaryTreeNode.prototype.getId = function () {
|
|
80
|
-
return this._id;
|
|
81
|
-
};
|
|
82
76
|
Object.defineProperty(BinaryTreeNode.prototype, "val", {
|
|
83
77
|
get: function () {
|
|
84
78
|
return this._val;
|
|
@@ -89,12 +83,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
89
83
|
enumerable: false,
|
|
90
84
|
configurable: true
|
|
91
85
|
});
|
|
92
|
-
/**
|
|
93
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
94
|
-
*/
|
|
95
|
-
BinaryTreeNode.prototype.getVal = function () {
|
|
96
|
-
return this._val;
|
|
97
|
-
};
|
|
98
86
|
Object.defineProperty(BinaryTreeNode.prototype, "left", {
|
|
99
87
|
get: function () {
|
|
100
88
|
return this._left;
|
|
@@ -109,12 +97,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
109
97
|
enumerable: false,
|
|
110
98
|
configurable: true
|
|
111
99
|
});
|
|
112
|
-
/**
|
|
113
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
114
|
-
*/
|
|
115
|
-
BinaryTreeNode.prototype.getLeft = function () {
|
|
116
|
-
return this._left;
|
|
117
|
-
};
|
|
118
100
|
Object.defineProperty(BinaryTreeNode.prototype, "right", {
|
|
119
101
|
get: function () {
|
|
120
102
|
return this._right;
|
|
@@ -129,12 +111,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
129
111
|
enumerable: false,
|
|
130
112
|
configurable: true
|
|
131
113
|
});
|
|
132
|
-
/**
|
|
133
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
134
|
-
*/
|
|
135
|
-
BinaryTreeNode.prototype.getRight = function () {
|
|
136
|
-
return this._right;
|
|
137
|
-
};
|
|
138
114
|
Object.defineProperty(BinaryTreeNode.prototype, "parent", {
|
|
139
115
|
get: function () {
|
|
140
116
|
return this._parent;
|
|
@@ -145,12 +121,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
145
121
|
enumerable: false,
|
|
146
122
|
configurable: true
|
|
147
123
|
});
|
|
148
|
-
/**
|
|
149
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
150
|
-
*/
|
|
151
|
-
BinaryTreeNode.prototype.getParent = function () {
|
|
152
|
-
return this._parent;
|
|
153
|
-
};
|
|
154
124
|
Object.defineProperty(BinaryTreeNode.prototype, "familyPosition", {
|
|
155
125
|
get: function () {
|
|
156
126
|
return this._familyPosition;
|
|
@@ -161,12 +131,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
161
131
|
enumerable: false,
|
|
162
132
|
configurable: true
|
|
163
133
|
});
|
|
164
|
-
/**
|
|
165
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
166
|
-
*/
|
|
167
|
-
BinaryTreeNode.prototype.getFamilyPosition = function () {
|
|
168
|
-
return this._familyPosition;
|
|
169
|
-
};
|
|
170
134
|
Object.defineProperty(BinaryTreeNode.prototype, "count", {
|
|
171
135
|
get: function () {
|
|
172
136
|
return this._count;
|
|
@@ -177,12 +141,6 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
177
141
|
enumerable: false,
|
|
178
142
|
configurable: true
|
|
179
143
|
});
|
|
180
|
-
/**
|
|
181
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
182
|
-
*/
|
|
183
|
-
BinaryTreeNode.prototype.getCount = function () {
|
|
184
|
-
return this._count;
|
|
185
|
-
};
|
|
186
144
|
Object.defineProperty(BinaryTreeNode.prototype, "height", {
|
|
187
145
|
get: function () {
|
|
188
146
|
return this._height;
|
|
@@ -193,6 +151,48 @@ var BinaryTreeNode = /** @class */ (function () {
|
|
|
193
151
|
enumerable: false,
|
|
194
152
|
configurable: true
|
|
195
153
|
});
|
|
154
|
+
/**
|
|
155
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
156
|
+
*/
|
|
157
|
+
BinaryTreeNode.prototype.getId = function () {
|
|
158
|
+
return this._id;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
162
|
+
*/
|
|
163
|
+
BinaryTreeNode.prototype.getVal = function () {
|
|
164
|
+
return this._val;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
168
|
+
*/
|
|
169
|
+
BinaryTreeNode.prototype.getLeft = function () {
|
|
170
|
+
return this._left;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
174
|
+
*/
|
|
175
|
+
BinaryTreeNode.prototype.getRight = function () {
|
|
176
|
+
return this._right;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
180
|
+
*/
|
|
181
|
+
BinaryTreeNode.prototype.getParent = function () {
|
|
182
|
+
return this._parent;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
186
|
+
*/
|
|
187
|
+
BinaryTreeNode.prototype.getFamilyPosition = function () {
|
|
188
|
+
return this._familyPosition;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
192
|
+
*/
|
|
193
|
+
BinaryTreeNode.prototype.getCount = function () {
|
|
194
|
+
return this._count;
|
|
195
|
+
};
|
|
196
196
|
/**
|
|
197
197
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
198
198
|
*/
|
|
@@ -261,13 +261,6 @@ var BinaryTree = /** @class */ (function () {
|
|
|
261
261
|
enumerable: false,
|
|
262
262
|
configurable: true
|
|
263
263
|
});
|
|
264
|
-
/**
|
|
265
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Getters (using the same name as the property) while utilizing separate method names for Setters.
|
|
266
|
-
* @returns The method is returning either a BinaryTreeNode object of type T or null.
|
|
267
|
-
*/
|
|
268
|
-
BinaryTree.prototype.getRoot = function () {
|
|
269
|
-
return this._root;
|
|
270
|
-
};
|
|
271
264
|
Object.defineProperty(BinaryTree.prototype, "size", {
|
|
272
265
|
get: function () {
|
|
273
266
|
return this._size;
|
|
@@ -278,12 +271,6 @@ var BinaryTree = /** @class */ (function () {
|
|
|
278
271
|
enumerable: false,
|
|
279
272
|
configurable: true
|
|
280
273
|
});
|
|
281
|
-
/**
|
|
282
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
283
|
-
*/
|
|
284
|
-
BinaryTree.prototype.getSize = function () {
|
|
285
|
-
return this._size;
|
|
286
|
-
};
|
|
287
274
|
Object.defineProperty(BinaryTree.prototype, "count", {
|
|
288
275
|
get: function () {
|
|
289
276
|
return this._count;
|
|
@@ -294,6 +281,19 @@ var BinaryTree = /** @class */ (function () {
|
|
|
294
281
|
enumerable: false,
|
|
295
282
|
configurable: true
|
|
296
283
|
});
|
|
284
|
+
/**
|
|
285
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Getters (using the same name as the property) while utilizing separate method names for Setters.
|
|
286
|
+
* @returns The method is returning either a BinaryTreeNode object of type T or null.
|
|
287
|
+
*/
|
|
288
|
+
BinaryTree.prototype.getRoot = function () {
|
|
289
|
+
return this._root;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
293
|
+
*/
|
|
294
|
+
BinaryTree.prototype.getSize = function () {
|
|
295
|
+
return this._size;
|
|
296
|
+
};
|
|
297
297
|
/**
|
|
298
298
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
299
299
|
*/
|
|
@@ -10,46 +10,46 @@ export declare class SegmentTreeNode {
|
|
|
10
10
|
constructor(start: number, end: number, sum: number, val?: SegmentTreeNodeVal | null);
|
|
11
11
|
protected _start: number;
|
|
12
12
|
get start(): number;
|
|
13
|
+
set start(v: number);
|
|
14
|
+
protected _end: number;
|
|
15
|
+
get end(): number;
|
|
16
|
+
set end(v: number);
|
|
17
|
+
protected _val: SegmentTreeNodeVal | null;
|
|
18
|
+
get val(): SegmentTreeNodeVal | null;
|
|
19
|
+
set val(v: SegmentTreeNodeVal | null);
|
|
20
|
+
protected _sum: number;
|
|
21
|
+
get sum(): number;
|
|
22
|
+
set sum(v: number);
|
|
23
|
+
protected _left: SegmentTreeNode | null;
|
|
24
|
+
get left(): SegmentTreeNode | null;
|
|
25
|
+
set left(v: SegmentTreeNode | null);
|
|
26
|
+
protected _right: SegmentTreeNode | null;
|
|
27
|
+
get right(): SegmentTreeNode | null;
|
|
28
|
+
set right(v: SegmentTreeNode | null);
|
|
13
29
|
/**
|
|
14
30
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
15
31
|
*/
|
|
16
32
|
getStart(): number;
|
|
17
|
-
set start(v: number);
|
|
18
|
-
protected _end: number;
|
|
19
|
-
get end(): number;
|
|
20
33
|
/**
|
|
21
34
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
22
35
|
*/
|
|
23
36
|
getEnd(): number;
|
|
24
|
-
set end(v: number);
|
|
25
|
-
protected _val: SegmentTreeNodeVal | null;
|
|
26
|
-
get val(): SegmentTreeNodeVal | null;
|
|
27
37
|
/**
|
|
28
38
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
29
39
|
*/
|
|
30
40
|
getVal(): SegmentTreeNodeVal | null;
|
|
31
|
-
set val(v: SegmentTreeNodeVal | null);
|
|
32
|
-
protected _sum: number;
|
|
33
|
-
get sum(): number;
|
|
34
41
|
/**
|
|
35
42
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
36
43
|
*/
|
|
37
44
|
getSum(): number;
|
|
38
|
-
set sum(v: number);
|
|
39
|
-
protected _left: SegmentTreeNode | null;
|
|
40
|
-
get left(): SegmentTreeNode | null;
|
|
41
45
|
/**
|
|
42
46
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
43
47
|
*/
|
|
44
48
|
getLeft(): SegmentTreeNode | null;
|
|
45
|
-
set left(v: SegmentTreeNode | null);
|
|
46
|
-
protected _right: SegmentTreeNode | null;
|
|
47
|
-
get right(): SegmentTreeNode | null;
|
|
48
49
|
/**
|
|
49
50
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
50
51
|
*/
|
|
51
52
|
getRight(): SegmentTreeNode | null;
|
|
52
|
-
set right(v: SegmentTreeNode | null);
|
|
53
53
|
}
|
|
54
54
|
export declare class SegmentTree {
|
|
55
55
|
protected _values: number[];
|
|
@@ -67,11 +67,11 @@ export declare class SegmentTree {
|
|
|
67
67
|
constructor(values: number[], start?: number, end?: number);
|
|
68
68
|
protected _root: SegmentTreeNode | null;
|
|
69
69
|
get root(): SegmentTreeNode | null;
|
|
70
|
+
set root(v: SegmentTreeNode | null);
|
|
70
71
|
/**
|
|
71
72
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
72
73
|
*/
|
|
73
74
|
getRoot(): SegmentTreeNode | null;
|
|
74
|
-
set root(v: SegmentTreeNode | null);
|
|
75
75
|
/**
|
|
76
76
|
* The function builds a segment tree by recursively dividing the given range into smaller segments and creating nodes
|
|
77
77
|
* for each segment.
|
|
@@ -31,12 +31,6 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
31
31
|
enumerable: false,
|
|
32
32
|
configurable: true
|
|
33
33
|
});
|
|
34
|
-
/**
|
|
35
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
36
|
-
*/
|
|
37
|
-
SegmentTreeNode.prototype.getStart = function () {
|
|
38
|
-
return this._start;
|
|
39
|
-
};
|
|
40
34
|
Object.defineProperty(SegmentTreeNode.prototype, "end", {
|
|
41
35
|
get: function () {
|
|
42
36
|
return this._end;
|
|
@@ -47,12 +41,6 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
47
41
|
enumerable: false,
|
|
48
42
|
configurable: true
|
|
49
43
|
});
|
|
50
|
-
/**
|
|
51
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
52
|
-
*/
|
|
53
|
-
SegmentTreeNode.prototype.getEnd = function () {
|
|
54
|
-
return this._end;
|
|
55
|
-
};
|
|
56
44
|
Object.defineProperty(SegmentTreeNode.prototype, "val", {
|
|
57
45
|
get: function () {
|
|
58
46
|
return this._val;
|
|
@@ -63,12 +51,6 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
63
51
|
enumerable: false,
|
|
64
52
|
configurable: true
|
|
65
53
|
});
|
|
66
|
-
/**
|
|
67
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
68
|
-
*/
|
|
69
|
-
SegmentTreeNode.prototype.getVal = function () {
|
|
70
|
-
return this._val;
|
|
71
|
-
};
|
|
72
54
|
Object.defineProperty(SegmentTreeNode.prototype, "sum", {
|
|
73
55
|
get: function () {
|
|
74
56
|
return this._sum;
|
|
@@ -79,12 +61,6 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
79
61
|
enumerable: false,
|
|
80
62
|
configurable: true
|
|
81
63
|
});
|
|
82
|
-
/**
|
|
83
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
84
|
-
*/
|
|
85
|
-
SegmentTreeNode.prototype.getSum = function () {
|
|
86
|
-
return this._sum;
|
|
87
|
-
};
|
|
88
64
|
Object.defineProperty(SegmentTreeNode.prototype, "left", {
|
|
89
65
|
get: function () {
|
|
90
66
|
return this._left;
|
|
@@ -95,12 +71,6 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
95
71
|
enumerable: false,
|
|
96
72
|
configurable: true
|
|
97
73
|
});
|
|
98
|
-
/**
|
|
99
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
100
|
-
*/
|
|
101
|
-
SegmentTreeNode.prototype.getLeft = function () {
|
|
102
|
-
return this._left;
|
|
103
|
-
};
|
|
104
74
|
Object.defineProperty(SegmentTreeNode.prototype, "right", {
|
|
105
75
|
get: function () {
|
|
106
76
|
return this._right;
|
|
@@ -111,6 +81,36 @@ var SegmentTreeNode = /** @class */ (function () {
|
|
|
111
81
|
enumerable: false,
|
|
112
82
|
configurable: true
|
|
113
83
|
});
|
|
84
|
+
/**
|
|
85
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
86
|
+
*/
|
|
87
|
+
SegmentTreeNode.prototype.getStart = function () {
|
|
88
|
+
return this._start;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
92
|
+
*/
|
|
93
|
+
SegmentTreeNode.prototype.getEnd = function () {
|
|
94
|
+
return this._end;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
98
|
+
*/
|
|
99
|
+
SegmentTreeNode.prototype.getVal = function () {
|
|
100
|
+
return this._val;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
104
|
+
*/
|
|
105
|
+
SegmentTreeNode.prototype.getSum = function () {
|
|
106
|
+
return this._sum;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
110
|
+
*/
|
|
111
|
+
SegmentTreeNode.prototype.getLeft = function () {
|
|
112
|
+
return this._left;
|
|
113
|
+
};
|
|
114
114
|
/**
|
|
115
115
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
116
116
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DijkstraResult, IGraph, VertexId } from '../types';
|
|
2
2
|
export declare class AbstractVertex {
|
|
3
|
+
constructor(id: VertexId);
|
|
3
4
|
protected _id: VertexId;
|
|
4
5
|
get id(): VertexId;
|
|
6
|
+
set id(v: VertexId);
|
|
5
7
|
/**
|
|
6
8
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
7
9
|
*/
|
|
8
10
|
getId(): VertexId;
|
|
9
|
-
set id(v: VertexId);
|
|
10
|
-
constructor(id: VertexId);
|
|
11
11
|
}
|
|
12
12
|
export declare abstract class AbstractEdge {
|
|
13
13
|
static DEFAULT_EDGE_WEIGHT: number;
|
|
@@ -19,18 +19,18 @@ export declare abstract class AbstractEdge {
|
|
|
19
19
|
protected constructor(weight?: number);
|
|
20
20
|
private _weight;
|
|
21
21
|
get weight(): number;
|
|
22
|
+
set weight(v: number);
|
|
23
|
+
private _hashCode;
|
|
24
|
+
get hashCode(): string;
|
|
25
|
+
set hashCode(v: string);
|
|
22
26
|
/**
|
|
23
27
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
24
28
|
*/
|
|
25
29
|
getWeight(): number;
|
|
26
|
-
set weight(v: number);
|
|
27
|
-
private _hashCode;
|
|
28
|
-
get hashCode(): string;
|
|
29
30
|
/**
|
|
30
31
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
31
32
|
*/
|
|
32
33
|
getHashCode(): string;
|
|
33
|
-
set hashCode(v: string);
|
|
34
34
|
}
|
|
35
35
|
export declare abstract class AbstractGraph<V extends AbstractVertex, E extends AbstractEdge> implements IGraph<V, E> {
|
|
36
36
|
protected _vertices: Map<VertexId, V>;
|
|
@@ -91,12 +91,6 @@ var AbstractEdge = /** @class */ (function () {
|
|
|
91
91
|
enumerable: false,
|
|
92
92
|
configurable: true
|
|
93
93
|
});
|
|
94
|
-
/**
|
|
95
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
96
|
-
*/
|
|
97
|
-
AbstractEdge.prototype.getWeight = function () {
|
|
98
|
-
return this._weight;
|
|
99
|
-
};
|
|
100
94
|
Object.defineProperty(AbstractEdge.prototype, "hashCode", {
|
|
101
95
|
get: function () {
|
|
102
96
|
return this._hashCode;
|
|
@@ -107,6 +101,12 @@ var AbstractEdge = /** @class */ (function () {
|
|
|
107
101
|
enumerable: false,
|
|
108
102
|
configurable: true
|
|
109
103
|
});
|
|
104
|
+
/**
|
|
105
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
106
|
+
*/
|
|
107
|
+
AbstractEdge.prototype.getWeight = function () {
|
|
108
|
+
return this._weight;
|
|
109
|
+
};
|
|
110
110
|
/**
|
|
111
111
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
112
112
|
*/
|
|
@@ -21,18 +21,18 @@ export declare class DirectedEdge extends AbstractEdge {
|
|
|
21
21
|
constructor(src: VertexId, dest: VertexId, weight?: number);
|
|
22
22
|
private _src;
|
|
23
23
|
get src(): VertexId;
|
|
24
|
+
set src(v: VertexId);
|
|
25
|
+
private _dest;
|
|
26
|
+
get dest(): VertexId;
|
|
27
|
+
set dest(v: VertexId);
|
|
24
28
|
/**
|
|
25
29
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
26
30
|
*/
|
|
27
31
|
getSrc(): VertexId;
|
|
28
|
-
set src(v: VertexId);
|
|
29
|
-
private _dest;
|
|
30
|
-
get dest(): VertexId;
|
|
31
32
|
/**
|
|
32
33
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
33
34
|
*/
|
|
34
35
|
getDest(): VertexId;
|
|
35
|
-
set dest(v: VertexId);
|
|
36
36
|
}
|
|
37
37
|
export declare class DirectedGraph<V extends DirectedVertex, E extends DirectedEdge> extends AbstractGraph<V, E> implements IDirectedGraph<V, E> {
|
|
38
38
|
protected _outEdgeMap: Map<V, E[]>;
|
|
@@ -101,12 +101,6 @@ var DirectedEdge = /** @class */ (function (_super) {
|
|
|
101
101
|
enumerable: false,
|
|
102
102
|
configurable: true
|
|
103
103
|
});
|
|
104
|
-
/**
|
|
105
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
106
|
-
*/
|
|
107
|
-
DirectedEdge.prototype.getSrc = function () {
|
|
108
|
-
return this._src;
|
|
109
|
-
};
|
|
110
104
|
Object.defineProperty(DirectedEdge.prototype, "dest", {
|
|
111
105
|
get: function () {
|
|
112
106
|
return this._dest;
|
|
@@ -117,6 +111,12 @@ var DirectedEdge = /** @class */ (function (_super) {
|
|
|
117
111
|
enumerable: false,
|
|
118
112
|
configurable: true
|
|
119
113
|
});
|
|
114
|
+
/**
|
|
115
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
116
|
+
*/
|
|
117
|
+
DirectedEdge.prototype.getSrc = function () {
|
|
118
|
+
return this._src;
|
|
119
|
+
};
|
|
120
120
|
/**
|
|
121
121
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
122
122
|
*/
|
|
@@ -20,21 +20,21 @@ export declare class UndirectedEdge extends AbstractEdge {
|
|
|
20
20
|
constructor(v1: VertexId, v2: VertexId, weight?: number);
|
|
21
21
|
private _vertices;
|
|
22
22
|
get vertices(): [VertexId, VertexId];
|
|
23
|
+
set vertices(v: [VertexId, VertexId]);
|
|
23
24
|
/**
|
|
24
25
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
25
26
|
*/
|
|
26
27
|
getVertices(): [VertexId, VertexId];
|
|
27
|
-
set vertices(v: [VertexId, VertexId]);
|
|
28
28
|
}
|
|
29
29
|
export declare class UndirectedGraph<V extends UndirectedVertex, E extends UndirectedEdge> extends AbstractGraph<V, E> {
|
|
30
|
+
constructor();
|
|
30
31
|
protected _edges: Map<V, E[]>;
|
|
31
32
|
get edges(): Map<V, E[]>;
|
|
33
|
+
protected set edges(v: Map<V, E[]>);
|
|
32
34
|
/**
|
|
33
35
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
34
36
|
*/
|
|
35
37
|
getEdges(): Map<V, E[]>;
|
|
36
|
-
protected set edges(v: Map<V, E[]>);
|
|
37
|
-
constructor();
|
|
38
38
|
/**
|
|
39
39
|
* The function `getEdge` returns the first edge that connects two vertices, or null if no such edge exists.
|
|
40
40
|
* @param {V | null | VertexId} v1 - The parameter `v1` represents either a vertex object (`V`) or a vertex ID
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
8
|
export declare class CoordinateMap<V> extends Map<any, V> {
|
|
9
|
+
constructor(joint?: string);
|
|
9
10
|
protected _joint: string;
|
|
10
11
|
get joint(): string;
|
|
12
|
+
protected set joint(v: string);
|
|
11
13
|
/**
|
|
12
14
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
13
15
|
*/
|
|
14
16
|
getJoint(): string;
|
|
15
|
-
protected set joint(v: string);
|
|
16
|
-
constructor(joint?: string);
|
|
17
17
|
/**
|
|
18
18
|
* The "has" function overrides the base class's "has" function and checks if a key exists in the map by joining the
|
|
19
19
|
* key array with a specified delimiter.
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
8
|
export declare class CoordinateSet extends Set {
|
|
9
|
+
constructor(joint?: string);
|
|
9
10
|
protected _joint: string;
|
|
10
11
|
get joint(): string;
|
|
12
|
+
protected set joint(v: string);
|
|
11
13
|
/**
|
|
12
14
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
13
15
|
*/
|
|
14
16
|
getJoint(): string;
|
|
15
|
-
protected set joint(v: string);
|
|
16
|
-
constructor(joint?: string);
|
|
17
17
|
/**
|
|
18
18
|
* The "has" function overrides the "has" method of the superclass and checks if a value exists in an array after
|
|
19
19
|
* joining its elements with a specified separator.
|
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
import { PriorityQueue } from '../priority-queue';
|
|
9
9
|
import type { HeapItem, HeapOptions } from '../types';
|
|
10
10
|
export declare abstract class Heap<T> {
|
|
11
|
-
protected abstract _pq: PriorityQueue<HeapItem<T>>;
|
|
12
|
-
get pq(): PriorityQueue<HeapItem<T>>;
|
|
13
|
-
/**
|
|
14
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
15
|
-
*/
|
|
16
|
-
getPq(): PriorityQueue<HeapItem<T>>;
|
|
17
|
-
protected set pq(v: PriorityQueue<HeapItem<T>>);
|
|
18
|
-
protected _priorityCb: (element: T) => number;
|
|
19
|
-
get priorityCb(): (element: T) => number;
|
|
20
|
-
/**
|
|
21
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
22
|
-
*/
|
|
23
|
-
getPriorityCb(): (element: T) => number;
|
|
24
|
-
protected set priorityCb(v: (element: T) => number);
|
|
25
11
|
/**
|
|
26
12
|
* The function is a constructor for a class that initializes a priority callback function based on the
|
|
27
13
|
* options provided.
|
|
28
14
|
* @param [options] - An optional object that contains configuration options for the Heap.
|
|
29
15
|
*/
|
|
30
16
|
protected constructor(options?: HeapOptions<T>);
|
|
17
|
+
protected abstract _pq: PriorityQueue<HeapItem<T>>;
|
|
18
|
+
get pq(): PriorityQueue<HeapItem<T>>;
|
|
19
|
+
protected set pq(v: PriorityQueue<HeapItem<T>>);
|
|
20
|
+
protected _priorityCb: (element: T) => number;
|
|
21
|
+
get priorityCb(): (element: T) => number;
|
|
22
|
+
protected set priorityCb(v: (element: T) => number);
|
|
31
23
|
/**
|
|
32
24
|
* The function returns the size of a priority queue.
|
|
33
25
|
* @returns The size of the priority queue.
|
|
34
26
|
*/
|
|
35
27
|
get size(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
30
|
+
*/
|
|
31
|
+
getPq(): PriorityQueue<HeapItem<T>>;
|
|
32
|
+
/**
|
|
33
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
34
|
+
*/
|
|
35
|
+
getPriorityCb(): (element: T) => number;
|
|
36
36
|
/**
|
|
37
37
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
38
38
|
*/
|
|
@@ -29,12 +29,6 @@ var Heap = /** @class */ (function () {
|
|
|
29
29
|
enumerable: false,
|
|
30
30
|
configurable: true
|
|
31
31
|
});
|
|
32
|
-
/**
|
|
33
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
34
|
-
*/
|
|
35
|
-
Heap.prototype.getPq = function () {
|
|
36
|
-
return this._pq;
|
|
37
|
-
};
|
|
38
32
|
Object.defineProperty(Heap.prototype, "priorityCb", {
|
|
39
33
|
get: function () {
|
|
40
34
|
return this._priorityCb;
|
|
@@ -45,12 +39,6 @@ var Heap = /** @class */ (function () {
|
|
|
45
39
|
enumerable: false,
|
|
46
40
|
configurable: true
|
|
47
41
|
});
|
|
48
|
-
/**
|
|
49
|
-
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
50
|
-
*/
|
|
51
|
-
Heap.prototype.getPriorityCb = function () {
|
|
52
|
-
return this._priorityCb;
|
|
53
|
-
};
|
|
54
42
|
Object.defineProperty(Heap.prototype, "size", {
|
|
55
43
|
/**
|
|
56
44
|
* The function returns the size of a priority queue.
|
|
@@ -62,6 +50,18 @@ var Heap = /** @class */ (function () {
|
|
|
62
50
|
enumerable: false,
|
|
63
51
|
configurable: true
|
|
64
52
|
});
|
|
53
|
+
/**
|
|
54
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
55
|
+
*/
|
|
56
|
+
Heap.prototype.getPq = function () {
|
|
57
|
+
return this._pq;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
61
|
+
*/
|
|
62
|
+
Heap.prototype.getPriorityCb = function () {
|
|
63
|
+
return this._priorityCb;
|
|
64
|
+
};
|
|
65
65
|
/**
|
|
66
66
|
* Starting from TypeScript version 5.0 and onwards, the use of distinct access modifiers for Getters and Setters is not permitted. As an alternative, to ensure compatibility, it is necessary to adopt a Java-style approach for Setters (using the same name as the property) while utilizing separate method names for Getters.
|
|
67
67
|
*/
|