priority-queue-typed 2.5.1 → 2.5.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/dist/cjs/index.cjs +105 -56
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +104 -55
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +105 -57
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +104 -56
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/common/error.d.ts +9 -0
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +36 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +77 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +171 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +409 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +411 -6
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +339 -6
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +391 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
- package/dist/types/data-structures/heap/heap.d.ts +42 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +51 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
- package/dist/types/data-structures/queue/deque.d.ts +45 -0
- package/dist/types/data-structures/queue/queue.d.ts +36 -0
- package/dist/types/data-structures/stack/stack.d.ts +30 -0
- package/dist/types/data-structures/trie/trie.d.ts +36 -0
- package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
- package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
- package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
- package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
- package/dist/umd/priority-queue-typed.js +102 -54
- package/dist/umd/priority-queue-typed.js.map +1 -1
- package/dist/umd/priority-queue-typed.min.js +1 -1
- package/dist/umd/priority-queue-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/common/error.ts +19 -1
- package/src/common/index.ts +1 -1
- package/src/data-structures/base/iterable-element-base.ts +3 -2
- package/src/data-structures/binary-tree/avl-tree.ts +47 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +46 -4
- package/src/data-structures/binary-tree/binary-tree.ts +79 -4
- package/src/data-structures/binary-tree/bst.ts +441 -6
- package/src/data-structures/binary-tree/red-black-tree.ts +73 -0
- package/src/data-structures/binary-tree/segment-tree.ts +18 -0
- package/src/data-structures/binary-tree/tree-map.ts +434 -9
- package/src/data-structures/binary-tree/tree-multi-map.ts +426 -5
- package/src/data-structures/binary-tree/tree-multi-set.ts +350 -6
- package/src/data-structures/binary-tree/tree-set.ts +410 -8
- package/src/data-structures/graph/abstract-graph.ts +2 -2
- package/src/data-structures/graph/directed-graph.ts +30 -0
- package/src/data-structures/graph/undirected-graph.ts +27 -0
- package/src/data-structures/hash/hash-map.ts +35 -4
- package/src/data-structures/heap/heap.ts +46 -4
- package/src/data-structures/heap/max-heap.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +51 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +59 -5
- package/src/data-structures/matrix/matrix.ts +33 -9
- package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
- package/src/data-structures/queue/deque.ts +45 -0
- package/src/data-structures/queue/queue.ts +36 -0
- package/src/data-structures/stack/stack.ts +30 -0
- package/src/data-structures/trie/trie.ts +38 -2
- package/src/types/data-structures/binary-tree/bst.ts +1 -0
- package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
- package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
- package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
|
@@ -8,6 +8,11 @@ export interface TreeMapOptions<K, V, R = [K, V]> {
|
|
|
8
8
|
* - `false`: store values on tree nodes (Node Mode).
|
|
9
9
|
*/
|
|
10
10
|
isMapMode?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable order-statistic operations (select, rank, rangeByRank).
|
|
13
|
+
* When true, subtree counts are maintained on every node.
|
|
14
|
+
*/
|
|
15
|
+
enableOrderStatistic?: boolean;
|
|
11
16
|
/**
|
|
12
17
|
* Transform raw elements into `[key, value]` entries.
|
|
13
18
|
* When provided, the constructor accepts `Iterable<R>` instead of `Iterable<[K, V]>`.
|
|
@@ -8,6 +8,10 @@ export interface TreeMultiSetOptions<K, R = K> {
|
|
|
8
8
|
* - `false`: Node Mode.
|
|
9
9
|
*/
|
|
10
10
|
isMapMode?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable order-statistic operations (select, rank, rangeByRank).
|
|
13
|
+
*/
|
|
14
|
+
enableOrderStatistic?: boolean;
|
|
11
15
|
/**
|
|
12
16
|
* Transform raw elements into keys.
|
|
13
17
|
* When provided, the constructor accepts `Iterable<R>` instead of `Iterable<K>`.
|
|
@@ -8,6 +8,10 @@ export interface TreeSetOptions<K, R = K> {
|
|
|
8
8
|
* - `false`: store values on tree nodes (Node Mode).
|
|
9
9
|
*/
|
|
10
10
|
isMapMode?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable order-statistic operations (select, rank, rangeByRank).
|
|
13
|
+
*/
|
|
14
|
+
enableOrderStatistic?: boolean;
|
|
11
15
|
/**
|
|
12
16
|
* Transform raw elements into keys.
|
|
13
17
|
* When provided, the constructor accepts `Iterable<R>` instead of `Iterable<K>`.
|
|
@@ -33,9 +33,61 @@ var priorityQueueTyped = (() => {
|
|
|
33
33
|
MinHeap: () => MinHeap,
|
|
34
34
|
MinPriorityQueue: () => MinPriorityQueue,
|
|
35
35
|
PriorityQueue: () => PriorityQueue,
|
|
36
|
-
Range: () => Range
|
|
36
|
+
Range: () => Range,
|
|
37
|
+
raise: () => raise
|
|
37
38
|
});
|
|
38
39
|
|
|
40
|
+
// src/common/error.ts
|
|
41
|
+
function raise(ErrorClass, message) {
|
|
42
|
+
throw new ErrorClass(message);
|
|
43
|
+
}
|
|
44
|
+
var ERR = {
|
|
45
|
+
// Range / index
|
|
46
|
+
indexOutOfRange: (index, min, max, ctx) => `${ctx ? ctx + ": " : ""}Index ${index} is out of range [${min}, ${max}].`,
|
|
47
|
+
invalidIndex: (ctx) => `${ctx ? ctx + ": " : ""}Index must be an integer.`,
|
|
48
|
+
// Type / argument
|
|
49
|
+
invalidArgument: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
50
|
+
comparatorRequired: (ctx) => `${ctx ? ctx + ": " : ""}Comparator is required for non-number/non-string/non-Date keys.`,
|
|
51
|
+
invalidKey: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
52
|
+
notAFunction: (name, ctx) => `${ctx ? ctx + ": " : ""}${name} must be a function.`,
|
|
53
|
+
invalidEntry: (ctx) => `${ctx ? ctx + ": " : ""}Each entry must be a [key, value] tuple.`,
|
|
54
|
+
invalidNaN: (ctx) => `${ctx ? ctx + ": " : ""}NaN is not a valid key.`,
|
|
55
|
+
invalidDate: (ctx) => `${ctx ? ctx + ": " : ""}Invalid Date key.`,
|
|
56
|
+
reduceEmpty: (ctx) => `${ctx ? ctx + ": " : ""}Reduce of empty structure with no initial value.`,
|
|
57
|
+
callbackReturnType: (expected, got, ctx) => `${ctx ? ctx + ": " : ""}Callback must return ${expected}; got ${got}.`,
|
|
58
|
+
// State / operation
|
|
59
|
+
invalidOperation: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
60
|
+
// Matrix
|
|
61
|
+
matrixDimensionMismatch: (op) => `Matrix: Dimensions must be compatible for ${op}.`,
|
|
62
|
+
matrixSingular: () => "Matrix: Singular matrix, inverse does not exist.",
|
|
63
|
+
matrixNotSquare: () => "Matrix: Must be square for inversion.",
|
|
64
|
+
matrixNotRectangular: () => "Matrix: Must be rectangular for transposition.",
|
|
65
|
+
matrixRowMismatch: (expected, got) => `Matrix: Expected row length ${expected}, but got ${got}.`,
|
|
66
|
+
// Order statistic
|
|
67
|
+
orderStatisticNotEnabled: (method, ctx) => `${ctx ? ctx + ": " : ""}${method}() requires enableOrderStatistic: true.`
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/common/index.ts
|
|
71
|
+
var DFSOperation = /* @__PURE__ */ ((DFSOperation2) => {
|
|
72
|
+
DFSOperation2[DFSOperation2["VISIT"] = 0] = "VISIT";
|
|
73
|
+
DFSOperation2[DFSOperation2["PROCESS"] = 1] = "PROCESS";
|
|
74
|
+
return DFSOperation2;
|
|
75
|
+
})(DFSOperation || {});
|
|
76
|
+
var Range = class {
|
|
77
|
+
constructor(low, high, includeLow = true, includeHigh = true) {
|
|
78
|
+
this.low = low;
|
|
79
|
+
this.high = high;
|
|
80
|
+
this.includeLow = includeLow;
|
|
81
|
+
this.includeHigh = includeHigh;
|
|
82
|
+
}
|
|
83
|
+
// Determine whether a key is within the range
|
|
84
|
+
isInRange(key, comparator) {
|
|
85
|
+
const lowCheck = this.includeLow ? comparator(key, this.low) >= 0 : comparator(key, this.low) > 0;
|
|
86
|
+
const highCheck = this.includeHigh ? comparator(key, this.high) <= 0 : comparator(key, this.high) < 0;
|
|
87
|
+
return lowCheck && highCheck;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
39
91
|
// src/data-structures/base/iterable-element-base.ts
|
|
40
92
|
var IterableElementBase = class {
|
|
41
93
|
/**
|
|
@@ -58,7 +110,7 @@ var priorityQueueTyped = (() => {
|
|
|
58
110
|
if (options) {
|
|
59
111
|
const { toElementFn } = options;
|
|
60
112
|
if (typeof toElementFn === "function") this._toElementFn = toElementFn;
|
|
61
|
-
else if (toElementFn)
|
|
113
|
+
else if (toElementFn) raise(TypeError, "toElementFn must be a function type");
|
|
62
114
|
}
|
|
63
115
|
}
|
|
64
116
|
/**
|
|
@@ -214,7 +266,7 @@ var priorityQueueTyped = (() => {
|
|
|
214
266
|
acc = initialValue;
|
|
215
267
|
} else {
|
|
216
268
|
const first = iter.next();
|
|
217
|
-
if (first.done)
|
|
269
|
+
if (first.done) raise(TypeError, "Reduce of empty structure with no initial value");
|
|
218
270
|
acc = first.value;
|
|
219
271
|
index = 1;
|
|
220
272
|
}
|
|
@@ -256,52 +308,6 @@ var priorityQueueTyped = (() => {
|
|
|
256
308
|
}
|
|
257
309
|
};
|
|
258
310
|
|
|
259
|
-
// src/common/error.ts
|
|
260
|
-
var ERR = {
|
|
261
|
-
// Range / index
|
|
262
|
-
indexOutOfRange: (index, min, max, ctx) => `${ctx ? ctx + ": " : ""}Index ${index} is out of range [${min}, ${max}].`,
|
|
263
|
-
invalidIndex: (ctx) => `${ctx ? ctx + ": " : ""}Index must be an integer.`,
|
|
264
|
-
// Type / argument
|
|
265
|
-
invalidArgument: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
266
|
-
comparatorRequired: (ctx) => `${ctx ? ctx + ": " : ""}Comparator is required for non-number/non-string/non-Date keys.`,
|
|
267
|
-
invalidKey: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
268
|
-
notAFunction: (name, ctx) => `${ctx ? ctx + ": " : ""}${name} must be a function.`,
|
|
269
|
-
invalidEntry: (ctx) => `${ctx ? ctx + ": " : ""}Each entry must be a [key, value] tuple.`,
|
|
270
|
-
invalidNaN: (ctx) => `${ctx ? ctx + ": " : ""}NaN is not a valid key.`,
|
|
271
|
-
invalidDate: (ctx) => `${ctx ? ctx + ": " : ""}Invalid Date key.`,
|
|
272
|
-
reduceEmpty: (ctx) => `${ctx ? ctx + ": " : ""}Reduce of empty structure with no initial value.`,
|
|
273
|
-
callbackReturnType: (expected, got, ctx) => `${ctx ? ctx + ": " : ""}Callback must return ${expected}; got ${got}.`,
|
|
274
|
-
// State / operation
|
|
275
|
-
invalidOperation: (reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`,
|
|
276
|
-
// Matrix
|
|
277
|
-
matrixDimensionMismatch: (op) => `Matrix: Dimensions must be compatible for ${op}.`,
|
|
278
|
-
matrixSingular: () => "Matrix: Singular matrix, inverse does not exist.",
|
|
279
|
-
matrixNotSquare: () => "Matrix: Must be square for inversion.",
|
|
280
|
-
matrixNotRectangular: () => "Matrix: Must be rectangular for transposition.",
|
|
281
|
-
matrixRowMismatch: (expected, got) => `Matrix: Expected row length ${expected}, but got ${got}.`
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// src/common/index.ts
|
|
285
|
-
var DFSOperation = /* @__PURE__ */ ((DFSOperation2) => {
|
|
286
|
-
DFSOperation2[DFSOperation2["VISIT"] = 0] = "VISIT";
|
|
287
|
-
DFSOperation2[DFSOperation2["PROCESS"] = 1] = "PROCESS";
|
|
288
|
-
return DFSOperation2;
|
|
289
|
-
})(DFSOperation || {});
|
|
290
|
-
var Range = class {
|
|
291
|
-
constructor(low, high, includeLow = true, includeHigh = true) {
|
|
292
|
-
this.low = low;
|
|
293
|
-
this.high = high;
|
|
294
|
-
this.includeLow = includeLow;
|
|
295
|
-
this.includeHigh = includeHigh;
|
|
296
|
-
}
|
|
297
|
-
// Determine whether a key is within the range
|
|
298
|
-
isInRange(key, comparator) {
|
|
299
|
-
const lowCheck = this.includeLow ? comparator(key, this.low) >= 0 : comparator(key, this.low) > 0;
|
|
300
|
-
const highCheck = this.includeHigh ? comparator(key, this.high) <= 0 : comparator(key, this.high) < 0;
|
|
301
|
-
return lowCheck && highCheck;
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
|
|
305
311
|
// src/data-structures/heap/heap.ts
|
|
306
312
|
var Heap = class _Heap extends IterableElementBase {
|
|
307
313
|
/**
|
|
@@ -317,7 +323,7 @@ var priorityQueueTyped = (() => {
|
|
|
317
323
|
__publicField(this, "_elements", []);
|
|
318
324
|
__publicField(this, "_DEFAULT_COMPARATOR", (a, b) => {
|
|
319
325
|
if (typeof a === "object" || typeof b === "object") {
|
|
320
|
-
|
|
326
|
+
raise(TypeError, ERR.comparatorRequired("Heap"));
|
|
321
327
|
}
|
|
322
328
|
if (a > b) return 1;
|
|
323
329
|
if (a < b) return -1;
|
|
@@ -370,6 +376,9 @@ var priorityQueueTyped = (() => {
|
|
|
370
376
|
|
|
371
377
|
|
|
372
378
|
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
373
382
|
|
|
374
383
|
|
|
375
384
|
|
|
@@ -454,6 +463,9 @@ var priorityQueueTyped = (() => {
|
|
|
454
463
|
|
|
455
464
|
|
|
456
465
|
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
457
469
|
|
|
458
470
|
|
|
459
471
|
|
|
@@ -508,6 +520,9 @@ var priorityQueueTyped = (() => {
|
|
|
508
520
|
|
|
509
521
|
|
|
510
522
|
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
511
526
|
|
|
512
527
|
|
|
513
528
|
|
|
@@ -564,6 +579,9 @@ var priorityQueueTyped = (() => {
|
|
|
564
579
|
|
|
565
580
|
|
|
566
581
|
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
567
585
|
|
|
568
586
|
|
|
569
587
|
|
|
@@ -636,6 +654,9 @@ var priorityQueueTyped = (() => {
|
|
|
636
654
|
|
|
637
655
|
|
|
638
656
|
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
639
660
|
|
|
640
661
|
|
|
641
662
|
|
|
@@ -733,6 +754,9 @@ var priorityQueueTyped = (() => {
|
|
|
733
754
|
|
|
734
755
|
|
|
735
756
|
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
736
760
|
|
|
737
761
|
|
|
738
762
|
|
|
@@ -777,6 +801,9 @@ var priorityQueueTyped = (() => {
|
|
|
777
801
|
|
|
778
802
|
|
|
779
803
|
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
780
807
|
|
|
781
808
|
|
|
782
809
|
|
|
@@ -824,6 +851,9 @@ var priorityQueueTyped = (() => {
|
|
|
824
851
|
|
|
825
852
|
|
|
826
853
|
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
827
857
|
|
|
828
858
|
|
|
829
859
|
|
|
@@ -868,6 +898,9 @@ var priorityQueueTyped = (() => {
|
|
|
868
898
|
|
|
869
899
|
|
|
870
900
|
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
871
904
|
|
|
872
905
|
|
|
873
906
|
|
|
@@ -958,6 +991,9 @@ var priorityQueueTyped = (() => {
|
|
|
958
991
|
|
|
959
992
|
|
|
960
993
|
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
|
|
961
997
|
|
|
962
998
|
|
|
963
999
|
|
|
@@ -1035,6 +1071,9 @@ var priorityQueueTyped = (() => {
|
|
|
1035
1071
|
|
|
1036
1072
|
|
|
1037
1073
|
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1038
1077
|
|
|
1039
1078
|
|
|
1040
1079
|
|
|
@@ -1085,6 +1124,9 @@ var priorityQueueTyped = (() => {
|
|
|
1085
1124
|
|
|
1086
1125
|
|
|
1087
1126
|
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
|
|
1088
1130
|
|
|
1089
1131
|
|
|
1090
1132
|
|
|
@@ -1134,6 +1176,9 @@ var priorityQueueTyped = (() => {
|
|
|
1134
1176
|
|
|
1135
1177
|
|
|
1136
1178
|
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
|
|
1137
1182
|
|
|
1138
1183
|
|
|
1139
1184
|
|
|
@@ -1190,6 +1235,9 @@ var priorityQueueTyped = (() => {
|
|
|
1190
1235
|
|
|
1191
1236
|
|
|
1192
1237
|
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1193
1241
|
|
|
1194
1242
|
|
|
1195
1243
|
|
|
@@ -1202,7 +1250,7 @@ var priorityQueueTyped = (() => {
|
|
|
1202
1250
|
*/
|
|
1203
1251
|
map(callback, options, thisArg) {
|
|
1204
1252
|
const { comparator, toElementFn, ...rest } = options != null ? options : {};
|
|
1205
|
-
if (!comparator)
|
|
1253
|
+
if (!comparator) raise(TypeError, ERR.comparatorRequired("Heap.map"));
|
|
1206
1254
|
const out = this._createLike([], { ...rest, comparator, toElementFn });
|
|
1207
1255
|
let i = 0;
|
|
1208
1256
|
for (const x of this) {
|
|
@@ -1330,7 +1378,7 @@ var priorityQueueTyped = (() => {
|
|
|
1330
1378
|
__publicField(this, "_comparator");
|
|
1331
1379
|
this.clear();
|
|
1332
1380
|
this._comparator = comparator || this._defaultComparator;
|
|
1333
|
-
if (typeof this.comparator !== "function")
|
|
1381
|
+
if (typeof this.comparator !== "function") raise(TypeError, ERR.notAFunction("comparator", "FibonacciHeap"));
|
|
1334
1382
|
}
|
|
1335
1383
|
/**
|
|
1336
1384
|
* Get the circular root list head.
|
|
@@ -1539,7 +1587,7 @@ var priorityQueueTyped = (() => {
|
|
|
1539
1587
|
super(elements, {
|
|
1540
1588
|
comparator: (a, b) => {
|
|
1541
1589
|
if (typeof a === "object" || typeof b === "object") {
|
|
1542
|
-
|
|
1590
|
+
raise(TypeError, ERR.comparatorRequired("MaxHeap"));
|
|
1543
1591
|
}
|
|
1544
1592
|
if (a < b) return 1;
|
|
1545
1593
|
if (a > b) return -1;
|
|
@@ -1595,7 +1643,7 @@ var priorityQueueTyped = (() => {
|
|
|
1595
1643
|
super(elements, {
|
|
1596
1644
|
comparator: (a, b) => {
|
|
1597
1645
|
if (typeof a === "object" || typeof b === "object") {
|
|
1598
|
-
|
|
1646
|
+
raise(TypeError, ERR.comparatorRequired("MaxPriorityQueue"));
|
|
1599
1647
|
}
|
|
1600
1648
|
if (a < b) return 1;
|
|
1601
1649
|
if (a > b) return -1;
|