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
@@ -172,6 +172,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
172
172
 
173
173
 
174
174
 
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
175
195
 
176
196
 
177
197
 
@@ -327,6 +347,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
327
347
 
328
348
 
329
349
 
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
330
370
 
331
371
 
332
372
 
@@ -501,6 +541,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
501
541
 
502
542
 
503
543
 
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
504
564
 
505
565
 
506
566
 
@@ -666,6 +726,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
666
726
 
667
727
 
668
728
 
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
669
749
 
670
750
 
671
751
 
@@ -831,6 +911,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
831
911
 
832
912
 
833
913
 
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
+
933
+
834
934
 
835
935
 
836
936
 
@@ -985,6 +1085,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
985
1085
 
986
1086
 
987
1087
 
1088
+
1089
+
1090
+
1091
+
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+
988
1108
 
989
1109
 
990
1110
 
@@ -1132,6 +1252,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1132
1252
 
1133
1253
 
1134
1254
 
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1135
1275
 
1136
1276
 
1137
1277
 
@@ -1281,6 +1421,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1281
1421
 
1282
1422
 
1283
1423
 
1424
+
1425
+
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1284
1444
 
1285
1445
 
1286
1446
 
@@ -1429,6 +1589,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1429
1589
 
1430
1590
 
1431
1591
 
1592
+
1593
+
1594
+
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1432
1612
 
1433
1613
 
1434
1614
 
@@ -1578,6 +1758,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1578
1758
 
1579
1759
 
1580
1760
 
1761
+
1762
+
1763
+
1764
+
1765
+
1766
+
1767
+
1768
+
1769
+
1770
+
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+
1778
+
1779
+
1780
+
1581
1781
 
1582
1782
 
1583
1783
 
@@ -1729,6 +1929,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1729
1929
 
1730
1930
 
1731
1931
 
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+
1940
+
1941
+
1942
+
1943
+
1944
+
1945
+
1946
+
1947
+
1948
+
1949
+
1950
+
1951
+
1732
1952
 
1733
1953
 
1734
1954
 
@@ -1879,6 +2099,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
1879
2099
 
1880
2100
 
1881
2101
 
2102
+
2103
+
2104
+
2105
+
2106
+
2107
+
2108
+
2109
+
2110
+
2111
+
2112
+
2113
+
2114
+
2115
+
2116
+
2117
+
2118
+
2119
+
2120
+
2121
+
1882
2122
 
1883
2123
 
1884
2124
 
@@ -2027,6 +2267,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2027
2267
 
2028
2268
 
2029
2269
 
2270
+
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+
2284
+
2285
+
2286
+
2287
+
2288
+
2289
+
2030
2290
 
2031
2291
 
2032
2292
 
@@ -2172,6 +2432,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2172
2432
 
2173
2433
 
2174
2434
 
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+
2449
+
2450
+
2451
+
2452
+
2453
+
2454
+
2175
2455
 
2176
2456
 
2177
2457
 
@@ -2317,6 +2597,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2317
2597
 
2318
2598
 
2319
2599
 
2600
+
2601
+
2602
+
2603
+
2604
+
2605
+
2606
+
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+
2618
+
2619
+
2320
2620
 
2321
2621
 
2322
2622
 
@@ -2463,6 +2763,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2463
2763
 
2464
2764
 
2465
2765
 
2766
+
2767
+
2768
+
2769
+
2770
+
2771
+
2772
+
2773
+
2774
+
2775
+
2776
+
2777
+
2778
+
2779
+
2780
+
2781
+
2782
+
2783
+
2784
+
2785
+
2466
2786
 
2467
2787
 
2468
2788
 
@@ -2610,6 +2930,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2610
2930
 
2611
2931
 
2612
2932
 
2933
+
2934
+
2935
+
2936
+
2937
+
2938
+
2939
+
2940
+
2941
+
2942
+
2943
+
2944
+
2945
+
2946
+
2947
+
2948
+
2949
+
2950
+
2951
+
2952
+
2613
2953
 
2614
2954
 
2615
2955
 
@@ -2757,6 +3097,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2757
3097
 
2758
3098
 
2759
3099
 
3100
+
3101
+
3102
+
3103
+
3104
+
3105
+
3106
+
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+
3113
+
3114
+
3115
+
3116
+
3117
+
3118
+
3119
+
2760
3120
 
2761
3121
 
2762
3122
 
@@ -2812,6 +3172,10 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2812
3172
 
2813
3173
 
2814
3174
 
3175
+
3176
+
3177
+
3178
+
2815
3179
 
2816
3180
 
2817
3181
 
@@ -2873,6 +3237,10 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2873
3237
 
2874
3238
 
2875
3239
 
3240
+
3241
+
3242
+
3243
+
2876
3244
 
2877
3245
 
2878
3246
 
@@ -2918,6 +3286,10 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2918
3286
 
2919
3287
 
2920
3288
 
3289
+
3290
+
3291
+
3292
+
2921
3293
 
2922
3294
 
2923
3295
 
@@ -2965,6 +3337,10 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
2965
3337
 
2966
3338
 
2967
3339
 
3340
+
3341
+
3342
+
3343
+
2968
3344
 
2969
3345
 
2970
3346
 
@@ -3087,6 +3463,22 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3087
3463
 
3088
3464
 
3089
3465
 
3466
+
3467
+
3468
+
3469
+
3470
+
3471
+
3472
+
3473
+
3474
+
3475
+
3476
+
3477
+
3478
+
3479
+
3480
+
3481
+
3090
3482
 
3091
3483
 
3092
3484
 
@@ -3240,6 +3632,22 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3240
3632
 
3241
3633
 
3242
3634
 
3635
+
3636
+
3637
+
3638
+
3639
+
3640
+
3641
+
3642
+
3643
+
3644
+
3645
+
3646
+
3647
+
3648
+
3649
+
3650
+
3243
3651
 
3244
3652
 
3245
3653
 
@@ -3377,6 +3785,22 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3377
3785
 
3378
3786
 
3379
3787
 
3788
+
3789
+
3790
+
3791
+
3792
+
3793
+
3794
+
3795
+
3796
+
3797
+
3798
+
3799
+
3800
+
3801
+
3802
+
3803
+
3380
3804
 
3381
3805
 
3382
3806
 
@@ -3514,6 +3938,22 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3514
3938
 
3515
3939
 
3516
3940
 
3941
+
3942
+
3943
+
3944
+
3945
+
3946
+
3947
+
3948
+
3949
+
3950
+
3951
+
3952
+
3953
+
3954
+
3955
+
3956
+
3517
3957
 
3518
3958
 
3519
3959
 
@@ -3652,6 +4092,22 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3652
4092
 
3653
4093
 
3654
4094
 
4095
+
4096
+
4097
+
4098
+
4099
+
4100
+
4101
+
4102
+
4103
+
4104
+
4105
+
4106
+
4107
+
4108
+
4109
+
4110
+
3655
4111
 
3656
4112
 
3657
4113
 
@@ -3701,6 +4157,58 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3701
4157
  * console.log(totalValue); // toBeCloseTo;
3702
4158
  */
3703
4159
  rangeSearch(range: [K, K], options?: TreeMapRangeOptions): Array<[K, V | undefined]>;
4160
+ /**
4161
+ * Returns the entry at the k-th position in tree order (0-indexed).
4162
+ * @remarks Time O(log n). Requires `enableOrderStatistic: true`.
4163
+
4164
+
4165
+
4166
+ * @example
4167
+ * // Find k-th entry in a TreeMap
4168
+ * const map = new TreeMap<string, number>(
4169
+ * [['alice', 95], ['bob', 87], ['charlie', 92]],
4170
+ * { enableOrderStatistic: true }
4171
+ * );
4172
+ * console.log(map.getByRank(0)); // 'alice';
4173
+ * console.log(map.getByRank(1)); // 'bob';
4174
+ * console.log(map.getByRank(2)); // 'charlie';
4175
+ */
4176
+ getByRank(k: number): [K, V | undefined] | undefined;
4177
+ /**
4178
+ * Returns the 0-based rank of a key (number of elements that precede it in tree order).
4179
+ * @remarks Time O(log n). Requires `enableOrderStatistic: true`.
4180
+ * @example
4181
+ * // Get the rank of a key in sorted order
4182
+ * const tree = new TreeMap<number>(
4183
+ * [10, 20, 30, 40, 50],
4184
+ * { enableOrderStatistic: true }
4185
+ * );
4186
+ * console.log(tree.getRank(10)); // 0; // smallest → rank 0
4187
+ * console.log(tree.getRank(30)); // 2; // 2 elements before 30 in tree order
4188
+ * console.log(tree.getRank(50)); // 4; // largest → rank 4
4189
+ * console.log(tree.getRank(25)); // 2;
4190
+ */
4191
+ getRank(key: K): number;
4192
+ /**
4193
+ * Returns keys by rank range (0-indexed, inclusive on both ends).
4194
+ * @remarks Time O(log n + k). Requires `enableOrderStatistic: true`.
4195
+
4196
+ * @example
4197
+ * // Pagination with rangeByRank
4198
+ * const tree = new TreeMap<number>(
4199
+ * [10, 20, 30, 40, 50, 60, 70, 80, 90],
4200
+ * { enableOrderStatistic: true }
4201
+ * );
4202
+ * const pageSize = 3;
4203
+ *
4204
+ * // Page 1
4205
+ * console.log(tree.rangeByRank(0, pageSize - 1)); // [10, 20, 30];
4206
+ * // Page 2
4207
+ * console.log(tree.rangeByRank(pageSize, 2 * pageSize - 1)); // [40, 50, 60];
4208
+ * // Page 3
4209
+ * console.log(tree.rangeByRank(2 * pageSize, 3 * pageSize - 1)); // [70, 80, 90];
4210
+ */
4211
+ rangeByRank(start: number, end: number): Array<[K, V | undefined]>;
3704
4212
  /**
3705
4213
  * Creates a shallow clone of this map.
3706
4214
  * @remarks Time O(n log n), Space O(n)
@@ -3822,6 +4330,26 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
3822
4330
 
3823
4331
 
3824
4332
 
4333
+
4334
+
4335
+
4336
+
4337
+
4338
+
4339
+
4340
+
4341
+
4342
+
4343
+
4344
+
4345
+
4346
+
4347
+
4348
+
4349
+
4350
+
4351
+
4352
+
3825
4353
 
3826
4354
 
3827
4355