data-structure-typed 2.5.3 → 2.6.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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/.husky/pre-commit +3 -0
- package/CHANGELOG.md +1 -1
- package/MIGRATION.md +48 -0
- package/README.md +20 -2
- package/README_CN.md +20 -2
- package/SPECIFICATION.md +24 -0
- package/SPECIFICATION.zh-CN.md +24 -0
- package/dist/cjs/binary-tree.cjs +1897 -19
- package/dist/cjs/graph.cjs +174 -0
- package/dist/cjs/hash.cjs +33 -0
- package/dist/cjs/heap.cjs +71 -0
- package/dist/cjs/index.cjs +2383 -3
- package/dist/cjs/linked-list.cjs +224 -2
- package/dist/cjs/matrix.cjs +24 -0
- package/dist/cjs/priority-queue.cjs +71 -0
- package/dist/cjs/queue.cjs +221 -1
- package/dist/cjs/stack.cjs +59 -0
- package/dist/cjs/trie.cjs +62 -0
- package/dist/cjs-legacy/binary-tree.cjs +1897 -19
- package/dist/cjs-legacy/graph.cjs +174 -0
- package/dist/cjs-legacy/hash.cjs +33 -0
- package/dist/cjs-legacy/heap.cjs +71 -0
- package/dist/cjs-legacy/index.cjs +2383 -3
- package/dist/cjs-legacy/linked-list.cjs +224 -2
- package/dist/cjs-legacy/matrix.cjs +24 -0
- package/dist/cjs-legacy/priority-queue.cjs +71 -0
- package/dist/cjs-legacy/queue.cjs +221 -1
- package/dist/cjs-legacy/stack.cjs +59 -0
- package/dist/cjs-legacy/trie.cjs +62 -0
- package/dist/esm/binary-tree.mjs +1897 -19
- package/dist/esm/graph.mjs +174 -0
- package/dist/esm/hash.mjs +33 -0
- package/dist/esm/heap.mjs +71 -0
- package/dist/esm/index.mjs +2383 -3
- package/dist/esm/linked-list.mjs +224 -2
- package/dist/esm/matrix.mjs +24 -0
- package/dist/esm/priority-queue.mjs +71 -0
- package/dist/esm/queue.mjs +221 -1
- package/dist/esm/stack.mjs +59 -0
- package/dist/esm/trie.mjs +62 -0
- package/dist/esm-legacy/binary-tree.mjs +1897 -19
- package/dist/esm-legacy/graph.mjs +174 -0
- package/dist/esm-legacy/hash.mjs +33 -0
- package/dist/esm-legacy/heap.mjs +71 -0
- package/dist/esm-legacy/index.mjs +2383 -3
- package/dist/esm-legacy/linked-list.mjs +224 -2
- package/dist/esm-legacy/matrix.mjs +24 -0
- package/dist/esm-legacy/priority-queue.mjs +71 -0
- package/dist/esm-legacy/queue.mjs +221 -1
- package/dist/esm-legacy/stack.mjs +59 -0
- package/dist/esm-legacy/trie.mjs +62 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- 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 +75 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +72 -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 +375 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -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 +75 -2
- 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 +90 -1
- 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/umd/data-structure-typed.js +2383 -3
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
- package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
- package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
- package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +30 -26
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
- package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
- package/jest.integration.config.js +1 -2
- package/package.json +51 -50
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +32 -3
- package/src/data-structures/base/linear-base.ts +13 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -493
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -530
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1236
- package/src/data-structures/binary-tree/bst.ts +158 -1010
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1233
- package/src/data-structures/binary-tree/segment-tree.ts +73 -333
- package/src/data-structures/binary-tree/tree-map.ts +462 -4749
- package/src/data-structures/binary-tree/tree-multi-map.ts +310 -4530
- package/src/data-structures/binary-tree/tree-multi-set.ts +300 -3652
- package/src/data-structures/binary-tree/tree-set.ts +437 -4443
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -532
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -484
- package/src/data-structures/hash/hash-map.ts +154 -549
- package/src/data-structures/heap/heap.ts +200 -753
- package/src/data-structures/linked-list/doubly-linked-list.ts +153 -809
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -749
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -864
- package/src/data-structures/matrix/matrix.ts +179 -494
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +241 -807
- package/src/data-structures/queue/queue.ts +102 -589
- package/src/data-structures/stack/stack.ts +76 -475
- package/src/data-structures/trie/trie.ts +98 -592
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
package/dist/esm/binary-tree.mjs
CHANGED
|
@@ -259,6 +259,35 @@ var IterableElementBase = class {
|
|
|
259
259
|
for (const ele of this) if (ele === element) return true;
|
|
260
260
|
return false;
|
|
261
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Check whether a value exists (Array-compatible alias for `has`).
|
|
264
|
+
* @remarks Provided for familiarity when migrating from Array. Time O(n), Space O(1).
|
|
265
|
+
* @param element - Element to search for (uses `===`).
|
|
266
|
+
* @returns `true` if found.
|
|
267
|
+
*/
|
|
268
|
+
includes(element) {
|
|
269
|
+
return this.has(element);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
273
|
+
* @remarks Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
274
|
+
*/
|
|
275
|
+
*entries() {
|
|
276
|
+
let index = 0;
|
|
277
|
+
for (const value of this) {
|
|
278
|
+
yield [index++, value];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Return an iterator of numeric indices (Array-compatible).
|
|
283
|
+
* @remarks Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
284
|
+
*/
|
|
285
|
+
*keys() {
|
|
286
|
+
let index = 0;
|
|
287
|
+
for (const _ of this) {
|
|
288
|
+
yield index++;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
262
291
|
/**
|
|
263
292
|
* Reduces all elements to a single accumulated value.
|
|
264
293
|
*
|
|
@@ -521,6 +550,16 @@ var LinearBase = class _LinearBase extends IterableElementBase {
|
|
|
521
550
|
}
|
|
522
551
|
return this;
|
|
523
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Return a new instance of the same type with elements in reverse order (non-mutating).
|
|
555
|
+
* @remarks Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
|
|
556
|
+
* @returns A new reversed instance.
|
|
557
|
+
*/
|
|
558
|
+
toReversed() {
|
|
559
|
+
const cloned = this.clone();
|
|
560
|
+
cloned.reverse();
|
|
561
|
+
return cloned;
|
|
562
|
+
}
|
|
524
563
|
};
|
|
525
564
|
|
|
526
565
|
// src/data-structures/base/iterable-entry-base.ts
|
|
@@ -800,6 +839,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
800
839
|
|
|
801
840
|
|
|
802
841
|
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
803
845
|
|
|
804
846
|
|
|
805
847
|
|
|
@@ -854,6 +896,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
854
896
|
|
|
855
897
|
|
|
856
898
|
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
857
902
|
|
|
858
903
|
|
|
859
904
|
|
|
@@ -932,6 +977,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
932
977
|
|
|
933
978
|
|
|
934
979
|
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
935
983
|
|
|
936
984
|
|
|
937
985
|
|
|
@@ -998,6 +1046,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
998
1046
|
|
|
999
1047
|
|
|
1000
1048
|
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
|
|
1001
1052
|
|
|
1002
1053
|
|
|
1003
1054
|
|
|
@@ -1071,6 +1122,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1071
1122
|
|
|
1072
1123
|
|
|
1073
1124
|
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1074
1128
|
|
|
1075
1129
|
|
|
1076
1130
|
|
|
@@ -1134,6 +1188,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1134
1188
|
|
|
1135
1189
|
|
|
1136
1190
|
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
|
|
1137
1194
|
|
|
1138
1195
|
|
|
1139
1196
|
|
|
@@ -1190,6 +1247,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1190
1247
|
|
|
1191
1248
|
|
|
1192
1249
|
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1193
1253
|
|
|
1194
1254
|
|
|
1195
1255
|
|
|
@@ -1302,6 +1362,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1302
1362
|
|
|
1303
1363
|
|
|
1304
1364
|
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
|
|
1305
1368
|
|
|
1306
1369
|
|
|
1307
1370
|
|
|
@@ -1352,6 +1415,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1352
1415
|
|
|
1353
1416
|
|
|
1354
1417
|
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
|
|
1355
1421
|
|
|
1356
1422
|
|
|
1357
1423
|
|
|
@@ -1425,6 +1491,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1425
1491
|
|
|
1426
1492
|
|
|
1427
1493
|
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
|
|
1428
1497
|
|
|
1429
1498
|
|
|
1430
1499
|
|
|
@@ -1482,6 +1551,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1482
1551
|
|
|
1483
1552
|
|
|
1484
1553
|
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
|
|
1485
1557
|
|
|
1486
1558
|
|
|
1487
1559
|
|
|
@@ -1543,6 +1615,9 @@ var Queue = class _Queue extends LinearBase {
|
|
|
1543
1615
|
|
|
1544
1616
|
|
|
1545
1617
|
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
|
|
1546
1621
|
|
|
1547
1622
|
|
|
1548
1623
|
|
|
@@ -2047,6 +2122,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2047
2122
|
|
|
2048
2123
|
|
|
2049
2124
|
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2050
2128
|
|
|
2051
2129
|
|
|
2052
2130
|
|
|
@@ -2105,6 +2183,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2105
2183
|
|
|
2106
2184
|
|
|
2107
2185
|
|
|
2186
|
+
|
|
2187
|
+
|
|
2188
|
+
|
|
2108
2189
|
|
|
2109
2190
|
|
|
2110
2191
|
|
|
@@ -2215,6 +2296,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2215
2296
|
|
|
2216
2297
|
|
|
2217
2298
|
|
|
2299
|
+
|
|
2300
|
+
|
|
2301
|
+
|
|
2218
2302
|
|
|
2219
2303
|
|
|
2220
2304
|
|
|
@@ -2261,6 +2345,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2261
2345
|
|
|
2262
2346
|
|
|
2263
2347
|
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
|
|
2264
2351
|
|
|
2265
2352
|
|
|
2266
2353
|
|
|
@@ -2328,6 +2415,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2328
2415
|
|
|
2329
2416
|
|
|
2330
2417
|
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
|
|
2331
2421
|
|
|
2332
2422
|
|
|
2333
2423
|
|
|
@@ -2434,6 +2524,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2434
2524
|
|
|
2435
2525
|
|
|
2436
2526
|
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
|
|
2437
2530
|
|
|
2438
2531
|
|
|
2439
2532
|
|
|
@@ -2538,6 +2631,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2538
2631
|
|
|
2539
2632
|
|
|
2540
2633
|
|
|
2634
|
+
|
|
2635
|
+
|
|
2636
|
+
|
|
2541
2637
|
|
|
2542
2638
|
|
|
2543
2639
|
|
|
@@ -2600,6 +2696,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2600
2696
|
|
|
2601
2697
|
|
|
2602
2698
|
|
|
2699
|
+
|
|
2700
|
+
|
|
2701
|
+
|
|
2603
2702
|
|
|
2604
2703
|
|
|
2605
2704
|
|
|
@@ -2664,6 +2763,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2664
2763
|
|
|
2665
2764
|
|
|
2666
2765
|
|
|
2766
|
+
|
|
2767
|
+
|
|
2768
|
+
|
|
2667
2769
|
|
|
2668
2770
|
|
|
2669
2771
|
|
|
@@ -2716,6 +2818,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2716
2818
|
|
|
2717
2819
|
|
|
2718
2820
|
|
|
2821
|
+
|
|
2822
|
+
|
|
2823
|
+
|
|
2719
2824
|
|
|
2720
2825
|
|
|
2721
2826
|
|
|
@@ -2777,6 +2882,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2777
2882
|
|
|
2778
2883
|
|
|
2779
2884
|
|
|
2885
|
+
|
|
2886
|
+
|
|
2887
|
+
|
|
2780
2888
|
|
|
2781
2889
|
|
|
2782
2890
|
|
|
@@ -2865,6 +2973,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2865
2973
|
|
|
2866
2974
|
|
|
2867
2975
|
|
|
2976
|
+
|
|
2977
|
+
|
|
2978
|
+
|
|
2868
2979
|
|
|
2869
2980
|
|
|
2870
2981
|
|
|
@@ -2930,6 +3041,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
2930
3041
|
|
|
2931
3042
|
|
|
2932
3043
|
|
|
3044
|
+
|
|
3045
|
+
|
|
3046
|
+
|
|
2933
3047
|
|
|
2934
3048
|
|
|
2935
3049
|
|
|
@@ -3411,6 +3525,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
3411
3525
|
|
|
3412
3526
|
|
|
3413
3527
|
|
|
3528
|
+
|
|
3529
|
+
|
|
3530
|
+
|
|
3414
3531
|
|
|
3415
3532
|
|
|
3416
3533
|
|
|
@@ -3467,6 +3584,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
3467
3584
|
|
|
3468
3585
|
|
|
3469
3586
|
|
|
3587
|
+
|
|
3588
|
+
|
|
3589
|
+
|
|
3470
3590
|
|
|
3471
3591
|
|
|
3472
3592
|
|
|
@@ -3527,6 +3647,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
3527
3647
|
|
|
3528
3648
|
|
|
3529
3649
|
|
|
3650
|
+
|
|
3651
|
+
|
|
3652
|
+
|
|
3530
3653
|
|
|
3531
3654
|
|
|
3532
3655
|
|
|
@@ -3612,6 +3735,9 @@ var BinaryTree = class _BinaryTree extends IterableEntryBase {
|
|
|
3612
3735
|
|
|
3613
3736
|
|
|
3614
3737
|
|
|
3738
|
+
|
|
3739
|
+
|
|
3740
|
+
|
|
3615
3741
|
|
|
3616
3742
|
|
|
3617
3743
|
|
|
@@ -4440,6 +4566,12 @@ var BST = class extends BinaryTree {
|
|
|
4440
4566
|
|
|
4441
4567
|
|
|
4442
4568
|
|
|
4569
|
+
|
|
4570
|
+
|
|
4571
|
+
|
|
4572
|
+
|
|
4573
|
+
|
|
4574
|
+
|
|
4443
4575
|
|
|
4444
4576
|
|
|
4445
4577
|
|
|
@@ -4785,6 +4917,15 @@ var BST = class extends BinaryTree {
|
|
|
4785
4917
|
|
|
4786
4918
|
|
|
4787
4919
|
|
|
4920
|
+
|
|
4921
|
+
|
|
4922
|
+
|
|
4923
|
+
|
|
4924
|
+
|
|
4925
|
+
|
|
4926
|
+
|
|
4927
|
+
|
|
4928
|
+
|
|
4788
4929
|
|
|
4789
4930
|
|
|
4790
4931
|
|
|
@@ -4911,6 +5052,12 @@ var BST = class extends BinaryTree {
|
|
|
4911
5052
|
|
|
4912
5053
|
|
|
4913
5054
|
|
|
5055
|
+
|
|
5056
|
+
|
|
5057
|
+
|
|
5058
|
+
|
|
5059
|
+
|
|
5060
|
+
|
|
4914
5061
|
|
|
4915
5062
|
|
|
4916
5063
|
|
|
@@ -5205,6 +5352,9 @@ var BST = class extends BinaryTree {
|
|
|
5205
5352
|
|
|
5206
5353
|
|
|
5207
5354
|
|
|
5355
|
+
|
|
5356
|
+
|
|
5357
|
+
|
|
5208
5358
|
|
|
5209
5359
|
|
|
5210
5360
|
|
|
@@ -5278,6 +5428,9 @@ var BST = class extends BinaryTree {
|
|
|
5278
5428
|
|
|
5279
5429
|
|
|
5280
5430
|
|
|
5431
|
+
|
|
5432
|
+
|
|
5433
|
+
|
|
5281
5434
|
|
|
5282
5435
|
|
|
5283
5436
|
|
|
@@ -5405,6 +5558,12 @@ var BST = class extends BinaryTree {
|
|
|
5405
5558
|
|
|
5406
5559
|
|
|
5407
5560
|
|
|
5561
|
+
|
|
5562
|
+
|
|
5563
|
+
|
|
5564
|
+
|
|
5565
|
+
|
|
5566
|
+
|
|
5408
5567
|
|
|
5409
5568
|
|
|
5410
5569
|
|
|
@@ -6105,6 +6264,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6105
6264
|
|
|
6106
6265
|
|
|
6107
6266
|
|
|
6267
|
+
|
|
6268
|
+
|
|
6269
|
+
|
|
6270
|
+
|
|
6271
|
+
|
|
6272
|
+
|
|
6108
6273
|
|
|
6109
6274
|
|
|
6110
6275
|
|
|
@@ -6189,6 +6354,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6189
6354
|
|
|
6190
6355
|
|
|
6191
6356
|
|
|
6357
|
+
|
|
6358
|
+
|
|
6359
|
+
|
|
6360
|
+
|
|
6361
|
+
|
|
6362
|
+
|
|
6192
6363
|
|
|
6193
6364
|
|
|
6194
6365
|
|
|
@@ -6273,6 +6444,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6273
6444
|
|
|
6274
6445
|
|
|
6275
6446
|
|
|
6447
|
+
|
|
6448
|
+
|
|
6449
|
+
|
|
6450
|
+
|
|
6451
|
+
|
|
6452
|
+
|
|
6276
6453
|
|
|
6277
6454
|
|
|
6278
6455
|
|
|
@@ -6357,6 +6534,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6357
6534
|
|
|
6358
6535
|
|
|
6359
6536
|
|
|
6537
|
+
|
|
6538
|
+
|
|
6539
|
+
|
|
6540
|
+
|
|
6541
|
+
|
|
6542
|
+
|
|
6360
6543
|
|
|
6361
6544
|
|
|
6362
6545
|
|
|
@@ -6439,6 +6622,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6439
6622
|
|
|
6440
6623
|
|
|
6441
6624
|
|
|
6625
|
+
|
|
6626
|
+
|
|
6627
|
+
|
|
6628
|
+
|
|
6629
|
+
|
|
6630
|
+
|
|
6442
6631
|
|
|
6443
6632
|
|
|
6444
6633
|
|
|
@@ -6528,6 +6717,12 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6528
6717
|
|
|
6529
6718
|
|
|
6530
6719
|
|
|
6720
|
+
|
|
6721
|
+
|
|
6722
|
+
|
|
6723
|
+
|
|
6724
|
+
|
|
6725
|
+
|
|
6531
6726
|
|
|
6532
6727
|
|
|
6533
6728
|
|
|
@@ -6585,6 +6780,9 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6585
6780
|
|
|
6586
6781
|
|
|
6587
6782
|
|
|
6783
|
+
|
|
6784
|
+
|
|
6785
|
+
|
|
6588
6786
|
|
|
6589
6787
|
|
|
6590
6788
|
|
|
@@ -6650,6 +6848,9 @@ var BinaryIndexedTree = class _BinaryIndexedTree {
|
|
|
6650
6848
|
|
|
6651
6849
|
|
|
6652
6850
|
|
|
6851
|
+
|
|
6852
|
+
|
|
6853
|
+
|
|
6653
6854
|
|
|
6654
6855
|
|
|
6655
6856
|
|
|
@@ -6818,6 +7019,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
6818
7019
|
|
|
6819
7020
|
|
|
6820
7021
|
|
|
7022
|
+
|
|
7023
|
+
|
|
7024
|
+
|
|
6821
7025
|
|
|
6822
7026
|
|
|
6823
7027
|
|
|
@@ -6894,6 +7098,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
6894
7098
|
|
|
6895
7099
|
|
|
6896
7100
|
|
|
7101
|
+
|
|
7102
|
+
|
|
7103
|
+
|
|
6897
7104
|
|
|
6898
7105
|
|
|
6899
7106
|
|
|
@@ -6964,6 +7171,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
6964
7171
|
|
|
6965
7172
|
|
|
6966
7173
|
|
|
7174
|
+
|
|
7175
|
+
|
|
7176
|
+
|
|
6967
7177
|
|
|
6968
7178
|
|
|
6969
7179
|
|
|
@@ -7041,6 +7251,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
7041
7251
|
|
|
7042
7252
|
|
|
7043
7253
|
|
|
7254
|
+
|
|
7255
|
+
|
|
7256
|
+
|
|
7044
7257
|
|
|
7045
7258
|
|
|
7046
7259
|
|
|
@@ -7096,6 +7309,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
7096
7309
|
|
|
7097
7310
|
|
|
7098
7311
|
|
|
7312
|
+
|
|
7313
|
+
|
|
7314
|
+
|
|
7099
7315
|
|
|
7100
7316
|
|
|
7101
7317
|
|
|
@@ -7177,6 +7393,9 @@ var SegmentTree = class _SegmentTree {
|
|
|
7177
7393
|
|
|
7178
7394
|
|
|
7179
7395
|
|
|
7396
|
+
|
|
7397
|
+
|
|
7398
|
+
|
|
7180
7399
|
|
|
7181
7400
|
|
|
7182
7401
|
|
|
@@ -7581,6 +7800,18 @@ var AVLTree = class extends BST {
|
|
|
7581
7800
|
|
|
7582
7801
|
|
|
7583
7802
|
|
|
7803
|
+
|
|
7804
|
+
|
|
7805
|
+
|
|
7806
|
+
|
|
7807
|
+
|
|
7808
|
+
|
|
7809
|
+
|
|
7810
|
+
|
|
7811
|
+
|
|
7812
|
+
|
|
7813
|
+
|
|
7814
|
+
|
|
7584
7815
|
|
|
7585
7816
|
|
|
7586
7817
|
|
|
@@ -7720,6 +7951,15 @@ var AVLTree = class extends BST {
|
|
|
7720
7951
|
|
|
7721
7952
|
|
|
7722
7953
|
|
|
7954
|
+
|
|
7955
|
+
|
|
7956
|
+
|
|
7957
|
+
|
|
7958
|
+
|
|
7959
|
+
|
|
7960
|
+
|
|
7961
|
+
|
|
7962
|
+
|
|
7723
7963
|
|
|
7724
7964
|
|
|
7725
7965
|
|
|
@@ -7814,6 +8054,12 @@ var AVLTree = class extends BST {
|
|
|
7814
8054
|
|
|
7815
8055
|
|
|
7816
8056
|
|
|
8057
|
+
|
|
8058
|
+
|
|
8059
|
+
|
|
8060
|
+
|
|
8061
|
+
|
|
8062
|
+
|
|
7817
8063
|
|
|
7818
8064
|
|
|
7819
8065
|
|
|
@@ -7959,6 +8205,15 @@ var AVLTree = class extends BST {
|
|
|
7959
8205
|
|
|
7960
8206
|
|
|
7961
8207
|
|
|
8208
|
+
|
|
8209
|
+
|
|
8210
|
+
|
|
8211
|
+
|
|
8212
|
+
|
|
8213
|
+
|
|
8214
|
+
|
|
8215
|
+
|
|
8216
|
+
|
|
7962
8217
|
|
|
7963
8218
|
|
|
7964
8219
|
|
|
@@ -8594,6 +8849,18 @@ var RedBlackTree = class extends BST {
|
|
|
8594
8849
|
|
|
8595
8850
|
|
|
8596
8851
|
|
|
8852
|
+
|
|
8853
|
+
|
|
8854
|
+
|
|
8855
|
+
|
|
8856
|
+
|
|
8857
|
+
|
|
8858
|
+
|
|
8859
|
+
|
|
8860
|
+
|
|
8861
|
+
|
|
8862
|
+
|
|
8863
|
+
|
|
8597
8864
|
|
|
8598
8865
|
|
|
8599
8866
|
|
|
@@ -9098,16 +9365,28 @@ var RedBlackTree = class extends BST {
|
|
|
9098
9365
|
|
|
9099
9366
|
|
|
9100
9367
|
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9368
|
+
|
|
9369
|
+
|
|
9370
|
+
|
|
9371
|
+
|
|
9372
|
+
|
|
9373
|
+
|
|
9374
|
+
|
|
9375
|
+
|
|
9376
|
+
|
|
9377
|
+
|
|
9378
|
+
|
|
9379
|
+
|
|
9380
|
+
* @example
|
|
9381
|
+
* // basic Red-Black Tree with simple number keys
|
|
9382
|
+
* // Create a simple Red-Black Tree with numeric keys
|
|
9383
|
+
* const tree = new RedBlackTree([5, 2, 8, 1, 9]);
|
|
9384
|
+
*
|
|
9385
|
+
* tree.print();
|
|
9386
|
+
* // _2___
|
|
9387
|
+
* // / \
|
|
9388
|
+
* // 1 _8_
|
|
9389
|
+
* // / \
|
|
9111
9390
|
* // 5 9
|
|
9112
9391
|
*
|
|
9113
9392
|
* // Verify the tree maintains sorted order
|
|
@@ -9300,6 +9579,18 @@ var RedBlackTree = class extends BST {
|
|
|
9300
9579
|
|
|
9301
9580
|
|
|
9302
9581
|
|
|
9582
|
+
|
|
9583
|
+
|
|
9584
|
+
|
|
9585
|
+
|
|
9586
|
+
|
|
9587
|
+
|
|
9588
|
+
|
|
9589
|
+
|
|
9590
|
+
|
|
9591
|
+
|
|
9592
|
+
|
|
9593
|
+
|
|
9303
9594
|
|
|
9304
9595
|
|
|
9305
9596
|
|
|
@@ -9498,6 +9789,15 @@ var RedBlackTree = class extends BST {
|
|
|
9498
9789
|
|
|
9499
9790
|
|
|
9500
9791
|
|
|
9792
|
+
|
|
9793
|
+
|
|
9794
|
+
|
|
9795
|
+
|
|
9796
|
+
|
|
9797
|
+
|
|
9798
|
+
|
|
9799
|
+
|
|
9800
|
+
|
|
9501
9801
|
|
|
9502
9802
|
|
|
9503
9803
|
|
|
@@ -9663,6 +9963,18 @@ var RedBlackTree = class extends BST {
|
|
|
9663
9963
|
|
|
9664
9964
|
|
|
9665
9965
|
|
|
9966
|
+
|
|
9967
|
+
|
|
9968
|
+
|
|
9969
|
+
|
|
9970
|
+
|
|
9971
|
+
|
|
9972
|
+
|
|
9973
|
+
|
|
9974
|
+
|
|
9975
|
+
|
|
9976
|
+
|
|
9977
|
+
|
|
9666
9978
|
|
|
9667
9979
|
|
|
9668
9980
|
|
|
@@ -10197,6 +10509,21 @@ var TreeSet = class _TreeSet {
|
|
|
10197
10509
|
|
|
10198
10510
|
|
|
10199
10511
|
|
|
10512
|
+
|
|
10513
|
+
|
|
10514
|
+
|
|
10515
|
+
|
|
10516
|
+
|
|
10517
|
+
|
|
10518
|
+
|
|
10519
|
+
|
|
10520
|
+
|
|
10521
|
+
|
|
10522
|
+
|
|
10523
|
+
|
|
10524
|
+
|
|
10525
|
+
|
|
10526
|
+
|
|
10200
10527
|
|
|
10201
10528
|
|
|
10202
10529
|
|
|
@@ -10401,6 +10728,21 @@ var TreeSet = class _TreeSet {
|
|
|
10401
10728
|
|
|
10402
10729
|
|
|
10403
10730
|
|
|
10731
|
+
|
|
10732
|
+
|
|
10733
|
+
|
|
10734
|
+
|
|
10735
|
+
|
|
10736
|
+
|
|
10737
|
+
|
|
10738
|
+
|
|
10739
|
+
|
|
10740
|
+
|
|
10741
|
+
|
|
10742
|
+
|
|
10743
|
+
|
|
10744
|
+
|
|
10745
|
+
|
|
10404
10746
|
|
|
10405
10747
|
|
|
10406
10748
|
|
|
@@ -10446,6 +10788,18 @@ var TreeSet = class _TreeSet {
|
|
|
10446
10788
|
|
|
10447
10789
|
|
|
10448
10790
|
|
|
10791
|
+
|
|
10792
|
+
|
|
10793
|
+
|
|
10794
|
+
|
|
10795
|
+
|
|
10796
|
+
|
|
10797
|
+
|
|
10798
|
+
|
|
10799
|
+
|
|
10800
|
+
|
|
10801
|
+
|
|
10802
|
+
|
|
10449
10803
|
|
|
10450
10804
|
|
|
10451
10805
|
|
|
@@ -10645,6 +10999,21 @@ var TreeSet = class _TreeSet {
|
|
|
10645
10999
|
|
|
10646
11000
|
|
|
10647
11001
|
|
|
11002
|
+
|
|
11003
|
+
|
|
11004
|
+
|
|
11005
|
+
|
|
11006
|
+
|
|
11007
|
+
|
|
11008
|
+
|
|
11009
|
+
|
|
11010
|
+
|
|
11011
|
+
|
|
11012
|
+
|
|
11013
|
+
|
|
11014
|
+
|
|
11015
|
+
|
|
11016
|
+
|
|
10648
11017
|
|
|
10649
11018
|
|
|
10650
11019
|
|
|
@@ -10849,6 +11218,21 @@ var TreeSet = class _TreeSet {
|
|
|
10849
11218
|
|
|
10850
11219
|
|
|
10851
11220
|
|
|
11221
|
+
|
|
11222
|
+
|
|
11223
|
+
|
|
11224
|
+
|
|
11225
|
+
|
|
11226
|
+
|
|
11227
|
+
|
|
11228
|
+
|
|
11229
|
+
|
|
11230
|
+
|
|
11231
|
+
|
|
11232
|
+
|
|
11233
|
+
|
|
11234
|
+
|
|
11235
|
+
|
|
10852
11236
|
|
|
10853
11237
|
|
|
10854
11238
|
|
|
@@ -11058,6 +11442,21 @@ var TreeSet = class _TreeSet {
|
|
|
11058
11442
|
|
|
11059
11443
|
|
|
11060
11444
|
|
|
11445
|
+
|
|
11446
|
+
|
|
11447
|
+
|
|
11448
|
+
|
|
11449
|
+
|
|
11450
|
+
|
|
11451
|
+
|
|
11452
|
+
|
|
11453
|
+
|
|
11454
|
+
|
|
11455
|
+
|
|
11456
|
+
|
|
11457
|
+
|
|
11458
|
+
|
|
11459
|
+
|
|
11061
11460
|
|
|
11062
11461
|
|
|
11063
11462
|
|
|
@@ -11247,6 +11646,21 @@ var TreeSet = class _TreeSet {
|
|
|
11247
11646
|
|
|
11248
11647
|
|
|
11249
11648
|
|
|
11649
|
+
|
|
11650
|
+
|
|
11651
|
+
|
|
11652
|
+
|
|
11653
|
+
|
|
11654
|
+
|
|
11655
|
+
|
|
11656
|
+
|
|
11657
|
+
|
|
11658
|
+
|
|
11659
|
+
|
|
11660
|
+
|
|
11661
|
+
|
|
11662
|
+
|
|
11663
|
+
|
|
11250
11664
|
|
|
11251
11665
|
|
|
11252
11666
|
|
|
@@ -11437,6 +11851,21 @@ var TreeSet = class _TreeSet {
|
|
|
11437
11851
|
|
|
11438
11852
|
|
|
11439
11853
|
|
|
11854
|
+
|
|
11855
|
+
|
|
11856
|
+
|
|
11857
|
+
|
|
11858
|
+
|
|
11859
|
+
|
|
11860
|
+
|
|
11861
|
+
|
|
11862
|
+
|
|
11863
|
+
|
|
11864
|
+
|
|
11865
|
+
|
|
11866
|
+
|
|
11867
|
+
|
|
11868
|
+
|
|
11440
11869
|
|
|
11441
11870
|
|
|
11442
11871
|
|
|
@@ -11627,6 +12056,21 @@ var TreeSet = class _TreeSet {
|
|
|
11627
12056
|
|
|
11628
12057
|
|
|
11629
12058
|
|
|
12059
|
+
|
|
12060
|
+
|
|
12061
|
+
|
|
12062
|
+
|
|
12063
|
+
|
|
12064
|
+
|
|
12065
|
+
|
|
12066
|
+
|
|
12067
|
+
|
|
12068
|
+
|
|
12069
|
+
|
|
12070
|
+
|
|
12071
|
+
|
|
12072
|
+
|
|
12073
|
+
|
|
11630
12074
|
|
|
11631
12075
|
|
|
11632
12076
|
|
|
@@ -11820,6 +12264,21 @@ var TreeSet = class _TreeSet {
|
|
|
11820
12264
|
|
|
11821
12265
|
|
|
11822
12266
|
|
|
12267
|
+
|
|
12268
|
+
|
|
12269
|
+
|
|
12270
|
+
|
|
12271
|
+
|
|
12272
|
+
|
|
12273
|
+
|
|
12274
|
+
|
|
12275
|
+
|
|
12276
|
+
|
|
12277
|
+
|
|
12278
|
+
|
|
12279
|
+
|
|
12280
|
+
|
|
12281
|
+
|
|
11823
12282
|
|
|
11824
12283
|
|
|
11825
12284
|
|
|
@@ -12013,6 +12472,21 @@ var TreeSet = class _TreeSet {
|
|
|
12013
12472
|
|
|
12014
12473
|
|
|
12015
12474
|
|
|
12475
|
+
|
|
12476
|
+
|
|
12477
|
+
|
|
12478
|
+
|
|
12479
|
+
|
|
12480
|
+
|
|
12481
|
+
|
|
12482
|
+
|
|
12483
|
+
|
|
12484
|
+
|
|
12485
|
+
|
|
12486
|
+
|
|
12487
|
+
|
|
12488
|
+
|
|
12489
|
+
|
|
12016
12490
|
|
|
12017
12491
|
|
|
12018
12492
|
|
|
@@ -12209,6 +12683,21 @@ var TreeSet = class _TreeSet {
|
|
|
12209
12683
|
|
|
12210
12684
|
|
|
12211
12685
|
|
|
12686
|
+
|
|
12687
|
+
|
|
12688
|
+
|
|
12689
|
+
|
|
12690
|
+
|
|
12691
|
+
|
|
12692
|
+
|
|
12693
|
+
|
|
12694
|
+
|
|
12695
|
+
|
|
12696
|
+
|
|
12697
|
+
|
|
12698
|
+
|
|
12699
|
+
|
|
12700
|
+
|
|
12212
12701
|
|
|
12213
12702
|
|
|
12214
12703
|
|
|
@@ -12405,6 +12894,21 @@ var TreeSet = class _TreeSet {
|
|
|
12405
12894
|
|
|
12406
12895
|
|
|
12407
12896
|
|
|
12897
|
+
|
|
12898
|
+
|
|
12899
|
+
|
|
12900
|
+
|
|
12901
|
+
|
|
12902
|
+
|
|
12903
|
+
|
|
12904
|
+
|
|
12905
|
+
|
|
12906
|
+
|
|
12907
|
+
|
|
12908
|
+
|
|
12909
|
+
|
|
12910
|
+
|
|
12911
|
+
|
|
12408
12912
|
|
|
12409
12913
|
|
|
12410
12914
|
|
|
@@ -12612,15 +13116,30 @@ var TreeSet = class _TreeSet {
|
|
|
12612
13116
|
|
|
12613
13117
|
|
|
12614
13118
|
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
13119
|
+
|
|
13120
|
+
|
|
13121
|
+
|
|
13122
|
+
|
|
13123
|
+
|
|
13124
|
+
|
|
13125
|
+
|
|
13126
|
+
|
|
13127
|
+
|
|
13128
|
+
|
|
13129
|
+
|
|
13130
|
+
|
|
13131
|
+
|
|
13132
|
+
|
|
13133
|
+
|
|
13134
|
+
* @example
|
|
13135
|
+
* // Test all
|
|
13136
|
+
* const ts = new TreeSet<number>([2, 4, 6]);
|
|
13137
|
+
* console.log(ts.every(k => k > 0)); // true;
|
|
13138
|
+
*/
|
|
13139
|
+
every(callbackfn, thisArg) {
|
|
13140
|
+
let index = 0;
|
|
13141
|
+
for (const v of this) {
|
|
13142
|
+
const ok = thisArg === void 0 ? callbackfn(v, index++, this) : callbackfn.call(thisArg, v, index++, this);
|
|
12624
13143
|
if (!ok) return false;
|
|
12625
13144
|
}
|
|
12626
13145
|
return true;
|
|
@@ -12788,6 +13307,21 @@ var TreeSet = class _TreeSet {
|
|
|
12788
13307
|
|
|
12789
13308
|
|
|
12790
13309
|
|
|
13310
|
+
|
|
13311
|
+
|
|
13312
|
+
|
|
13313
|
+
|
|
13314
|
+
|
|
13315
|
+
|
|
13316
|
+
|
|
13317
|
+
|
|
13318
|
+
|
|
13319
|
+
|
|
13320
|
+
|
|
13321
|
+
|
|
13322
|
+
|
|
13323
|
+
|
|
13324
|
+
|
|
12791
13325
|
|
|
12792
13326
|
|
|
12793
13327
|
|
|
@@ -12980,6 +13514,21 @@ var TreeSet = class _TreeSet {
|
|
|
12980
13514
|
|
|
12981
13515
|
|
|
12982
13516
|
|
|
13517
|
+
|
|
13518
|
+
|
|
13519
|
+
|
|
13520
|
+
|
|
13521
|
+
|
|
13522
|
+
|
|
13523
|
+
|
|
13524
|
+
|
|
13525
|
+
|
|
13526
|
+
|
|
13527
|
+
|
|
13528
|
+
|
|
13529
|
+
|
|
13530
|
+
|
|
13531
|
+
|
|
12983
13532
|
|
|
12984
13533
|
|
|
12985
13534
|
|
|
@@ -13175,6 +13724,21 @@ var TreeSet = class _TreeSet {
|
|
|
13175
13724
|
|
|
13176
13725
|
|
|
13177
13726
|
|
|
13727
|
+
|
|
13728
|
+
|
|
13729
|
+
|
|
13730
|
+
|
|
13731
|
+
|
|
13732
|
+
|
|
13733
|
+
|
|
13734
|
+
|
|
13735
|
+
|
|
13736
|
+
|
|
13737
|
+
|
|
13738
|
+
|
|
13739
|
+
|
|
13740
|
+
|
|
13741
|
+
|
|
13178
13742
|
|
|
13179
13743
|
|
|
13180
13744
|
|
|
@@ -13364,6 +13928,21 @@ var TreeSet = class _TreeSet {
|
|
|
13364
13928
|
|
|
13365
13929
|
|
|
13366
13930
|
|
|
13931
|
+
|
|
13932
|
+
|
|
13933
|
+
|
|
13934
|
+
|
|
13935
|
+
|
|
13936
|
+
|
|
13937
|
+
|
|
13938
|
+
|
|
13939
|
+
|
|
13940
|
+
|
|
13941
|
+
|
|
13942
|
+
|
|
13943
|
+
|
|
13944
|
+
|
|
13945
|
+
|
|
13367
13946
|
|
|
13368
13947
|
|
|
13369
13948
|
|
|
@@ -13426,6 +14005,9 @@ var TreeSet = class _TreeSet {
|
|
|
13426
14005
|
|
|
13427
14006
|
|
|
13428
14007
|
|
|
14008
|
+
|
|
14009
|
+
|
|
14010
|
+
|
|
13429
14011
|
|
|
13430
14012
|
|
|
13431
14013
|
|
|
@@ -13498,6 +14080,9 @@ var TreeSet = class _TreeSet {
|
|
|
13498
14080
|
|
|
13499
14081
|
|
|
13500
14082
|
|
|
14083
|
+
|
|
14084
|
+
|
|
14085
|
+
|
|
13501
14086
|
|
|
13502
14087
|
|
|
13503
14088
|
|
|
@@ -13548,6 +14133,9 @@ var TreeSet = class _TreeSet {
|
|
|
13548
14133
|
|
|
13549
14134
|
|
|
13550
14135
|
|
|
14136
|
+
|
|
14137
|
+
|
|
14138
|
+
|
|
13551
14139
|
|
|
13552
14140
|
|
|
13553
14141
|
|
|
@@ -13603,6 +14191,9 @@ var TreeSet = class _TreeSet {
|
|
|
13603
14191
|
|
|
13604
14192
|
|
|
13605
14193
|
|
|
14194
|
+
|
|
14195
|
+
|
|
14196
|
+
|
|
13606
14197
|
|
|
13607
14198
|
|
|
13608
14199
|
|
|
@@ -13759,6 +14350,18 @@ var TreeSet = class _TreeSet {
|
|
|
13759
14350
|
|
|
13760
14351
|
|
|
13761
14352
|
|
|
14353
|
+
|
|
14354
|
+
|
|
14355
|
+
|
|
14356
|
+
|
|
14357
|
+
|
|
14358
|
+
|
|
14359
|
+
|
|
14360
|
+
|
|
14361
|
+
|
|
14362
|
+
|
|
14363
|
+
|
|
14364
|
+
|
|
13762
14365
|
|
|
13763
14366
|
|
|
13764
14367
|
|
|
@@ -13932,6 +14535,18 @@ var TreeSet = class _TreeSet {
|
|
|
13932
14535
|
|
|
13933
14536
|
|
|
13934
14537
|
|
|
14538
|
+
|
|
14539
|
+
|
|
14540
|
+
|
|
14541
|
+
|
|
14542
|
+
|
|
14543
|
+
|
|
14544
|
+
|
|
14545
|
+
|
|
14546
|
+
|
|
14547
|
+
|
|
14548
|
+
|
|
14549
|
+
|
|
13935
14550
|
|
|
13936
14551
|
|
|
13937
14552
|
|
|
@@ -14097,6 +14712,18 @@ var TreeSet = class _TreeSet {
|
|
|
14097
14712
|
|
|
14098
14713
|
|
|
14099
14714
|
|
|
14715
|
+
|
|
14716
|
+
|
|
14717
|
+
|
|
14718
|
+
|
|
14719
|
+
|
|
14720
|
+
|
|
14721
|
+
|
|
14722
|
+
|
|
14723
|
+
|
|
14724
|
+
|
|
14725
|
+
|
|
14726
|
+
|
|
14100
14727
|
|
|
14101
14728
|
|
|
14102
14729
|
|
|
@@ -14260,6 +14887,18 @@ var TreeSet = class _TreeSet {
|
|
|
14260
14887
|
|
|
14261
14888
|
|
|
14262
14889
|
|
|
14890
|
+
|
|
14891
|
+
|
|
14892
|
+
|
|
14893
|
+
|
|
14894
|
+
|
|
14895
|
+
|
|
14896
|
+
|
|
14897
|
+
|
|
14898
|
+
|
|
14899
|
+
|
|
14900
|
+
|
|
14901
|
+
|
|
14263
14902
|
|
|
14264
14903
|
|
|
14265
14904
|
|
|
@@ -14426,6 +15065,18 @@ var TreeSet = class _TreeSet {
|
|
|
14426
15065
|
|
|
14427
15066
|
|
|
14428
15067
|
|
|
15068
|
+
|
|
15069
|
+
|
|
15070
|
+
|
|
15071
|
+
|
|
15072
|
+
|
|
15073
|
+
|
|
15074
|
+
|
|
15075
|
+
|
|
15076
|
+
|
|
15077
|
+
|
|
15078
|
+
|
|
15079
|
+
|
|
14429
15080
|
|
|
14430
15081
|
|
|
14431
15082
|
|
|
@@ -14519,6 +15170,12 @@ var TreeSet = class _TreeSet {
|
|
|
14519
15170
|
|
|
14520
15171
|
|
|
14521
15172
|
|
|
15173
|
+
|
|
15174
|
+
|
|
15175
|
+
|
|
15176
|
+
|
|
15177
|
+
|
|
15178
|
+
|
|
14522
15179
|
* @example
|
|
14523
15180
|
* // Pagination by position in tree order
|
|
14524
15181
|
* const tree = new TreeSet<number>(
|
|
@@ -14711,6 +15368,145 @@ var TreeSet = class _TreeSet {
|
|
|
14711
15368
|
|
|
14712
15369
|
|
|
14713
15370
|
|
|
15371
|
+
|
|
15372
|
+
|
|
15373
|
+
|
|
15374
|
+
|
|
15375
|
+
|
|
15376
|
+
|
|
15377
|
+
|
|
15378
|
+
|
|
15379
|
+
|
|
15380
|
+
|
|
15381
|
+
|
|
15382
|
+
|
|
15383
|
+
|
|
15384
|
+
* @example
|
|
15385
|
+
* // Deep clone
|
|
15386
|
+
* const ts = new TreeSet<number>([1, 2, 3]);
|
|
15387
|
+
* const copy = ts.clone();
|
|
15388
|
+
* copy.delete(1);
|
|
15389
|
+
* console.log(ts.has(1)); // true;
|
|
15390
|
+
*/
|
|
15391
|
+
// ---- ES2025 Set-like operations ----
|
|
15392
|
+
/**
|
|
15393
|
+
* Return a new TreeSet containing all elements from both sets.
|
|
15394
|
+
* @remarks When both sets share the same comparator, uses O(n+m) merge. Otherwise O(m log n).
|
|
15395
|
+
* @param other - Any iterable of keys.
|
|
15396
|
+
* @returns A new TreeSet.
|
|
15397
|
+
* @example
|
|
15398
|
+
* // Merge two sets
|
|
15399
|
+
* console.log([...a.union(b)]); // [1, 2, 3, 4, 5, 6, 7];
|
|
15400
|
+
*/
|
|
15401
|
+
union(other) {
|
|
15402
|
+
const result = this.clone();
|
|
15403
|
+
for (const key of other) result.add(key);
|
|
15404
|
+
return result;
|
|
15405
|
+
}
|
|
15406
|
+
/**
|
|
15407
|
+
* Return a new TreeSet containing only elements present in both sets.
|
|
15408
|
+
* @remarks Time O(n+m) with ordered merge when possible, otherwise O(n log m).
|
|
15409
|
+
* @param other - Any iterable of keys (converted to Set for fast lookup if not a TreeSet).
|
|
15410
|
+
* @returns A new TreeSet.
|
|
15411
|
+
* @example
|
|
15412
|
+
* // Find common elements
|
|
15413
|
+
* console.log([...a.intersection(b)]); // [3, 4, 5];
|
|
15414
|
+
*/
|
|
15415
|
+
intersection(other) {
|
|
15416
|
+
const otherSet = other instanceof _TreeSet || other instanceof Set ? other : new Set(other);
|
|
15417
|
+
const result = new _TreeSet([], { comparator: this.#isDefaultComparator ? void 0 : this.#userComparator });
|
|
15418
|
+
for (const key of this) {
|
|
15419
|
+
if (otherSet.has(key)) result.add(key);
|
|
15420
|
+
}
|
|
15421
|
+
return result;
|
|
15422
|
+
}
|
|
15423
|
+
/**
|
|
15424
|
+
* Return a new TreeSet containing elements in this set but not in the other.
|
|
15425
|
+
* @remarks Time O(n+m) with ordered merge when possible, otherwise O(n log m).
|
|
15426
|
+
* @param other - Any iterable of keys.
|
|
15427
|
+
* @returns A new TreeSet.
|
|
15428
|
+
* @example
|
|
15429
|
+
* // Find exclusive elements
|
|
15430
|
+
* console.log([...a.difference(b)]); // [1, 2];
|
|
15431
|
+
*/
|
|
15432
|
+
difference(other) {
|
|
15433
|
+
const otherSet = other instanceof _TreeSet || other instanceof Set ? other : new Set(other);
|
|
15434
|
+
const result = new _TreeSet([], { comparator: this.#isDefaultComparator ? void 0 : this.#userComparator });
|
|
15435
|
+
for (const key of this) {
|
|
15436
|
+
if (!otherSet.has(key)) result.add(key);
|
|
15437
|
+
}
|
|
15438
|
+
return result;
|
|
15439
|
+
}
|
|
15440
|
+
/**
|
|
15441
|
+
* Return a new TreeSet containing elements in either set but not both.
|
|
15442
|
+
* @remarks Time O(n+m).
|
|
15443
|
+
* @param other - Any iterable of keys.
|
|
15444
|
+
* @returns A new TreeSet.
|
|
15445
|
+
* @example
|
|
15446
|
+
* // Find symmetric difference
|
|
15447
|
+
* console.log([...a.symmetricDifference(b)]); // [1, 2, 6, 7];
|
|
15448
|
+
*/
|
|
15449
|
+
symmetricDifference(other) {
|
|
15450
|
+
const otherSet = other instanceof _TreeSet || other instanceof Set ? other : new Set(other);
|
|
15451
|
+
const result = new _TreeSet([], { comparator: this.#isDefaultComparator ? void 0 : this.#userComparator });
|
|
15452
|
+
for (const key of this) {
|
|
15453
|
+
if (!otherSet.has(key)) result.add(key);
|
|
15454
|
+
}
|
|
15455
|
+
for (const key of otherSet) {
|
|
15456
|
+
if (!this.has(key)) result.add(key);
|
|
15457
|
+
}
|
|
15458
|
+
return result;
|
|
15459
|
+
}
|
|
15460
|
+
/**
|
|
15461
|
+
* Check whether every element in this set is also in the other.
|
|
15462
|
+
* @remarks Time O(n).
|
|
15463
|
+
* @param other - Any iterable of keys (converted to Set for fast lookup if not a TreeSet).
|
|
15464
|
+
* @returns `true` if this is a subset of other.
|
|
15465
|
+
* @example
|
|
15466
|
+
* // Check subset
|
|
15467
|
+
* console.log(new TreeSet([3, 4]).isSubsetOf(a)); // true;
|
|
15468
|
+
*/
|
|
15469
|
+
isSubsetOf(other) {
|
|
15470
|
+
const otherSet = other instanceof _TreeSet || other instanceof Set ? other : new Set(other);
|
|
15471
|
+
for (const key of this) {
|
|
15472
|
+
if (!otherSet.has(key)) return false;
|
|
15473
|
+
}
|
|
15474
|
+
return true;
|
|
15475
|
+
}
|
|
15476
|
+
/**
|
|
15477
|
+
* Check whether every element in the other set is also in this set.
|
|
15478
|
+
* @remarks Time O(m).
|
|
15479
|
+
* @param other - Any iterable of keys.
|
|
15480
|
+
* @returns `true` if this is a superset of other.
|
|
15481
|
+
* @example
|
|
15482
|
+
* // Check superset
|
|
15483
|
+
* console.log(a.isSupersetOf(new TreeSet([2, 3]))); // true;
|
|
15484
|
+
*/
|
|
15485
|
+
isSupersetOf(other) {
|
|
15486
|
+
for (const key of other) {
|
|
15487
|
+
if (!this.has(key)) return false;
|
|
15488
|
+
}
|
|
15489
|
+
return true;
|
|
15490
|
+
}
|
|
15491
|
+
/**
|
|
15492
|
+
* Check whether this set and the other share no common elements.
|
|
15493
|
+
* @remarks Time O(min(n,m)), can short-circuit on first overlap.
|
|
15494
|
+
* @param other - Any iterable of keys (converted to Set for fast lookup if not a TreeSet).
|
|
15495
|
+
* @returns `true` if sets are disjoint.
|
|
15496
|
+
* @example
|
|
15497
|
+
* // Check disjoint
|
|
15498
|
+
* console.log(a.isDisjointFrom(new TreeSet([8, 9]))); // true;
|
|
15499
|
+
*/
|
|
15500
|
+
isDisjointFrom(other) {
|
|
15501
|
+
const otherSet = other instanceof _TreeSet || other instanceof Set ? other : new Set(other);
|
|
15502
|
+
for (const key of this) {
|
|
15503
|
+
if (otherSet.has(key)) return false;
|
|
15504
|
+
}
|
|
15505
|
+
return true;
|
|
15506
|
+
}
|
|
15507
|
+
/**
|
|
15508
|
+
* Deep copy
|
|
15509
|
+
|
|
14714
15510
|
|
|
14715
15511
|
|
|
14716
15512
|
|
|
@@ -14973,6 +15769,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
14973
15769
|
|
|
14974
15770
|
|
|
14975
15771
|
|
|
15772
|
+
|
|
15773
|
+
|
|
15774
|
+
|
|
15775
|
+
|
|
15776
|
+
|
|
15777
|
+
|
|
15778
|
+
|
|
15779
|
+
|
|
15780
|
+
|
|
15781
|
+
|
|
15782
|
+
|
|
15783
|
+
|
|
15784
|
+
|
|
15785
|
+
|
|
15786
|
+
|
|
14976
15787
|
|
|
14977
15788
|
|
|
14978
15789
|
|
|
@@ -15161,6 +15972,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15161
15972
|
|
|
15162
15973
|
|
|
15163
15974
|
|
|
15975
|
+
|
|
15976
|
+
|
|
15977
|
+
|
|
15978
|
+
|
|
15979
|
+
|
|
15980
|
+
|
|
15981
|
+
|
|
15982
|
+
|
|
15983
|
+
|
|
15984
|
+
|
|
15985
|
+
|
|
15986
|
+
|
|
15987
|
+
|
|
15988
|
+
|
|
15989
|
+
|
|
15164
15990
|
|
|
15165
15991
|
|
|
15166
15992
|
|
|
@@ -15216,6 +16042,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15216
16042
|
|
|
15217
16043
|
|
|
15218
16044
|
|
|
16045
|
+
|
|
16046
|
+
|
|
16047
|
+
|
|
15219
16048
|
|
|
15220
16049
|
|
|
15221
16050
|
|
|
@@ -15260,6 +16089,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15260
16089
|
|
|
15261
16090
|
|
|
15262
16091
|
|
|
16092
|
+
|
|
16093
|
+
|
|
16094
|
+
|
|
15263
16095
|
|
|
15264
16096
|
|
|
15265
16097
|
|
|
@@ -15481,6 +16313,24 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15481
16313
|
|
|
15482
16314
|
|
|
15483
16315
|
|
|
16316
|
+
|
|
16317
|
+
|
|
16318
|
+
|
|
16319
|
+
|
|
16320
|
+
|
|
16321
|
+
|
|
16322
|
+
|
|
16323
|
+
|
|
16324
|
+
|
|
16325
|
+
|
|
16326
|
+
|
|
16327
|
+
|
|
16328
|
+
|
|
16329
|
+
|
|
16330
|
+
|
|
16331
|
+
|
|
16332
|
+
|
|
16333
|
+
|
|
15484
16334
|
|
|
15485
16335
|
|
|
15486
16336
|
|
|
@@ -15715,6 +16565,24 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15715
16565
|
|
|
15716
16566
|
|
|
15717
16567
|
|
|
16568
|
+
|
|
16569
|
+
|
|
16570
|
+
|
|
16571
|
+
|
|
16572
|
+
|
|
16573
|
+
|
|
16574
|
+
|
|
16575
|
+
|
|
16576
|
+
|
|
16577
|
+
|
|
16578
|
+
|
|
16579
|
+
|
|
16580
|
+
|
|
16581
|
+
|
|
16582
|
+
|
|
16583
|
+
|
|
16584
|
+
|
|
16585
|
+
|
|
15718
16586
|
|
|
15719
16587
|
|
|
15720
16588
|
|
|
@@ -15904,6 +16772,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
15904
16772
|
|
|
15905
16773
|
|
|
15906
16774
|
|
|
16775
|
+
|
|
16776
|
+
|
|
16777
|
+
|
|
16778
|
+
|
|
16779
|
+
|
|
16780
|
+
|
|
16781
|
+
|
|
16782
|
+
|
|
16783
|
+
|
|
16784
|
+
|
|
16785
|
+
|
|
16786
|
+
|
|
16787
|
+
|
|
16788
|
+
|
|
16789
|
+
|
|
15907
16790
|
|
|
15908
16791
|
|
|
15909
16792
|
|
|
@@ -16160,6 +17043,24 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16160
17043
|
|
|
16161
17044
|
|
|
16162
17045
|
|
|
17046
|
+
|
|
17047
|
+
|
|
17048
|
+
|
|
17049
|
+
|
|
17050
|
+
|
|
17051
|
+
|
|
17052
|
+
|
|
17053
|
+
|
|
17054
|
+
|
|
17055
|
+
|
|
17056
|
+
|
|
17057
|
+
|
|
17058
|
+
|
|
17059
|
+
|
|
17060
|
+
|
|
17061
|
+
|
|
17062
|
+
|
|
17063
|
+
|
|
16163
17064
|
|
|
16164
17065
|
|
|
16165
17066
|
|
|
@@ -16220,6 +17121,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16220
17121
|
|
|
16221
17122
|
|
|
16222
17123
|
|
|
17124
|
+
|
|
17125
|
+
|
|
17126
|
+
|
|
16223
17127
|
|
|
16224
17128
|
|
|
16225
17129
|
|
|
@@ -16265,6 +17169,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16265
17169
|
|
|
16266
17170
|
|
|
16267
17171
|
|
|
17172
|
+
|
|
17173
|
+
|
|
17174
|
+
|
|
16268
17175
|
|
|
16269
17176
|
|
|
16270
17177
|
|
|
@@ -16315,6 +17222,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16315
17222
|
|
|
16316
17223
|
|
|
16317
17224
|
|
|
17225
|
+
|
|
17226
|
+
|
|
17227
|
+
|
|
16318
17228
|
|
|
16319
17229
|
|
|
16320
17230
|
|
|
@@ -16517,6 +17427,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16517
17427
|
|
|
16518
17428
|
|
|
16519
17429
|
|
|
17430
|
+
|
|
17431
|
+
|
|
17432
|
+
|
|
17433
|
+
|
|
17434
|
+
|
|
17435
|
+
|
|
17436
|
+
|
|
17437
|
+
|
|
17438
|
+
|
|
17439
|
+
|
|
17440
|
+
|
|
17441
|
+
|
|
17442
|
+
|
|
17443
|
+
|
|
17444
|
+
|
|
16520
17445
|
|
|
16521
17446
|
|
|
16522
17447
|
|
|
@@ -16708,6 +17633,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16708
17633
|
|
|
16709
17634
|
|
|
16710
17635
|
|
|
17636
|
+
|
|
17637
|
+
|
|
17638
|
+
|
|
17639
|
+
|
|
17640
|
+
|
|
17641
|
+
|
|
17642
|
+
|
|
17643
|
+
|
|
17644
|
+
|
|
17645
|
+
|
|
17646
|
+
|
|
17647
|
+
|
|
17648
|
+
|
|
17649
|
+
|
|
17650
|
+
|
|
16711
17651
|
|
|
16712
17652
|
|
|
16713
17653
|
|
|
@@ -16734,6 +17674,31 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16734
17674
|
*values() {
|
|
16735
17675
|
for (const [, bucket] of this) yield bucket;
|
|
16736
17676
|
}
|
|
17677
|
+
/**
|
|
17678
|
+
* Iterate over all `[key, values[]]` entries (Map-compatible).
|
|
17679
|
+
* @remarks Time O(n), Space O(1) per step.
|
|
17680
|
+
|
|
17681
|
+
|
|
17682
|
+
|
|
17683
|
+
|
|
17684
|
+
|
|
17685
|
+
|
|
17686
|
+
|
|
17687
|
+
|
|
17688
|
+
* @example
|
|
17689
|
+
* // Iterate over entries
|
|
17690
|
+
* const mm = new TreeMultiMap<number, string>();
|
|
17691
|
+
* mm.set(1, 'a');
|
|
17692
|
+
* mm.set(1, 'b');
|
|
17693
|
+
* mm.set(2, 'c');
|
|
17694
|
+
* console.log([...mm.entries()]); // [
|
|
17695
|
+
* // [1, ['a', 'b']],
|
|
17696
|
+
* // [2, ['c']]
|
|
17697
|
+
* // ];
|
|
17698
|
+
*/
|
|
17699
|
+
*entries() {
|
|
17700
|
+
yield* this;
|
|
17701
|
+
}
|
|
16737
17702
|
// ---- entry-flat views ----
|
|
16738
17703
|
/**
|
|
16739
17704
|
* Iterates over all entries for a specific key.
|
|
@@ -16764,6 +17729,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16764
17729
|
|
|
16765
17730
|
|
|
16766
17731
|
|
|
17732
|
+
|
|
17733
|
+
|
|
17734
|
+
|
|
16767
17735
|
|
|
16768
17736
|
|
|
16769
17737
|
|
|
@@ -16809,6 +17777,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16809
17777
|
|
|
16810
17778
|
|
|
16811
17779
|
|
|
17780
|
+
|
|
17781
|
+
|
|
17782
|
+
|
|
16812
17783
|
|
|
16813
17784
|
|
|
16814
17785
|
|
|
@@ -16854,6 +17825,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16854
17825
|
|
|
16855
17826
|
|
|
16856
17827
|
|
|
17828
|
+
|
|
17829
|
+
|
|
17830
|
+
|
|
16857
17831
|
|
|
16858
17832
|
|
|
16859
17833
|
|
|
@@ -16938,6 +17912,12 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
16938
17912
|
|
|
16939
17913
|
|
|
16940
17914
|
|
|
17915
|
+
|
|
17916
|
+
|
|
17917
|
+
|
|
17918
|
+
|
|
17919
|
+
|
|
17920
|
+
|
|
16941
17921
|
|
|
16942
17922
|
|
|
16943
17923
|
|
|
@@ -17027,6 +18007,12 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17027
18007
|
|
|
17028
18008
|
|
|
17029
18009
|
|
|
18010
|
+
|
|
18011
|
+
|
|
18012
|
+
|
|
18013
|
+
|
|
18014
|
+
|
|
18015
|
+
|
|
17030
18016
|
|
|
17031
18017
|
|
|
17032
18018
|
|
|
@@ -17080,6 +18066,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17080
18066
|
|
|
17081
18067
|
|
|
17082
18068
|
|
|
18069
|
+
|
|
18070
|
+
|
|
18071
|
+
|
|
17083
18072
|
|
|
17084
18073
|
|
|
17085
18074
|
|
|
@@ -17129,6 +18118,9 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17129
18118
|
|
|
17130
18119
|
|
|
17131
18120
|
|
|
18121
|
+
|
|
18122
|
+
|
|
18123
|
+
|
|
17132
18124
|
|
|
17133
18125
|
|
|
17134
18126
|
|
|
@@ -17315,6 +18307,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17315
18307
|
|
|
17316
18308
|
|
|
17317
18309
|
|
|
18310
|
+
|
|
18311
|
+
|
|
18312
|
+
|
|
18313
|
+
|
|
18314
|
+
|
|
18315
|
+
|
|
18316
|
+
|
|
18317
|
+
|
|
18318
|
+
|
|
18319
|
+
|
|
18320
|
+
|
|
18321
|
+
|
|
18322
|
+
|
|
18323
|
+
|
|
18324
|
+
|
|
17318
18325
|
|
|
17319
18326
|
|
|
17320
18327
|
|
|
@@ -17517,6 +18524,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17517
18524
|
|
|
17518
18525
|
|
|
17519
18526
|
|
|
18527
|
+
|
|
18528
|
+
|
|
18529
|
+
|
|
18530
|
+
|
|
18531
|
+
|
|
18532
|
+
|
|
18533
|
+
|
|
18534
|
+
|
|
18535
|
+
|
|
18536
|
+
|
|
18537
|
+
|
|
18538
|
+
|
|
18539
|
+
|
|
18540
|
+
|
|
18541
|
+
|
|
17520
18542
|
|
|
17521
18543
|
|
|
17522
18544
|
|
|
@@ -17683,6 +18705,18 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17683
18705
|
|
|
17684
18706
|
|
|
17685
18707
|
|
|
18708
|
+
|
|
18709
|
+
|
|
18710
|
+
|
|
18711
|
+
|
|
18712
|
+
|
|
18713
|
+
|
|
18714
|
+
|
|
18715
|
+
|
|
18716
|
+
|
|
18717
|
+
|
|
18718
|
+
|
|
18719
|
+
|
|
17686
18720
|
|
|
17687
18721
|
|
|
17688
18722
|
|
|
@@ -17845,6 +18879,18 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
17845
18879
|
|
|
17846
18880
|
|
|
17847
18881
|
|
|
18882
|
+
|
|
18883
|
+
|
|
18884
|
+
|
|
18885
|
+
|
|
18886
|
+
|
|
18887
|
+
|
|
18888
|
+
|
|
18889
|
+
|
|
18890
|
+
|
|
18891
|
+
|
|
18892
|
+
|
|
18893
|
+
|
|
17848
18894
|
|
|
17849
18895
|
|
|
17850
18896
|
|
|
@@ -18041,6 +19087,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
18041
19087
|
|
|
18042
19088
|
|
|
18043
19089
|
|
|
19090
|
+
|
|
19091
|
+
|
|
19092
|
+
|
|
19093
|
+
|
|
19094
|
+
|
|
19095
|
+
|
|
19096
|
+
|
|
19097
|
+
|
|
19098
|
+
|
|
19099
|
+
|
|
19100
|
+
|
|
19101
|
+
|
|
19102
|
+
|
|
19103
|
+
|
|
19104
|
+
|
|
18044
19105
|
|
|
18045
19106
|
|
|
18046
19107
|
|
|
@@ -18231,6 +19292,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
18231
19292
|
|
|
18232
19293
|
|
|
18233
19294
|
|
|
19295
|
+
|
|
19296
|
+
|
|
19297
|
+
|
|
19298
|
+
|
|
19299
|
+
|
|
19300
|
+
|
|
19301
|
+
|
|
19302
|
+
|
|
19303
|
+
|
|
19304
|
+
|
|
19305
|
+
|
|
19306
|
+
|
|
19307
|
+
|
|
19308
|
+
|
|
19309
|
+
|
|
18234
19310
|
|
|
18235
19311
|
|
|
18236
19312
|
|
|
@@ -18426,6 +19502,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
18426
19502
|
|
|
18427
19503
|
|
|
18428
19504
|
|
|
19505
|
+
|
|
19506
|
+
|
|
19507
|
+
|
|
19508
|
+
|
|
19509
|
+
|
|
19510
|
+
|
|
19511
|
+
|
|
19512
|
+
|
|
19513
|
+
|
|
19514
|
+
|
|
19515
|
+
|
|
19516
|
+
|
|
19517
|
+
|
|
19518
|
+
|
|
19519
|
+
|
|
18429
19520
|
|
|
18430
19521
|
|
|
18431
19522
|
|
|
@@ -18623,6 +19714,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
18623
19714
|
|
|
18624
19715
|
|
|
18625
19716
|
|
|
19717
|
+
|
|
19718
|
+
|
|
19719
|
+
|
|
19720
|
+
|
|
19721
|
+
|
|
19722
|
+
|
|
19723
|
+
|
|
19724
|
+
|
|
19725
|
+
|
|
19726
|
+
|
|
19727
|
+
|
|
19728
|
+
|
|
19729
|
+
|
|
19730
|
+
|
|
19731
|
+
|
|
18626
19732
|
|
|
18627
19733
|
|
|
18628
19734
|
|
|
@@ -18818,6 +19924,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
18818
19924
|
|
|
18819
19925
|
|
|
18820
19926
|
|
|
19927
|
+
|
|
19928
|
+
|
|
19929
|
+
|
|
19930
|
+
|
|
19931
|
+
|
|
19932
|
+
|
|
19933
|
+
|
|
19934
|
+
|
|
19935
|
+
|
|
19936
|
+
|
|
19937
|
+
|
|
19938
|
+
|
|
19939
|
+
|
|
19940
|
+
|
|
19941
|
+
|
|
18821
19942
|
|
|
18822
19943
|
|
|
18823
19944
|
|
|
@@ -19006,6 +20127,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
19006
20127
|
|
|
19007
20128
|
|
|
19008
20129
|
|
|
20130
|
+
|
|
20131
|
+
|
|
20132
|
+
|
|
20133
|
+
|
|
20134
|
+
|
|
20135
|
+
|
|
20136
|
+
|
|
20137
|
+
|
|
20138
|
+
|
|
20139
|
+
|
|
20140
|
+
|
|
20141
|
+
|
|
20142
|
+
|
|
20143
|
+
|
|
20144
|
+
|
|
19009
20145
|
|
|
19010
20146
|
|
|
19011
20147
|
|
|
@@ -19167,6 +20303,18 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
19167
20303
|
|
|
19168
20304
|
|
|
19169
20305
|
|
|
20306
|
+
|
|
20307
|
+
|
|
20308
|
+
|
|
20309
|
+
|
|
20310
|
+
|
|
20311
|
+
|
|
20312
|
+
|
|
20313
|
+
|
|
20314
|
+
|
|
20315
|
+
|
|
20316
|
+
|
|
20317
|
+
|
|
19170
20318
|
|
|
19171
20319
|
|
|
19172
20320
|
|
|
@@ -19391,6 +20539,12 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
19391
20539
|
|
|
19392
20540
|
|
|
19393
20541
|
|
|
20542
|
+
|
|
20543
|
+
|
|
20544
|
+
|
|
20545
|
+
|
|
20546
|
+
|
|
20547
|
+
|
|
19394
20548
|
* @example
|
|
19395
20549
|
* // Pagination by position in tree order
|
|
19396
20550
|
* const tree = new TreeMultiMap<number>(
|
|
@@ -19430,6 +20584,21 @@ var TreeMultiMap = class _TreeMultiMap {
|
|
|
19430
20584
|
|
|
19431
20585
|
|
|
19432
20586
|
|
|
20587
|
+
|
|
20588
|
+
|
|
20589
|
+
|
|
20590
|
+
|
|
20591
|
+
|
|
20592
|
+
|
|
20593
|
+
|
|
20594
|
+
|
|
20595
|
+
|
|
20596
|
+
|
|
20597
|
+
|
|
20598
|
+
|
|
20599
|
+
|
|
20600
|
+
|
|
20601
|
+
|
|
19433
20602
|
|
|
19434
20603
|
|
|
19435
20604
|
|
|
@@ -19713,6 +20882,21 @@ var TreeMap = class _TreeMap {
|
|
|
19713
20882
|
|
|
19714
20883
|
|
|
19715
20884
|
|
|
20885
|
+
|
|
20886
|
+
|
|
20887
|
+
|
|
20888
|
+
|
|
20889
|
+
|
|
20890
|
+
|
|
20891
|
+
|
|
20892
|
+
|
|
20893
|
+
|
|
20894
|
+
|
|
20895
|
+
|
|
20896
|
+
|
|
20897
|
+
|
|
20898
|
+
|
|
20899
|
+
|
|
19716
20900
|
|
|
19717
20901
|
|
|
19718
20902
|
|
|
@@ -19910,6 +21094,21 @@ var TreeMap = class _TreeMap {
|
|
|
19910
21094
|
|
|
19911
21095
|
|
|
19912
21096
|
|
|
21097
|
+
|
|
21098
|
+
|
|
21099
|
+
|
|
21100
|
+
|
|
21101
|
+
|
|
21102
|
+
|
|
21103
|
+
|
|
21104
|
+
|
|
21105
|
+
|
|
21106
|
+
|
|
21107
|
+
|
|
21108
|
+
|
|
21109
|
+
|
|
21110
|
+
|
|
21111
|
+
|
|
19913
21112
|
|
|
19914
21113
|
|
|
19915
21114
|
|
|
@@ -19964,6 +21163,18 @@ var TreeMap = class _TreeMap {
|
|
|
19964
21163
|
|
|
19965
21164
|
|
|
19966
21165
|
|
|
21166
|
+
|
|
21167
|
+
|
|
21168
|
+
|
|
21169
|
+
|
|
21170
|
+
|
|
21171
|
+
|
|
21172
|
+
|
|
21173
|
+
|
|
21174
|
+
|
|
21175
|
+
|
|
21176
|
+
|
|
21177
|
+
|
|
19967
21178
|
|
|
19968
21179
|
|
|
19969
21180
|
|
|
@@ -20163,6 +21374,21 @@ var TreeMap = class _TreeMap {
|
|
|
20163
21374
|
|
|
20164
21375
|
|
|
20165
21376
|
|
|
21377
|
+
|
|
21378
|
+
|
|
21379
|
+
|
|
21380
|
+
|
|
21381
|
+
|
|
21382
|
+
|
|
21383
|
+
|
|
21384
|
+
|
|
21385
|
+
|
|
21386
|
+
|
|
21387
|
+
|
|
21388
|
+
|
|
21389
|
+
|
|
21390
|
+
|
|
21391
|
+
|
|
20166
21392
|
|
|
20167
21393
|
|
|
20168
21394
|
|
|
@@ -20371,6 +21597,21 @@ var TreeMap = class _TreeMap {
|
|
|
20371
21597
|
|
|
20372
21598
|
|
|
20373
21599
|
|
|
21600
|
+
|
|
21601
|
+
|
|
21602
|
+
|
|
21603
|
+
|
|
21604
|
+
|
|
21605
|
+
|
|
21606
|
+
|
|
21607
|
+
|
|
21608
|
+
|
|
21609
|
+
|
|
21610
|
+
|
|
21611
|
+
|
|
21612
|
+
|
|
21613
|
+
|
|
21614
|
+
|
|
20374
21615
|
|
|
20375
21616
|
|
|
20376
21617
|
|
|
@@ -20579,6 +21820,21 @@ var TreeMap = class _TreeMap {
|
|
|
20579
21820
|
|
|
20580
21821
|
|
|
20581
21822
|
|
|
21823
|
+
|
|
21824
|
+
|
|
21825
|
+
|
|
21826
|
+
|
|
21827
|
+
|
|
21828
|
+
|
|
21829
|
+
|
|
21830
|
+
|
|
21831
|
+
|
|
21832
|
+
|
|
21833
|
+
|
|
21834
|
+
|
|
21835
|
+
|
|
21836
|
+
|
|
21837
|
+
|
|
20582
21838
|
|
|
20583
21839
|
|
|
20584
21840
|
|
|
@@ -20793,6 +22049,21 @@ var TreeMap = class _TreeMap {
|
|
|
20793
22049
|
|
|
20794
22050
|
|
|
20795
22051
|
|
|
22052
|
+
|
|
22053
|
+
|
|
22054
|
+
|
|
22055
|
+
|
|
22056
|
+
|
|
22057
|
+
|
|
22058
|
+
|
|
22059
|
+
|
|
22060
|
+
|
|
22061
|
+
|
|
22062
|
+
|
|
22063
|
+
|
|
22064
|
+
|
|
22065
|
+
|
|
22066
|
+
|
|
20796
22067
|
|
|
20797
22068
|
|
|
20798
22069
|
|
|
@@ -20982,6 +22253,21 @@ var TreeMap = class _TreeMap {
|
|
|
20982
22253
|
|
|
20983
22254
|
|
|
20984
22255
|
|
|
22256
|
+
|
|
22257
|
+
|
|
22258
|
+
|
|
22259
|
+
|
|
22260
|
+
|
|
22261
|
+
|
|
22262
|
+
|
|
22263
|
+
|
|
22264
|
+
|
|
22265
|
+
|
|
22266
|
+
|
|
22267
|
+
|
|
22268
|
+
|
|
22269
|
+
|
|
22270
|
+
|
|
20985
22271
|
|
|
20986
22272
|
|
|
20987
22273
|
|
|
@@ -21175,6 +22461,21 @@ var TreeMap = class _TreeMap {
|
|
|
21175
22461
|
|
|
21176
22462
|
|
|
21177
22463
|
|
|
22464
|
+
|
|
22465
|
+
|
|
22466
|
+
|
|
22467
|
+
|
|
22468
|
+
|
|
22469
|
+
|
|
22470
|
+
|
|
22471
|
+
|
|
22472
|
+
|
|
22473
|
+
|
|
22474
|
+
|
|
22475
|
+
|
|
22476
|
+
|
|
22477
|
+
|
|
22478
|
+
|
|
21178
22479
|
|
|
21179
22480
|
|
|
21180
22481
|
|
|
@@ -21365,6 +22666,21 @@ var TreeMap = class _TreeMap {
|
|
|
21365
22666
|
|
|
21366
22667
|
|
|
21367
22668
|
|
|
22669
|
+
|
|
22670
|
+
|
|
22671
|
+
|
|
22672
|
+
|
|
22673
|
+
|
|
22674
|
+
|
|
22675
|
+
|
|
22676
|
+
|
|
22677
|
+
|
|
22678
|
+
|
|
22679
|
+
|
|
22680
|
+
|
|
22681
|
+
|
|
22682
|
+
|
|
22683
|
+
|
|
21368
22684
|
|
|
21369
22685
|
|
|
21370
22686
|
|
|
@@ -21558,6 +22874,21 @@ var TreeMap = class _TreeMap {
|
|
|
21558
22874
|
|
|
21559
22875
|
|
|
21560
22876
|
|
|
22877
|
+
|
|
22878
|
+
|
|
22879
|
+
|
|
22880
|
+
|
|
22881
|
+
|
|
22882
|
+
|
|
22883
|
+
|
|
22884
|
+
|
|
22885
|
+
|
|
22886
|
+
|
|
22887
|
+
|
|
22888
|
+
|
|
22889
|
+
|
|
22890
|
+
|
|
22891
|
+
|
|
21561
22892
|
|
|
21562
22893
|
|
|
21563
22894
|
|
|
@@ -21751,6 +23082,21 @@ var TreeMap = class _TreeMap {
|
|
|
21751
23082
|
|
|
21752
23083
|
|
|
21753
23084
|
|
|
23085
|
+
|
|
23086
|
+
|
|
23087
|
+
|
|
23088
|
+
|
|
23089
|
+
|
|
23090
|
+
|
|
23091
|
+
|
|
23092
|
+
|
|
23093
|
+
|
|
23094
|
+
|
|
23095
|
+
|
|
23096
|
+
|
|
23097
|
+
|
|
23098
|
+
|
|
23099
|
+
|
|
21754
23100
|
|
|
21755
23101
|
|
|
21756
23102
|
|
|
@@ -21947,6 +23293,21 @@ var TreeMap = class _TreeMap {
|
|
|
21947
23293
|
|
|
21948
23294
|
|
|
21949
23295
|
|
|
23296
|
+
|
|
23297
|
+
|
|
23298
|
+
|
|
23299
|
+
|
|
23300
|
+
|
|
23301
|
+
|
|
23302
|
+
|
|
23303
|
+
|
|
23304
|
+
|
|
23305
|
+
|
|
23306
|
+
|
|
23307
|
+
|
|
23308
|
+
|
|
23309
|
+
|
|
23310
|
+
|
|
21950
23311
|
|
|
21951
23312
|
|
|
21952
23313
|
|
|
@@ -22143,6 +23504,21 @@ var TreeMap = class _TreeMap {
|
|
|
22143
23504
|
|
|
22144
23505
|
|
|
22145
23506
|
|
|
23507
|
+
|
|
23508
|
+
|
|
23509
|
+
|
|
23510
|
+
|
|
23511
|
+
|
|
23512
|
+
|
|
23513
|
+
|
|
23514
|
+
|
|
23515
|
+
|
|
23516
|
+
|
|
23517
|
+
|
|
23518
|
+
|
|
23519
|
+
|
|
23520
|
+
|
|
23521
|
+
|
|
22146
23522
|
|
|
22147
23523
|
|
|
22148
23524
|
|
|
@@ -22333,6 +23709,21 @@ var TreeMap = class _TreeMap {
|
|
|
22333
23709
|
|
|
22334
23710
|
|
|
22335
23711
|
|
|
23712
|
+
|
|
23713
|
+
|
|
23714
|
+
|
|
23715
|
+
|
|
23716
|
+
|
|
23717
|
+
|
|
23718
|
+
|
|
23719
|
+
|
|
23720
|
+
|
|
23721
|
+
|
|
23722
|
+
|
|
23723
|
+
|
|
23724
|
+
|
|
23725
|
+
|
|
23726
|
+
|
|
22336
23727
|
|
|
22337
23728
|
|
|
22338
23729
|
|
|
@@ -22525,6 +23916,21 @@ var TreeMap = class _TreeMap {
|
|
|
22525
23916
|
|
|
22526
23917
|
|
|
22527
23918
|
|
|
23919
|
+
|
|
23920
|
+
|
|
23921
|
+
|
|
23922
|
+
|
|
23923
|
+
|
|
23924
|
+
|
|
23925
|
+
|
|
23926
|
+
|
|
23927
|
+
|
|
23928
|
+
|
|
23929
|
+
|
|
23930
|
+
|
|
23931
|
+
|
|
23932
|
+
|
|
23933
|
+
|
|
22528
23934
|
|
|
22529
23935
|
|
|
22530
23936
|
|
|
@@ -22718,6 +24124,21 @@ var TreeMap = class _TreeMap {
|
|
|
22718
24124
|
|
|
22719
24125
|
|
|
22720
24126
|
|
|
24127
|
+
|
|
24128
|
+
|
|
24129
|
+
|
|
24130
|
+
|
|
24131
|
+
|
|
24132
|
+
|
|
24133
|
+
|
|
24134
|
+
|
|
24135
|
+
|
|
24136
|
+
|
|
24137
|
+
|
|
24138
|
+
|
|
24139
|
+
|
|
24140
|
+
|
|
24141
|
+
|
|
22721
24142
|
|
|
22722
24143
|
|
|
22723
24144
|
|
|
@@ -22912,6 +24333,21 @@ var TreeMap = class _TreeMap {
|
|
|
22912
24333
|
|
|
22913
24334
|
|
|
22914
24335
|
|
|
24336
|
+
|
|
24337
|
+
|
|
24338
|
+
|
|
24339
|
+
|
|
24340
|
+
|
|
24341
|
+
|
|
24342
|
+
|
|
24343
|
+
|
|
24344
|
+
|
|
24345
|
+
|
|
24346
|
+
|
|
24347
|
+
|
|
24348
|
+
|
|
24349
|
+
|
|
24350
|
+
|
|
22915
24351
|
|
|
22916
24352
|
|
|
22917
24353
|
|
|
@@ -23101,6 +24537,21 @@ var TreeMap = class _TreeMap {
|
|
|
23101
24537
|
|
|
23102
24538
|
|
|
23103
24539
|
|
|
24540
|
+
|
|
24541
|
+
|
|
24542
|
+
|
|
24543
|
+
|
|
24544
|
+
|
|
24545
|
+
|
|
24546
|
+
|
|
24547
|
+
|
|
24548
|
+
|
|
24549
|
+
|
|
24550
|
+
|
|
24551
|
+
|
|
24552
|
+
|
|
24553
|
+
|
|
24554
|
+
|
|
23104
24555
|
|
|
23105
24556
|
|
|
23106
24557
|
|
|
@@ -23164,6 +24615,9 @@ var TreeMap = class _TreeMap {
|
|
|
23164
24615
|
|
|
23165
24616
|
|
|
23166
24617
|
|
|
24618
|
+
|
|
24619
|
+
|
|
24620
|
+
|
|
23167
24621
|
|
|
23168
24622
|
|
|
23169
24623
|
|
|
@@ -23236,6 +24690,9 @@ var TreeMap = class _TreeMap {
|
|
|
23236
24690
|
|
|
23237
24691
|
|
|
23238
24692
|
|
|
24693
|
+
|
|
24694
|
+
|
|
24695
|
+
|
|
23239
24696
|
|
|
23240
24697
|
|
|
23241
24698
|
|
|
@@ -23292,6 +24749,9 @@ var TreeMap = class _TreeMap {
|
|
|
23292
24749
|
|
|
23293
24750
|
|
|
23294
24751
|
|
|
24752
|
+
|
|
24753
|
+
|
|
24754
|
+
|
|
23295
24755
|
|
|
23296
24756
|
|
|
23297
24757
|
|
|
@@ -23352,6 +24812,9 @@ var TreeMap = class _TreeMap {
|
|
|
23352
24812
|
|
|
23353
24813
|
|
|
23354
24814
|
|
|
24815
|
+
|
|
24816
|
+
|
|
24817
|
+
|
|
23355
24818
|
|
|
23356
24819
|
|
|
23357
24820
|
|
|
@@ -23514,6 +24977,18 @@ var TreeMap = class _TreeMap {
|
|
|
23514
24977
|
|
|
23515
24978
|
|
|
23516
24979
|
|
|
24980
|
+
|
|
24981
|
+
|
|
24982
|
+
|
|
24983
|
+
|
|
24984
|
+
|
|
24985
|
+
|
|
24986
|
+
|
|
24987
|
+
|
|
24988
|
+
|
|
24989
|
+
|
|
24990
|
+
|
|
24991
|
+
|
|
23517
24992
|
|
|
23518
24993
|
|
|
23519
24994
|
|
|
@@ -23703,6 +25178,18 @@ var TreeMap = class _TreeMap {
|
|
|
23703
25178
|
|
|
23704
25179
|
|
|
23705
25180
|
|
|
25181
|
+
|
|
25182
|
+
|
|
25183
|
+
|
|
25184
|
+
|
|
25185
|
+
|
|
25186
|
+
|
|
25187
|
+
|
|
25188
|
+
|
|
25189
|
+
|
|
25190
|
+
|
|
25191
|
+
|
|
25192
|
+
|
|
23706
25193
|
|
|
23707
25194
|
|
|
23708
25195
|
|
|
@@ -23876,6 +25363,18 @@ var TreeMap = class _TreeMap {
|
|
|
23876
25363
|
|
|
23877
25364
|
|
|
23878
25365
|
|
|
25366
|
+
|
|
25367
|
+
|
|
25368
|
+
|
|
25369
|
+
|
|
25370
|
+
|
|
25371
|
+
|
|
25372
|
+
|
|
25373
|
+
|
|
25374
|
+
|
|
25375
|
+
|
|
25376
|
+
|
|
25377
|
+
|
|
23879
25378
|
|
|
23880
25379
|
|
|
23881
25380
|
|
|
@@ -24049,6 +25548,18 @@ var TreeMap = class _TreeMap {
|
|
|
24049
25548
|
|
|
24050
25549
|
|
|
24051
25550
|
|
|
25551
|
+
|
|
25552
|
+
|
|
25553
|
+
|
|
25554
|
+
|
|
25555
|
+
|
|
25556
|
+
|
|
25557
|
+
|
|
25558
|
+
|
|
25559
|
+
|
|
25560
|
+
|
|
25561
|
+
|
|
25562
|
+
|
|
24052
25563
|
|
|
24053
25564
|
|
|
24054
25565
|
|
|
@@ -24223,6 +25734,18 @@ var TreeMap = class _TreeMap {
|
|
|
24223
25734
|
|
|
24224
25735
|
|
|
24225
25736
|
|
|
25737
|
+
|
|
25738
|
+
|
|
25739
|
+
|
|
25740
|
+
|
|
25741
|
+
|
|
25742
|
+
|
|
25743
|
+
|
|
25744
|
+
|
|
25745
|
+
|
|
25746
|
+
|
|
25747
|
+
|
|
25748
|
+
|
|
24226
25749
|
|
|
24227
25750
|
|
|
24228
25751
|
|
|
@@ -24334,6 +25857,12 @@ var TreeMap = class _TreeMap {
|
|
|
24334
25857
|
|
|
24335
25858
|
|
|
24336
25859
|
|
|
25860
|
+
|
|
25861
|
+
|
|
25862
|
+
|
|
25863
|
+
|
|
25864
|
+
|
|
25865
|
+
|
|
24337
25866
|
* @example
|
|
24338
25867
|
* // Pagination by position in tree order
|
|
24339
25868
|
* const tree = new TreeMap<number>(
|
|
@@ -24519,6 +26048,21 @@ var TreeMap = class _TreeMap {
|
|
|
24519
26048
|
|
|
24520
26049
|
|
|
24521
26050
|
|
|
26051
|
+
|
|
26052
|
+
|
|
26053
|
+
|
|
26054
|
+
|
|
26055
|
+
|
|
26056
|
+
|
|
26057
|
+
|
|
26058
|
+
|
|
26059
|
+
|
|
26060
|
+
|
|
26061
|
+
|
|
26062
|
+
|
|
26063
|
+
|
|
26064
|
+
|
|
26065
|
+
|
|
24522
26066
|
|
|
24523
26067
|
|
|
24524
26068
|
|
|
@@ -24642,6 +26186,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
24642
26186
|
|
|
24643
26187
|
|
|
24644
26188
|
|
|
26189
|
+
|
|
26190
|
+
|
|
26191
|
+
|
|
24645
26192
|
|
|
24646
26193
|
|
|
24647
26194
|
|
|
@@ -24821,6 +26368,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
24821
26368
|
|
|
24822
26369
|
|
|
24823
26370
|
|
|
26371
|
+
|
|
26372
|
+
|
|
26373
|
+
|
|
26374
|
+
|
|
26375
|
+
|
|
26376
|
+
|
|
26377
|
+
|
|
26378
|
+
|
|
26379
|
+
|
|
26380
|
+
|
|
26381
|
+
|
|
26382
|
+
|
|
26383
|
+
|
|
26384
|
+
|
|
26385
|
+
|
|
24824
26386
|
|
|
24825
26387
|
|
|
24826
26388
|
|
|
@@ -25012,6 +26574,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25012
26574
|
|
|
25013
26575
|
|
|
25014
26576
|
|
|
26577
|
+
|
|
26578
|
+
|
|
26579
|
+
|
|
26580
|
+
|
|
26581
|
+
|
|
26582
|
+
|
|
26583
|
+
|
|
26584
|
+
|
|
26585
|
+
|
|
26586
|
+
|
|
26587
|
+
|
|
26588
|
+
|
|
26589
|
+
|
|
26590
|
+
|
|
26591
|
+
|
|
25015
26592
|
|
|
25016
26593
|
|
|
25017
26594
|
|
|
@@ -25068,6 +26645,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25068
26645
|
|
|
25069
26646
|
|
|
25070
26647
|
|
|
26648
|
+
|
|
26649
|
+
|
|
26650
|
+
|
|
25071
26651
|
|
|
25072
26652
|
|
|
25073
26653
|
|
|
@@ -25242,6 +26822,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25242
26822
|
|
|
25243
26823
|
|
|
25244
26824
|
|
|
26825
|
+
|
|
26826
|
+
|
|
26827
|
+
|
|
26828
|
+
|
|
26829
|
+
|
|
26830
|
+
|
|
26831
|
+
|
|
26832
|
+
|
|
26833
|
+
|
|
26834
|
+
|
|
26835
|
+
|
|
26836
|
+
|
|
26837
|
+
|
|
26838
|
+
|
|
26839
|
+
|
|
25245
26840
|
|
|
25246
26841
|
|
|
25247
26842
|
|
|
@@ -25307,6 +26902,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25307
26902
|
|
|
25308
26903
|
|
|
25309
26904
|
|
|
26905
|
+
|
|
26906
|
+
|
|
26907
|
+
|
|
25310
26908
|
|
|
25311
26909
|
|
|
25312
26910
|
|
|
@@ -25499,6 +27097,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25499
27097
|
|
|
25500
27098
|
|
|
25501
27099
|
|
|
27100
|
+
|
|
27101
|
+
|
|
27102
|
+
|
|
27103
|
+
|
|
27104
|
+
|
|
27105
|
+
|
|
27106
|
+
|
|
27107
|
+
|
|
27108
|
+
|
|
27109
|
+
|
|
27110
|
+
|
|
27111
|
+
|
|
27112
|
+
|
|
27113
|
+
|
|
27114
|
+
|
|
25502
27115
|
|
|
25503
27116
|
|
|
25504
27117
|
|
|
@@ -25565,6 +27178,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25565
27178
|
|
|
25566
27179
|
|
|
25567
27180
|
|
|
27181
|
+
|
|
27182
|
+
|
|
27183
|
+
|
|
25568
27184
|
|
|
25569
27185
|
|
|
25570
27186
|
|
|
@@ -25613,6 +27229,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25613
27229
|
|
|
25614
27230
|
|
|
25615
27231
|
|
|
27232
|
+
|
|
27233
|
+
|
|
27234
|
+
|
|
25616
27235
|
|
|
25617
27236
|
|
|
25618
27237
|
|
|
@@ -25792,6 +27411,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25792
27411
|
|
|
25793
27412
|
|
|
25794
27413
|
|
|
27414
|
+
|
|
27415
|
+
|
|
27416
|
+
|
|
27417
|
+
|
|
27418
|
+
|
|
27419
|
+
|
|
27420
|
+
|
|
27421
|
+
|
|
27422
|
+
|
|
27423
|
+
|
|
27424
|
+
|
|
27425
|
+
|
|
27426
|
+
|
|
27427
|
+
|
|
27428
|
+
|
|
25795
27429
|
|
|
25796
27430
|
|
|
25797
27431
|
|
|
@@ -25828,6 +27462,46 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25828
27462
|
for (let i = 0; i < c; i++) yield k;
|
|
25829
27463
|
}
|
|
25830
27464
|
}
|
|
27465
|
+
/**
|
|
27466
|
+
* Iterate over all elements with multiplicity (Set-compatible, alias for `[Symbol.iterator]`).
|
|
27467
|
+
* @remarks Each key is yielded `count(key)` times. Time O(size), Space O(1) per step.
|
|
27468
|
+
|
|
27469
|
+
|
|
27470
|
+
|
|
27471
|
+
|
|
27472
|
+
|
|
27473
|
+
|
|
27474
|
+
|
|
27475
|
+
|
|
27476
|
+
* @example
|
|
27477
|
+
* // Iterate with multiplicity
|
|
27478
|
+
* const ms = new TreeMultiSet<number>();
|
|
27479
|
+
* ms.add(1); ms.add(1); ms.add(2); ms.add(3); ms.add(3); ms.add(3);
|
|
27480
|
+
* console.log([...ms.keys()]); // [1, 1, 2, 3, 3, 3];
|
|
27481
|
+
*/
|
|
27482
|
+
*keys() {
|
|
27483
|
+
yield* this;
|
|
27484
|
+
}
|
|
27485
|
+
/**
|
|
27486
|
+
* Iterate over all elements with multiplicity (Set-compatible, alias for `[Symbol.iterator]`).
|
|
27487
|
+
* @remarks Each key is yielded `count(key)` times. Time O(size), Space O(1) per step.
|
|
27488
|
+
|
|
27489
|
+
|
|
27490
|
+
|
|
27491
|
+
|
|
27492
|
+
|
|
27493
|
+
|
|
27494
|
+
|
|
27495
|
+
|
|
27496
|
+
* @example
|
|
27497
|
+
* // Iterate with multiplicity
|
|
27498
|
+
* const ms = new TreeMultiSet<number>();
|
|
27499
|
+
* ms.add(5); ms.add(5); ms.add(10);
|
|
27500
|
+
* console.log([...ms.values()]); // [5, 5, 10];
|
|
27501
|
+
*/
|
|
27502
|
+
*values() {
|
|
27503
|
+
yield* this;
|
|
27504
|
+
}
|
|
25831
27505
|
/**
|
|
25832
27506
|
* Returns an array with all elements (expanded).
|
|
25833
27507
|
* @remarks Time O(size), Space O(size)
|
|
@@ -25993,6 +27667,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
25993
27667
|
|
|
25994
27668
|
|
|
25995
27669
|
|
|
27670
|
+
|
|
27671
|
+
|
|
27672
|
+
|
|
27673
|
+
|
|
27674
|
+
|
|
27675
|
+
|
|
27676
|
+
|
|
27677
|
+
|
|
27678
|
+
|
|
27679
|
+
|
|
27680
|
+
|
|
27681
|
+
|
|
27682
|
+
|
|
27683
|
+
|
|
27684
|
+
|
|
25996
27685
|
|
|
25997
27686
|
|
|
25998
27687
|
|
|
@@ -26048,6 +27737,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26048
27737
|
|
|
26049
27738
|
|
|
26050
27739
|
|
|
27740
|
+
|
|
27741
|
+
|
|
27742
|
+
|
|
26051
27743
|
|
|
26052
27744
|
|
|
26053
27745
|
|
|
@@ -26091,6 +27783,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26091
27783
|
|
|
26092
27784
|
|
|
26093
27785
|
|
|
27786
|
+
|
|
27787
|
+
|
|
27788
|
+
|
|
26094
27789
|
|
|
26095
27790
|
|
|
26096
27791
|
|
|
@@ -26279,6 +27974,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26279
27974
|
|
|
26280
27975
|
|
|
26281
27976
|
|
|
27977
|
+
|
|
27978
|
+
|
|
27979
|
+
|
|
27980
|
+
|
|
27981
|
+
|
|
27982
|
+
|
|
27983
|
+
|
|
27984
|
+
|
|
27985
|
+
|
|
27986
|
+
|
|
27987
|
+
|
|
27988
|
+
|
|
27989
|
+
|
|
27990
|
+
|
|
27991
|
+
|
|
26282
27992
|
|
|
26283
27993
|
|
|
26284
27994
|
|
|
@@ -26337,6 +28047,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26337
28047
|
|
|
26338
28048
|
|
|
26339
28049
|
|
|
28050
|
+
|
|
28051
|
+
|
|
28052
|
+
|
|
26340
28053
|
|
|
26341
28054
|
|
|
26342
28055
|
|
|
@@ -26381,6 +28094,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26381
28094
|
|
|
26382
28095
|
|
|
26383
28096
|
|
|
28097
|
+
|
|
28098
|
+
|
|
28099
|
+
|
|
26384
28100
|
|
|
26385
28101
|
|
|
26386
28102
|
|
|
@@ -26425,6 +28141,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26425
28141
|
|
|
26426
28142
|
|
|
26427
28143
|
|
|
28144
|
+
|
|
28145
|
+
|
|
28146
|
+
|
|
26428
28147
|
|
|
26429
28148
|
|
|
26430
28149
|
|
|
@@ -26473,6 +28192,9 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26473
28192
|
|
|
26474
28193
|
|
|
26475
28194
|
|
|
28195
|
+
|
|
28196
|
+
|
|
28197
|
+
|
|
26476
28198
|
|
|
26477
28199
|
|
|
26478
28200
|
|
|
@@ -26622,6 +28344,18 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26622
28344
|
|
|
26623
28345
|
|
|
26624
28346
|
|
|
28347
|
+
|
|
28348
|
+
|
|
28349
|
+
|
|
28350
|
+
|
|
28351
|
+
|
|
28352
|
+
|
|
28353
|
+
|
|
28354
|
+
|
|
28355
|
+
|
|
28356
|
+
|
|
28357
|
+
|
|
28358
|
+
|
|
26625
28359
|
|
|
26626
28360
|
|
|
26627
28361
|
|
|
@@ -26779,6 +28513,18 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26779
28513
|
|
|
26780
28514
|
|
|
26781
28515
|
|
|
28516
|
+
|
|
28517
|
+
|
|
28518
|
+
|
|
28519
|
+
|
|
28520
|
+
|
|
28521
|
+
|
|
28522
|
+
|
|
28523
|
+
|
|
28524
|
+
|
|
28525
|
+
|
|
28526
|
+
|
|
28527
|
+
|
|
26782
28528
|
|
|
26783
28529
|
|
|
26784
28530
|
|
|
@@ -26936,6 +28682,18 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
26936
28682
|
|
|
26937
28683
|
|
|
26938
28684
|
|
|
28685
|
+
|
|
28686
|
+
|
|
28687
|
+
|
|
28688
|
+
|
|
28689
|
+
|
|
28690
|
+
|
|
28691
|
+
|
|
28692
|
+
|
|
28693
|
+
|
|
28694
|
+
|
|
28695
|
+
|
|
28696
|
+
|
|
26939
28697
|
|
|
26940
28698
|
|
|
26941
28699
|
|
|
@@ -27092,6 +28850,18 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
27092
28850
|
|
|
27093
28851
|
|
|
27094
28852
|
|
|
28853
|
+
|
|
28854
|
+
|
|
28855
|
+
|
|
28856
|
+
|
|
28857
|
+
|
|
28858
|
+
|
|
28859
|
+
|
|
28860
|
+
|
|
28861
|
+
|
|
28862
|
+
|
|
28863
|
+
|
|
28864
|
+
|
|
27095
28865
|
|
|
27096
28866
|
|
|
27097
28867
|
|
|
@@ -27283,6 +29053,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
27283
29053
|
|
|
27284
29054
|
|
|
27285
29055
|
|
|
29056
|
+
|
|
29057
|
+
|
|
29058
|
+
|
|
29059
|
+
|
|
29060
|
+
|
|
29061
|
+
|
|
29062
|
+
|
|
29063
|
+
|
|
29064
|
+
|
|
29065
|
+
|
|
29066
|
+
|
|
29067
|
+
|
|
29068
|
+
|
|
29069
|
+
|
|
29070
|
+
|
|
27286
29071
|
|
|
27287
29072
|
|
|
27288
29073
|
|
|
@@ -27479,6 +29264,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
27479
29264
|
|
|
27480
29265
|
|
|
27481
29266
|
|
|
29267
|
+
|
|
29268
|
+
|
|
29269
|
+
|
|
29270
|
+
|
|
29271
|
+
|
|
29272
|
+
|
|
29273
|
+
|
|
29274
|
+
|
|
29275
|
+
|
|
29276
|
+
|
|
29277
|
+
|
|
29278
|
+
|
|
29279
|
+
|
|
29280
|
+
|
|
29281
|
+
|
|
27482
29282
|
|
|
27483
29283
|
|
|
27484
29284
|
|
|
@@ -27682,6 +29482,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
27682
29482
|
|
|
27683
29483
|
|
|
27684
29484
|
|
|
29485
|
+
|
|
29486
|
+
|
|
29487
|
+
|
|
29488
|
+
|
|
29489
|
+
|
|
29490
|
+
|
|
29491
|
+
|
|
29492
|
+
|
|
29493
|
+
|
|
29494
|
+
|
|
29495
|
+
|
|
29496
|
+
|
|
29497
|
+
|
|
29498
|
+
|
|
29499
|
+
|
|
27685
29500
|
|
|
27686
29501
|
|
|
27687
29502
|
|
|
@@ -27880,6 +29695,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
27880
29695
|
|
|
27881
29696
|
|
|
27882
29697
|
|
|
29698
|
+
|
|
29699
|
+
|
|
29700
|
+
|
|
29701
|
+
|
|
29702
|
+
|
|
29703
|
+
|
|
29704
|
+
|
|
29705
|
+
|
|
29706
|
+
|
|
29707
|
+
|
|
29708
|
+
|
|
29709
|
+
|
|
29710
|
+
|
|
29711
|
+
|
|
29712
|
+
|
|
27883
29713
|
|
|
27884
29714
|
|
|
27885
29715
|
|
|
@@ -28113,6 +29943,12 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
28113
29943
|
|
|
28114
29944
|
|
|
28115
29945
|
|
|
29946
|
+
|
|
29947
|
+
|
|
29948
|
+
|
|
29949
|
+
|
|
29950
|
+
|
|
29951
|
+
|
|
28116
29952
|
* @example
|
|
28117
29953
|
* // Pagination by position in tree order
|
|
28118
29954
|
* const tree = new TreeMultiSet<number>(
|
|
@@ -28151,6 +29987,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
28151
29987
|
|
|
28152
29988
|
|
|
28153
29989
|
|
|
29990
|
+
|
|
29991
|
+
|
|
29992
|
+
|
|
29993
|
+
|
|
29994
|
+
|
|
29995
|
+
|
|
29996
|
+
|
|
29997
|
+
|
|
29998
|
+
|
|
29999
|
+
|
|
30000
|
+
|
|
30001
|
+
|
|
30002
|
+
|
|
30003
|
+
|
|
30004
|
+
|
|
28154
30005
|
|
|
28155
30006
|
|
|
28156
30007
|
|
|
@@ -28308,6 +30159,18 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
28308
30159
|
|
|
28309
30160
|
|
|
28310
30161
|
|
|
30162
|
+
|
|
30163
|
+
|
|
30164
|
+
|
|
30165
|
+
|
|
30166
|
+
|
|
30167
|
+
|
|
30168
|
+
|
|
30169
|
+
|
|
30170
|
+
|
|
30171
|
+
|
|
30172
|
+
|
|
30173
|
+
|
|
28311
30174
|
|
|
28312
30175
|
|
|
28313
30176
|
|
|
@@ -28500,6 +30363,21 @@ var TreeMultiSet = class _TreeMultiSet {
|
|
|
28500
30363
|
|
|
28501
30364
|
|
|
28502
30365
|
|
|
30366
|
+
|
|
30367
|
+
|
|
30368
|
+
|
|
30369
|
+
|
|
30370
|
+
|
|
30371
|
+
|
|
30372
|
+
|
|
30373
|
+
|
|
30374
|
+
|
|
30375
|
+
|
|
30376
|
+
|
|
30377
|
+
|
|
30378
|
+
|
|
30379
|
+
|
|
30380
|
+
|
|
28503
30381
|
|
|
28504
30382
|
|
|
28505
30383
|
|