data-structure-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/CHANGELOG.md +3 -1
- package/README.md +75 -17
- package/dist/cjs/binary-tree.cjs +2723 -139
- package/dist/cjs/graph.cjs +192 -6
- package/dist/cjs/hash.cjs +63 -15
- package/dist/cjs/heap.cjs +93 -31
- package/dist/cjs/index.cjs +3514 -379
- package/dist/cjs/linked-list.cjs +237 -31
- package/dist/cjs/matrix.cjs +47 -9
- package/dist/cjs/priority-queue.cjs +92 -30
- package/dist/cjs/queue.cjs +176 -2
- package/dist/cjs/stack.cjs +48 -2
- package/dist/cjs/trie.cjs +78 -28
- package/dist/cjs-legacy/binary-tree.cjs +2725 -136
- package/dist/cjs-legacy/graph.cjs +192 -6
- package/dist/cjs-legacy/hash.cjs +63 -15
- package/dist/cjs-legacy/heap.cjs +93 -31
- package/dist/cjs-legacy/index.cjs +3389 -249
- package/dist/cjs-legacy/linked-list.cjs +237 -31
- package/dist/cjs-legacy/matrix.cjs +47 -9
- package/dist/cjs-legacy/priority-queue.cjs +92 -30
- package/dist/cjs-legacy/queue.cjs +176 -2
- package/dist/cjs-legacy/stack.cjs +48 -2
- package/dist/cjs-legacy/trie.cjs +78 -28
- package/dist/esm/binary-tree.mjs +2723 -139
- package/dist/esm/graph.mjs +192 -6
- package/dist/esm/hash.mjs +63 -15
- package/dist/esm/heap.mjs +93 -31
- package/dist/esm/index.mjs +3514 -380
- package/dist/esm/linked-list.mjs +237 -31
- package/dist/esm/matrix.mjs +47 -9
- package/dist/esm/priority-queue.mjs +92 -30
- package/dist/esm/queue.mjs +176 -2
- package/dist/esm/stack.mjs +48 -2
- package/dist/esm/trie.mjs +78 -28
- package/dist/esm-legacy/binary-tree.mjs +2725 -136
- package/dist/esm-legacy/graph.mjs +192 -6
- package/dist/esm-legacy/hash.mjs +63 -15
- package/dist/esm-legacy/heap.mjs +93 -31
- package/dist/esm-legacy/index.mjs +3389 -250
- package/dist/esm-legacy/linked-list.mjs +237 -31
- package/dist/esm-legacy/matrix.mjs +47 -9
- package/dist/esm-legacy/priority-queue.mjs +92 -30
- package/dist/esm-legacy/queue.mjs +176 -2
- package/dist/esm-legacy/stack.mjs +48 -2
- package/dist/esm-legacy/trie.mjs +78 -28
- 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 +48 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +102 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +195 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +76 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +528 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +531 -6
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +435 -6
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +505 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +44 -0
- package/dist/types/data-structures/heap/heap.d.ts +56 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +68 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +60 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
- package/dist/types/data-structures/queue/deque.d.ts +60 -0
- package/dist/types/data-structures/queue/queue.d.ts +48 -0
- package/dist/types/data-structures/stack/stack.d.ts +40 -0
- package/dist/types/data-structures/trie/trie.d.ts +48 -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/data-structure-typed.js +3404 -265
- package/dist/umd/data-structure-typed.min.js +5 -5
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +650 -136
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
- package/docs-site-docusaurus/docs/api/classes/BST.md +591 -129
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +107 -107
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- 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 +47 -47
- package/docs-site-docusaurus/docs/api/classes/Heap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +49 -49
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +44 -44
- package/docs-site-docusaurus/docs/api/classes/Queue.md +60 -60
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +660 -146
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +78 -78
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
- package/docs-site-docusaurus/docs/api/classes/Stack.md +39 -39
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +165 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +161 -32
- package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
- package/docs-site-docusaurus/docs/guide/architecture.md +2 -0
- package/docs-site-docusaurus/docs/guide/concepts.md +32 -1
- package/docs-site-docusaurus/docs/guide/faq.md +180 -0
- package/docs-site-docusaurus/docs/guide/guides.md +40 -54
- package/docs-site-docusaurus/docs/guide/installation.md +2 -0
- package/docs-site-docusaurus/docs/guide/integrations.md +2 -0
- package/docs-site-docusaurus/docs/guide/overview.md +7 -0
- package/docs-site-docusaurus/docs/guide/performance.md +2 -0
- package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
- package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
- package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
- package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
- package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
- package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
- package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
- package/docs-site-docusaurus/docusaurus.config.ts +1 -1
- package/docs-site-docusaurus/src/pages/index.tsx +51 -2
- package/docs-site-docusaurus/static/llms.txt +37 -0
- package/llms.txt +37 -0
- package/package.json +64 -56
- 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
|
@@ -60,6 +60,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
|
|
@@ -193,6 +197,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
193
197
|
|
|
194
198
|
|
|
195
199
|
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
196
220
|
|
|
197
221
|
|
|
198
222
|
|
|
@@ -342,6 +366,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
342
366
|
|
|
343
367
|
|
|
344
368
|
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
345
389
|
|
|
346
390
|
|
|
347
391
|
|
|
@@ -391,6 +435,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
391
435
|
|
|
392
436
|
|
|
393
437
|
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
394
442
|
|
|
395
443
|
|
|
396
444
|
|
|
@@ -518,6 +566,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
518
566
|
|
|
519
567
|
|
|
520
568
|
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
521
589
|
|
|
522
590
|
|
|
523
591
|
|
|
@@ -570,6 +638,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
570
638
|
|
|
571
639
|
|
|
572
640
|
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
573
645
|
|
|
574
646
|
|
|
575
647
|
|
|
@@ -706,6 +778,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
706
778
|
|
|
707
779
|
|
|
708
780
|
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
709
801
|
|
|
710
802
|
|
|
711
803
|
|
|
@@ -756,6 +848,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
756
848
|
|
|
757
849
|
|
|
758
850
|
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
759
855
|
|
|
760
856
|
|
|
761
857
|
|
|
@@ -789,6 +885,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
789
885
|
|
|
790
886
|
|
|
791
887
|
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
792
892
|
|
|
793
893
|
|
|
794
894
|
|
|
@@ -922,6 +1022,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
922
1022
|
|
|
923
1023
|
|
|
924
1024
|
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
925
1045
|
|
|
926
1046
|
|
|
927
1047
|
|
|
@@ -1075,6 +1195,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1075
1195
|
|
|
1076
1196
|
|
|
1077
1197
|
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1078
1218
|
|
|
1079
1219
|
|
|
1080
1220
|
|
|
@@ -1124,6 +1264,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1124
1264
|
|
|
1125
1265
|
|
|
1126
1266
|
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
|
|
1270
|
+
|
|
1127
1271
|
|
|
1128
1272
|
|
|
1129
1273
|
|
|
@@ -1157,6 +1301,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1157
1301
|
|
|
1158
1302
|
|
|
1159
1303
|
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
|
|
1160
1308
|
|
|
1161
1309
|
|
|
1162
1310
|
|
|
@@ -1296,6 +1444,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1296
1444
|
|
|
1297
1445
|
|
|
1298
1446
|
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1299
1467
|
|
|
1300
1468
|
|
|
1301
1469
|
|
|
@@ -1346,6 +1514,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1346
1514
|
|
|
1347
1515
|
|
|
1348
1516
|
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
|
|
1349
1521
|
|
|
1350
1522
|
|
|
1351
1523
|
|
|
@@ -1380,6 +1552,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1380
1552
|
|
|
1381
1553
|
|
|
1382
1554
|
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
|
|
1383
1559
|
|
|
1384
1560
|
|
|
1385
1561
|
|
|
@@ -1414,6 +1590,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1414
1590
|
|
|
1415
1591
|
|
|
1416
1592
|
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1417
1597
|
|
|
1418
1598
|
|
|
1419
1599
|
|
|
@@ -1449,6 +1629,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1449
1629
|
|
|
1450
1630
|
|
|
1451
1631
|
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
|
|
1452
1636
|
|
|
1453
1637
|
|
|
1454
1638
|
|
|
@@ -1558,6 +1742,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1558
1742
|
|
|
1559
1743
|
|
|
1560
1744
|
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
|
|
1561
1761
|
|
|
1562
1762
|
|
|
1563
1763
|
|
|
@@ -1680,6 +1880,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1680
1880
|
|
|
1681
1881
|
|
|
1682
1882
|
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
|
|
1683
1899
|
|
|
1684
1900
|
|
|
1685
1901
|
|
|
@@ -1802,6 +2018,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1802
2018
|
|
|
1803
2019
|
|
|
1804
2020
|
|
|
2021
|
+
|
|
2022
|
+
|
|
2023
|
+
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
|
|
2036
|
+
|
|
1805
2037
|
|
|
1806
2038
|
|
|
1807
2039
|
|
|
@@ -1923,6 +2155,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
1923
2155
|
|
|
1924
2156
|
|
|
1925
2157
|
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
|
|
1926
2174
|
|
|
1927
2175
|
|
|
1928
2176
|
|
|
@@ -2069,6 +2317,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2069
2317
|
|
|
2070
2318
|
|
|
2071
2319
|
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
|
|
2072
2340
|
|
|
2073
2341
|
|
|
2074
2342
|
|
|
@@ -2221,6 +2489,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2221
2489
|
|
|
2222
2490
|
|
|
2223
2491
|
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
|
|
2495
|
+
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
|
|
2511
|
+
|
|
2224
2512
|
|
|
2225
2513
|
|
|
2226
2514
|
|
|
@@ -2373,6 +2661,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2373
2661
|
|
|
2374
2662
|
|
|
2375
2663
|
|
|
2664
|
+
|
|
2665
|
+
|
|
2666
|
+
|
|
2667
|
+
|
|
2668
|
+
|
|
2669
|
+
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
|
|
2681
|
+
|
|
2682
|
+
|
|
2683
|
+
|
|
2376
2684
|
|
|
2377
2685
|
|
|
2378
2686
|
|
|
@@ -2525,6 +2833,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2525
2833
|
|
|
2526
2834
|
|
|
2527
2835
|
|
|
2836
|
+
|
|
2837
|
+
|
|
2838
|
+
|
|
2839
|
+
|
|
2840
|
+
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
|
|
2844
|
+
|
|
2845
|
+
|
|
2846
|
+
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
|
|
2850
|
+
|
|
2851
|
+
|
|
2852
|
+
|
|
2853
|
+
|
|
2854
|
+
|
|
2855
|
+
|
|
2528
2856
|
|
|
2529
2857
|
|
|
2530
2858
|
|
|
@@ -2680,6 +3008,24 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2680
3008
|
|
|
2681
3009
|
|
|
2682
3010
|
|
|
3011
|
+
|
|
3012
|
+
|
|
3013
|
+
|
|
3014
|
+
|
|
3015
|
+
|
|
3016
|
+
|
|
3017
|
+
|
|
3018
|
+
|
|
3019
|
+
|
|
3020
|
+
|
|
3021
|
+
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
|
|
3025
|
+
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
|
|
2683
3029
|
|
|
2684
3030
|
|
|
2685
3031
|
|
|
@@ -2700,13 +3046,60 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2700
3046
|
|
|
2701
3047
|
|
|
2702
3048
|
* @example
|
|
2703
|
-
* //
|
|
2704
|
-
* const
|
|
2705
|
-
*
|
|
2706
|
-
*
|
|
2707
|
-
*
|
|
2708
|
-
* console.log(ms.has(1)); // true;
|
|
3049
|
+
* // Order-statistic on BST
|
|
3050
|
+
* const tree = new TreeMultiSet<number>([30, 10, 50, 20, 40], { enableOrderStatistic: true });
|
|
3051
|
+
* console.log(tree.getByRank(0)); // 10;
|
|
3052
|
+
* console.log(tree.getByRank(4)); // 50;
|
|
3053
|
+
* console.log(tree.getRank(30)); // 2;
|
|
2709
3054
|
*/
|
|
3055
|
+
getByRank(k: number): K | undefined;
|
|
3056
|
+
/**
|
|
3057
|
+
* Get the rank of a key in sorted order
|
|
3058
|
+
* @example
|
|
3059
|
+
* // Get the rank of a key in sorted order
|
|
3060
|
+
* const tree = new TreeMultiSet<number>(
|
|
3061
|
+
* [10, 20, 30, 40, 50],
|
|
3062
|
+
* { enableOrderStatistic: true }
|
|
3063
|
+
* );
|
|
3064
|
+
* console.log(tree.getRank(10)); // 0; // smallest → rank 0
|
|
3065
|
+
* console.log(tree.getRank(30)); // 2; // 2 elements before 30 in tree order
|
|
3066
|
+
* console.log(tree.getRank(50)); // 4; // largest → rank 4
|
|
3067
|
+
* console.log(tree.getRank(25)); // 2;
|
|
3068
|
+
*/
|
|
3069
|
+
getRank(key: K): number;
|
|
3070
|
+
/**
|
|
3071
|
+
* Get elements by rank range
|
|
3072
|
+
|
|
3073
|
+
* @example
|
|
3074
|
+
* // Pagination with rangeByRank
|
|
3075
|
+
* const tree = new TreeMultiSet<number>(
|
|
3076
|
+
* [10, 20, 30, 40, 50, 60, 70, 80, 90],
|
|
3077
|
+
* { enableOrderStatistic: true }
|
|
3078
|
+
* );
|
|
3079
|
+
* const pageSize = 3;
|
|
3080
|
+
*
|
|
3081
|
+
* // Page 1
|
|
3082
|
+
* console.log(tree.rangeByRank(0, pageSize - 1)); // [10, 20, 30];
|
|
3083
|
+
* // Page 2
|
|
3084
|
+
* console.log(tree.rangeByRank(pageSize, 2 * pageSize - 1)); // [40, 50, 60];
|
|
3085
|
+
* // Page 3
|
|
3086
|
+
* console.log(tree.rangeByRank(2 * pageSize, 3 * pageSize - 1)); // [70, 80, 90];
|
|
3087
|
+
*/
|
|
3088
|
+
rangeByRank(start: number, end: number): K[];
|
|
3089
|
+
/**
|
|
3090
|
+
* Deep copy
|
|
3091
|
+
|
|
3092
|
+
|
|
3093
|
+
|
|
3094
|
+
|
|
3095
|
+
* @example
|
|
3096
|
+
* // Deep clone
|
|
3097
|
+
* const ms = new TreeMultiSet<number>();
|
|
3098
|
+
* ms.add(1, 3);
|
|
3099
|
+
* const copy = ms.clone();
|
|
3100
|
+
* copy.deleteAll(1);
|
|
3101
|
+
* console.log(ms.has(1)); // true;
|
|
3102
|
+
*/
|
|
2710
3103
|
clone(): TreeMultiSet<K>;
|
|
2711
3104
|
/**
|
|
2712
3105
|
* Returns keys within the given range.
|
|
@@ -2804,6 +3197,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2804
3197
|
|
|
2805
3198
|
|
|
2806
3199
|
|
|
3200
|
+
|
|
3201
|
+
|
|
3202
|
+
|
|
3203
|
+
|
|
3204
|
+
|
|
3205
|
+
|
|
3206
|
+
|
|
3207
|
+
|
|
3208
|
+
|
|
3209
|
+
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
|
|
3213
|
+
|
|
3214
|
+
|
|
3215
|
+
|
|
2807
3216
|
|
|
2808
3217
|
|
|
2809
3218
|
|
|
@@ -2952,6 +3361,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
|
|
|
2952
3361
|
|
|
2953
3362
|
|
|
2954
3363
|
|
|
3364
|
+
|
|
3365
|
+
|
|
3366
|
+
|
|
3367
|
+
|
|
3368
|
+
|
|
3369
|
+
|
|
3370
|
+
|
|
3371
|
+
|
|
3372
|
+
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
|
|
3376
|
+
|
|
3377
|
+
|
|
3378
|
+
|
|
3379
|
+
|
|
3380
|
+
|
|
3381
|
+
|
|
3382
|
+
|
|
3383
|
+
|
|
2955
3384
|
|
|
2956
3385
|
|
|
2957
3386
|
|