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.
Files changed (172) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/README.md +75 -17
  3. package/dist/cjs/binary-tree.cjs +2723 -139
  4. package/dist/cjs/graph.cjs +192 -6
  5. package/dist/cjs/hash.cjs +63 -15
  6. package/dist/cjs/heap.cjs +93 -31
  7. package/dist/cjs/index.cjs +3514 -379
  8. package/dist/cjs/linked-list.cjs +237 -31
  9. package/dist/cjs/matrix.cjs +47 -9
  10. package/dist/cjs/priority-queue.cjs +92 -30
  11. package/dist/cjs/queue.cjs +176 -2
  12. package/dist/cjs/stack.cjs +48 -2
  13. package/dist/cjs/trie.cjs +78 -28
  14. package/dist/cjs-legacy/binary-tree.cjs +2725 -136
  15. package/dist/cjs-legacy/graph.cjs +192 -6
  16. package/dist/cjs-legacy/hash.cjs +63 -15
  17. package/dist/cjs-legacy/heap.cjs +93 -31
  18. package/dist/cjs-legacy/index.cjs +3389 -249
  19. package/dist/cjs-legacy/linked-list.cjs +237 -31
  20. package/dist/cjs-legacy/matrix.cjs +47 -9
  21. package/dist/cjs-legacy/priority-queue.cjs +92 -30
  22. package/dist/cjs-legacy/queue.cjs +176 -2
  23. package/dist/cjs-legacy/stack.cjs +48 -2
  24. package/dist/cjs-legacy/trie.cjs +78 -28
  25. package/dist/esm/binary-tree.mjs +2723 -139
  26. package/dist/esm/graph.mjs +192 -6
  27. package/dist/esm/hash.mjs +63 -15
  28. package/dist/esm/heap.mjs +93 -31
  29. package/dist/esm/index.mjs +3514 -380
  30. package/dist/esm/linked-list.mjs +237 -31
  31. package/dist/esm/matrix.mjs +47 -9
  32. package/dist/esm/priority-queue.mjs +92 -30
  33. package/dist/esm/queue.mjs +176 -2
  34. package/dist/esm/stack.mjs +48 -2
  35. package/dist/esm/trie.mjs +78 -28
  36. package/dist/esm-legacy/binary-tree.mjs +2725 -136
  37. package/dist/esm-legacy/graph.mjs +192 -6
  38. package/dist/esm-legacy/hash.mjs +63 -15
  39. package/dist/esm-legacy/heap.mjs +93 -31
  40. package/dist/esm-legacy/index.mjs +3389 -250
  41. package/dist/esm-legacy/linked-list.mjs +237 -31
  42. package/dist/esm-legacy/matrix.mjs +47 -9
  43. package/dist/esm-legacy/priority-queue.mjs +92 -30
  44. package/dist/esm-legacy/queue.mjs +176 -2
  45. package/dist/esm-legacy/stack.mjs +48 -2
  46. package/dist/esm-legacy/trie.mjs +78 -28
  47. package/dist/types/common/error.d.ts +9 -0
  48. package/dist/types/common/index.d.ts +1 -1
  49. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +48 -0
  50. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
  51. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +102 -2
  52. package/dist/types/data-structures/binary-tree/bst.d.ts +195 -0
  53. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +76 -0
  54. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
  55. package/dist/types/data-structures/binary-tree/tree-map.d.ts +528 -0
  56. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +531 -6
  57. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +435 -6
  58. package/dist/types/data-structures/binary-tree/tree-set.d.ts +505 -0
  59. package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
  60. package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
  61. package/dist/types/data-structures/hash/hash-map.d.ts +44 -0
  62. package/dist/types/data-structures/heap/heap.d.ts +56 -0
  63. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +68 -0
  64. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +60 -0
  65. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
  66. package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
  67. package/dist/types/data-structures/queue/deque.d.ts +60 -0
  68. package/dist/types/data-structures/queue/queue.d.ts +48 -0
  69. package/dist/types/data-structures/stack/stack.d.ts +40 -0
  70. package/dist/types/data-structures/trie/trie.d.ts +48 -0
  71. package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
  72. package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
  73. package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
  74. package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
  75. package/dist/umd/data-structure-typed.js +3404 -265
  76. package/dist/umd/data-structure-typed.min.js +5 -5
  77. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +650 -136
  78. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
  79. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
  80. package/docs-site-docusaurus/docs/api/classes/BST.md +591 -129
  81. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
  82. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
  83. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +107 -107
  84. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  85. package/docs-site-docusaurus/docs/api/classes/Deque.md +82 -82
  86. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
  87. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +74 -74
  88. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
  89. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  90. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  91. package/docs-site-docusaurus/docs/api/classes/HashMap.md +47 -47
  92. package/docs-site-docusaurus/docs/api/classes/Heap.md +45 -45
  93. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
  94. package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
  95. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
  96. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
  97. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +49 -49
  98. package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
  99. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
  100. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
  101. package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
  102. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +45 -45
  103. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +45 -45
  104. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +45 -45
  105. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +45 -45
  106. package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
  107. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +44 -44
  108. package/docs-site-docusaurus/docs/api/classes/Queue.md +60 -60
  109. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +660 -146
  110. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
  111. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +78 -78
  112. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
  113. package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
  114. package/docs-site-docusaurus/docs/api/classes/Stack.md +39 -39
  115. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +165 -33
  116. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
  117. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +161 -32
  118. package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
  119. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  120. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
  121. package/docs-site-docusaurus/docs/guide/architecture.md +2 -0
  122. package/docs-site-docusaurus/docs/guide/concepts.md +32 -1
  123. package/docs-site-docusaurus/docs/guide/faq.md +180 -0
  124. package/docs-site-docusaurus/docs/guide/guides.md +40 -54
  125. package/docs-site-docusaurus/docs/guide/installation.md +2 -0
  126. package/docs-site-docusaurus/docs/guide/integrations.md +2 -0
  127. package/docs-site-docusaurus/docs/guide/overview.md +7 -0
  128. package/docs-site-docusaurus/docs/guide/performance.md +2 -0
  129. package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
  130. package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
  131. package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
  132. package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
  133. package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
  134. package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
  135. package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
  136. package/docs-site-docusaurus/docusaurus.config.ts +1 -1
  137. package/docs-site-docusaurus/src/pages/index.tsx +51 -2
  138. package/docs-site-docusaurus/static/llms.txt +37 -0
  139. package/llms.txt +37 -0
  140. package/package.json +64 -56
  141. package/src/common/error.ts +19 -1
  142. package/src/common/index.ts +1 -1
  143. package/src/data-structures/base/iterable-element-base.ts +3 -2
  144. package/src/data-structures/binary-tree/avl-tree.ts +47 -0
  145. package/src/data-structures/binary-tree/binary-indexed-tree.ts +46 -4
  146. package/src/data-structures/binary-tree/binary-tree.ts +79 -4
  147. package/src/data-structures/binary-tree/bst.ts +441 -6
  148. package/src/data-structures/binary-tree/red-black-tree.ts +73 -0
  149. package/src/data-structures/binary-tree/segment-tree.ts +18 -0
  150. package/src/data-structures/binary-tree/tree-map.ts +434 -9
  151. package/src/data-structures/binary-tree/tree-multi-map.ts +426 -5
  152. package/src/data-structures/binary-tree/tree-multi-set.ts +350 -6
  153. package/src/data-structures/binary-tree/tree-set.ts +410 -8
  154. package/src/data-structures/graph/abstract-graph.ts +2 -2
  155. package/src/data-structures/graph/directed-graph.ts +30 -0
  156. package/src/data-structures/graph/undirected-graph.ts +27 -0
  157. package/src/data-structures/hash/hash-map.ts +35 -4
  158. package/src/data-structures/heap/heap.ts +46 -4
  159. package/src/data-structures/heap/max-heap.ts +2 -2
  160. package/src/data-structures/linked-list/doubly-linked-list.ts +51 -0
  161. package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
  162. package/src/data-structures/linked-list/skip-linked-list.ts +59 -5
  163. package/src/data-structures/matrix/matrix.ts +33 -9
  164. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
  165. package/src/data-structures/queue/deque.ts +45 -0
  166. package/src/data-structures/queue/queue.ts +36 -0
  167. package/src/data-structures/stack/stack.ts +30 -0
  168. package/src/data-structures/trie/trie.ts +38 -2
  169. package/src/types/data-structures/binary-tree/bst.ts +1 -0
  170. package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
  171. package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
  172. package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
@@ -168,6 +168,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
168
168
 
169
169
 
170
170
 
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
171
191
 
172
192
 
173
193
 
@@ -314,6 +334,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
314
334
 
315
335
 
316
336
 
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
317
357
 
318
358
 
319
359
 
@@ -363,6 +403,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
363
403
 
364
404
 
365
405
 
406
+
407
+
408
+
409
+
366
410
 
367
411
 
368
412
 
@@ -396,6 +440,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
396
440
 
397
441
 
398
442
 
443
+
444
+
445
+
446
+
399
447
 
400
448
 
401
449
 
@@ -564,6 +612,30 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
564
612
 
565
613
 
566
614
 
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
567
639
 
568
640
 
569
641
 
@@ -747,6 +819,30 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
747
819
 
748
820
 
749
821
 
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
750
846
 
751
847
 
752
848
 
@@ -890,6 +986,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
890
986
 
891
987
 
892
988
 
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
893
1009
 
894
1010
 
895
1011
 
@@ -1072,6 +1188,30 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1072
1188
 
1073
1189
 
1074
1190
 
1191
+
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+
1075
1215
 
1076
1216
 
1077
1217
 
@@ -1256,6 +1396,30 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1256
1396
 
1257
1397
 
1258
1398
 
1399
+
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+
1421
+
1422
+
1259
1423
 
1260
1424
 
1261
1425
 
@@ -1306,6 +1470,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1306
1470
 
1307
1471
 
1308
1472
 
1473
+
1474
+
1475
+
1476
+
1309
1477
 
1310
1478
 
1311
1479
 
@@ -1339,6 +1507,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1339
1507
 
1340
1508
 
1341
1509
 
1510
+
1511
+
1512
+
1513
+
1342
1514
 
1343
1515
 
1344
1516
 
@@ -1373,6 +1545,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1373
1545
 
1374
1546
 
1375
1547
 
1548
+
1549
+
1550
+
1551
+
1376
1552
 
1377
1553
 
1378
1554
 
@@ -1513,6 +1689,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1513
1689
 
1514
1690
 
1515
1691
 
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+
1516
1712
 
1517
1713
 
1518
1714
 
@@ -1662,6 +1858,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1662
1858
 
1663
1859
 
1664
1860
 
1861
+
1862
+
1863
+
1864
+
1865
+
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+
1876
+
1877
+
1878
+
1879
+
1880
+
1665
1881
 
1666
1882
 
1667
1883
 
@@ -1711,6 +1927,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1711
1927
 
1712
1928
 
1713
1929
 
1930
+
1931
+
1932
+
1933
+
1714
1934
 
1715
1935
 
1716
1936
 
@@ -1744,6 +1964,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1744
1964
 
1745
1965
 
1746
1966
 
1967
+
1968
+
1969
+
1970
+
1747
1971
 
1748
1972
 
1749
1973
 
@@ -1777,6 +2001,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1777
2001
 
1778
2002
 
1779
2003
 
2004
+
2005
+
2006
+
2007
+
1780
2008
 
1781
2009
 
1782
2010
 
@@ -1839,6 +2067,14 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1839
2067
 
1840
2068
 
1841
2069
 
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+
2077
+
1842
2078
 
1843
2079
 
1844
2080
 
@@ -1904,6 +2140,14 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1904
2140
 
1905
2141
 
1906
2142
 
2143
+
2144
+
2145
+
2146
+
2147
+
2148
+
2149
+
2150
+
1907
2151
 
1908
2152
 
1909
2153
 
@@ -1942,6 +2186,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1942
2186
 
1943
2187
 
1944
2188
 
2189
+
2190
+
2191
+
2192
+
1945
2193
 
1946
2194
 
1947
2195
 
@@ -1978,6 +2226,10 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1978
2226
 
1979
2227
 
1980
2228
 
2229
+
2230
+
2231
+
2232
+
1981
2233
 
1982
2234
 
1983
2235
 
@@ -2115,6 +2367,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2115
2367
 
2116
2368
 
2117
2369
 
2370
+
2371
+
2372
+
2373
+
2374
+
2375
+
2376
+
2377
+
2378
+
2379
+
2380
+
2381
+
2382
+
2383
+
2384
+
2385
+
2386
+
2387
+
2388
+
2389
+
2118
2390
 
2119
2391
 
2120
2392
 
@@ -2268,6 +2540,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2268
2540
 
2269
2541
 
2270
2542
 
2543
+
2544
+
2545
+
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+
2560
+
2561
+
2562
+
2271
2563
 
2272
2564
 
2273
2565
 
@@ -2394,6 +2686,22 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2394
2686
 
2395
2687
 
2396
2688
 
2689
+
2690
+
2691
+
2692
+
2693
+
2694
+
2695
+
2696
+
2697
+
2698
+
2699
+
2700
+
2701
+
2702
+
2703
+
2704
+
2397
2705
 
2398
2706
 
2399
2707
 
@@ -2515,6 +2823,22 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2515
2823
 
2516
2824
 
2517
2825
 
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+
2832
+
2833
+
2834
+
2835
+
2836
+
2837
+
2838
+
2839
+
2840
+
2841
+
2518
2842
 
2519
2843
 
2520
2844
 
@@ -2660,6 +2984,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2660
2984
 
2661
2985
 
2662
2986
 
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+
2994
+
2995
+
2996
+
2997
+
2998
+
2999
+
3000
+
3001
+
3002
+
3003
+
3004
+
3005
+
3006
+
2663
3007
 
2664
3008
 
2665
3009
 
@@ -2808,6 +3152,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2808
3152
 
2809
3153
 
2810
3154
 
3155
+
3156
+
3157
+
3158
+
3159
+
3160
+
3161
+
3162
+
3163
+
3164
+
3165
+
3166
+
3167
+
3168
+
3169
+
3170
+
3171
+
3172
+
3173
+
3174
+
2811
3175
 
2812
3176
 
2813
3177
 
@@ -2959,6 +3323,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2959
3323
 
2960
3324
 
2961
3325
 
3326
+
3327
+
3328
+
3329
+
3330
+
3331
+
3332
+
3333
+
3334
+
3335
+
3336
+
3337
+
3338
+
3339
+
3340
+
3341
+
3342
+
3343
+
3344
+
3345
+
2962
3346
 
2963
3347
 
2964
3348
 
@@ -3110,6 +3494,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3110
3494
 
3111
3495
 
3112
3496
 
3497
+
3498
+
3499
+
3500
+
3501
+
3502
+
3503
+
3504
+
3505
+
3506
+
3507
+
3508
+
3509
+
3510
+
3511
+
3512
+
3513
+
3514
+
3515
+
3516
+
3113
3517
 
3114
3518
 
3115
3519
 
@@ -3259,6 +3663,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3259
3663
 
3260
3664
 
3261
3665
 
3666
+
3667
+
3668
+
3669
+
3670
+
3671
+
3672
+
3673
+
3674
+
3675
+
3676
+
3677
+
3678
+
3679
+
3680
+
3681
+
3682
+
3683
+
3684
+
3685
+
3262
3686
 
3263
3687
 
3264
3688
 
@@ -3401,6 +3825,26 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3401
3825
 
3402
3826
 
3403
3827
 
3828
+
3829
+
3830
+
3831
+
3832
+
3833
+
3834
+
3835
+
3836
+
3837
+
3838
+
3839
+
3840
+
3841
+
3842
+
3843
+
3844
+
3845
+
3846
+
3847
+
3404
3848
 
3405
3849
 
3406
3850
 
@@ -3525,6 +3969,22 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3525
3969
 
3526
3970
 
3527
3971
 
3972
+
3973
+
3974
+
3975
+
3976
+
3977
+
3978
+
3979
+
3980
+
3981
+
3982
+
3983
+
3984
+
3985
+
3986
+
3987
+
3528
3988
 
3529
3989
 
3530
3990
 
@@ -3674,6 +4134,24 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3674
4134
 
3675
4135
 
3676
4136
 
4137
+
4138
+
4139
+
4140
+
4141
+
4142
+
4143
+
4144
+
4145
+
4146
+
4147
+
4148
+
4149
+
4150
+
4151
+
4152
+
4153
+
4154
+
3677
4155
 
3678
4156
 
3679
4157
 
@@ -3694,13 +4172,60 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3694
4172
 
3695
4173
 
3696
4174
  * @example
3697
- * // Deep clone
3698
- * const mm = new TreeMultiMap<number, string>();
3699
- * mm.add(1, 'a');
3700
- * const copy = mm.clone();
3701
- * copy.delete(1);
3702
- * console.log(mm.has(1)); // true;
4175
+ * // Order-statistic on BST
4176
+ * const tree = new TreeMultiMap<number>([30, 10, 50, 20, 40], { enableOrderStatistic: true });
4177
+ * console.log(tree.getByRank(0)); // 10;
4178
+ * console.log(tree.getByRank(4)); // 50;
4179
+ * console.log(tree.getRank(30)); // 2;
3703
4180
  */
4181
+ getByRank(k: number): [K, V[]] | undefined;
4182
+ /**
4183
+ * Get the rank of a key in sorted order
4184
+ * @example
4185
+ * // Get the rank of a key in sorted order
4186
+ * const tree = new TreeMultiMap<number>(
4187
+ * [10, 20, 30, 40, 50],
4188
+ * { enableOrderStatistic: true }
4189
+ * );
4190
+ * console.log(tree.getRank(10)); // 0; // smallest → rank 0
4191
+ * console.log(tree.getRank(30)); // 2; // 2 elements before 30 in tree order
4192
+ * console.log(tree.getRank(50)); // 4; // largest → rank 4
4193
+ * console.log(tree.getRank(25)); // 2;
4194
+ */
4195
+ getRank(key: K): number;
4196
+ /**
4197
+ * Get elements by rank range
4198
+
4199
+ * @example
4200
+ * // Pagination with rangeByRank
4201
+ * const tree = new TreeMultiMap<number>(
4202
+ * [10, 20, 30, 40, 50, 60, 70, 80, 90],
4203
+ * { enableOrderStatistic: true }
4204
+ * );
4205
+ * const pageSize = 3;
4206
+ *
4207
+ * // Page 1
4208
+ * console.log(tree.rangeByRank(0, pageSize - 1)); // [10, 20, 30];
4209
+ * // Page 2
4210
+ * console.log(tree.rangeByRank(pageSize, 2 * pageSize - 1)); // [40, 50, 60];
4211
+ * // Page 3
4212
+ * console.log(tree.rangeByRank(2 * pageSize, 3 * pageSize - 1)); // [70, 80, 90];
4213
+ */
4214
+ rangeByRank(start: number, end: number): Array<[K, V[]]>;
4215
+ /**
4216
+ * Deep copy
4217
+
4218
+
4219
+
4220
+
4221
+ * @example
4222
+ * // Deep clone
4223
+ * const mm = new TreeMultiMap<number, string>();
4224
+ * mm.add(1, 'a');
4225
+ * const copy = mm.clone();
4226
+ * copy.delete(1);
4227
+ * console.log(mm.has(1)); // true;
4228
+ */
3704
4229
  clone(): TreeMultiMap<K, V, R>;
3705
4230
  /**
3706
4231
  * Expose comparator for advanced usage/testing (read-only).