binary-tree-typed 2.5.2 → 2.5.3

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 (59) hide show
  1. package/dist/cjs/index.cjs +194 -55
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +194 -55
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +194 -55
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +194 -55
  8. package/dist/esm-legacy/index.mjs.map +1 -1
  9. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +50 -2
  10. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
  11. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +116 -15
  12. package/dist/types/data-structures/binary-tree/bst.d.ts +99 -3
  13. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +79 -8
  14. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
  15. package/dist/types/data-structures/binary-tree/tree-map.d.ts +520 -1
  16. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +489 -1
  17. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +393 -1
  18. package/dist/types/data-structures/binary-tree/tree-set.d.ts +500 -1
  19. package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
  20. package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
  21. package/dist/types/data-structures/hash/hash-map.d.ts +51 -6
  22. package/dist/types/data-structures/heap/heap.d.ts +98 -12
  23. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -0
  24. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +61 -1
  25. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
  26. package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
  27. package/dist/types/data-structures/queue/deque.d.ts +82 -0
  28. package/dist/types/data-structures/queue/queue.d.ts +61 -0
  29. package/dist/types/data-structures/stack/stack.d.ts +42 -2
  30. package/dist/types/data-structures/trie/trie.d.ts +48 -0
  31. package/dist/types/interfaces/binary-tree.d.ts +2 -3
  32. package/dist/umd/binary-tree-typed.js +194 -55
  33. package/dist/umd/binary-tree-typed.js.map +1 -1
  34. package/dist/umd/binary-tree-typed.min.js +5 -5
  35. package/dist/umd/binary-tree-typed.min.js.map +1 -1
  36. package/package.json +2 -2
  37. package/src/data-structures/binary-tree/avl-tree.ts +52 -5
  38. package/src/data-structures/binary-tree/binary-indexed-tree.ts +56 -0
  39. package/src/data-structures/binary-tree/binary-tree.ts +167 -81
  40. package/src/data-structures/binary-tree/bst.ts +101 -7
  41. package/src/data-structures/binary-tree/red-black-tree.ts +82 -15
  42. package/src/data-structures/binary-tree/segment-tree.ts +24 -0
  43. package/src/data-structures/binary-tree/tree-map.ts +540 -3
  44. package/src/data-structures/binary-tree/tree-multi-map.ts +490 -2
  45. package/src/data-structures/binary-tree/tree-multi-set.ts +393 -1
  46. package/src/data-structures/binary-tree/tree-set.ts +520 -3
  47. package/src/data-structures/graph/directed-graph.ts +41 -1
  48. package/src/data-structures/graph/undirected-graph.ts +37 -1
  49. package/src/data-structures/hash/hash-map.ts +67 -12
  50. package/src/data-structures/heap/heap.ts +107 -19
  51. package/src/data-structures/linked-list/doubly-linked-list.ts +88 -0
  52. package/src/data-structures/linked-list/singly-linked-list.ts +61 -1
  53. package/src/data-structures/linked-list/skip-linked-list.ts +72 -0
  54. package/src/data-structures/matrix/matrix.ts +32 -0
  55. package/src/data-structures/queue/deque.ts +85 -0
  56. package/src/data-structures/queue/queue.ts +73 -0
  57. package/src/data-structures/stack/stack.ts +45 -5
  58. package/src/data-structures/trie/trie.ts +48 -0
  59. package/src/interfaces/binary-tree.ts +1 -9
@@ -64,6 +64,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
64
64
 
65
65
 
66
66
 
67
+
68
+
69
+
70
+
67
71
 
68
72
 
69
73
 
@@ -217,6 +221,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
217
221
 
218
222
 
219
223
 
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
220
244
 
221
245
 
222
246
 
@@ -386,6 +410,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
386
410
 
387
411
 
388
412
 
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
389
433
 
390
434
 
391
435
 
@@ -439,6 +483,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
439
483
 
440
484
 
441
485
 
486
+
487
+
488
+
489
+
442
490
 
443
491
 
444
492
 
@@ -586,6 +634,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
586
634
 
587
635
 
588
636
 
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
589
657
 
590
658
 
591
659
 
@@ -642,6 +710,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
642
710
 
643
711
 
644
712
 
713
+
714
+
715
+
716
+
645
717
 
646
718
 
647
719
 
@@ -798,6 +870,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
798
870
 
799
871
 
800
872
 
873
+
874
+
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
801
893
 
802
894
 
803
895
 
@@ -852,6 +944,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
852
944
 
853
945
 
854
946
 
947
+
948
+
949
+
950
+
855
951
 
856
952
 
857
953
 
@@ -889,6 +985,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
889
985
 
890
986
 
891
987
 
988
+
989
+
990
+
991
+
892
992
 
893
993
 
894
994
 
@@ -1042,6 +1142,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1042
1142
 
1043
1143
 
1044
1144
 
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1045
1165
 
1046
1166
 
1047
1167
 
@@ -1215,6 +1335,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1215
1335
 
1216
1336
 
1217
1337
 
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1218
1358
 
1219
1359
 
1220
1360
 
@@ -1268,6 +1408,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1268
1408
 
1269
1409
 
1270
1410
 
1411
+
1412
+
1413
+
1414
+
1271
1415
 
1272
1416
 
1273
1417
 
@@ -1305,6 +1449,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1305
1449
 
1306
1450
 
1307
1451
 
1452
+
1453
+
1454
+
1455
+
1308
1456
 
1309
1457
 
1310
1458
 
@@ -1464,6 +1612,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1464
1612
 
1465
1613
 
1466
1614
 
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+
1628
+
1629
+
1630
+
1631
+
1632
+
1633
+
1634
+
1467
1635
 
1468
1636
 
1469
1637
 
@@ -1518,6 +1686,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1518
1686
 
1519
1687
 
1520
1688
 
1689
+
1690
+
1691
+
1692
+
1521
1693
 
1522
1694
 
1523
1695
 
@@ -1556,6 +1728,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1556
1728
 
1557
1729
 
1558
1730
 
1731
+
1732
+
1733
+
1734
+
1559
1735
 
1560
1736
 
1561
1737
 
@@ -1594,6 +1770,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1594
1770
 
1595
1771
 
1596
1772
 
1773
+
1774
+
1775
+
1776
+
1597
1777
 
1598
1778
 
1599
1779
 
@@ -1633,6 +1813,10 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1633
1813
 
1634
1814
 
1635
1815
 
1816
+
1817
+
1818
+
1819
+
1636
1820
 
1637
1821
 
1638
1822
 
@@ -1758,6 +1942,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1758
1942
 
1759
1943
 
1760
1944
 
1945
+
1946
+
1947
+
1948
+
1949
+
1950
+
1951
+
1952
+
1953
+
1954
+
1955
+
1956
+
1957
+
1958
+
1959
+
1960
+
1761
1961
 
1762
1962
 
1763
1963
 
@@ -1896,6 +2096,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
1896
2096
 
1897
2097
 
1898
2098
 
2099
+
2100
+
2101
+
2102
+
2103
+
2104
+
2105
+
2106
+
2107
+
2108
+
2109
+
2110
+
2111
+
2112
+
2113
+
2114
+
1899
2115
 
1900
2116
 
1901
2117
 
@@ -2034,6 +2250,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2034
2250
 
2035
2251
 
2036
2252
 
2253
+
2254
+
2255
+
2256
+
2257
+
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+
2264
+
2265
+
2266
+
2267
+
2268
+
2037
2269
 
2038
2270
 
2039
2271
 
@@ -2171,6 +2403,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2171
2403
 
2172
2404
 
2173
2405
 
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+
2414
+
2415
+
2416
+
2417
+
2418
+
2419
+
2420
+
2421
+
2174
2422
 
2175
2423
 
2176
2424
 
@@ -2337,6 +2585,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2337
2585
 
2338
2586
 
2339
2587
 
2588
+
2589
+
2590
+
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+
2602
+
2603
+
2604
+
2605
+
2606
+
2607
+
2340
2608
 
2341
2609
 
2342
2610
 
@@ -2509,6 +2777,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2509
2777
 
2510
2778
 
2511
2779
 
2780
+
2781
+
2782
+
2783
+
2784
+
2785
+
2786
+
2787
+
2788
+
2789
+
2790
+
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+
2797
+
2798
+
2799
+
2512
2800
 
2513
2801
 
2514
2802
 
@@ -2681,6 +2969,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2681
2969
 
2682
2970
 
2683
2971
 
2972
+
2973
+
2974
+
2975
+
2976
+
2977
+
2978
+
2979
+
2980
+
2981
+
2982
+
2983
+
2984
+
2985
+
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+
2684
2992
 
2685
2993
 
2686
2994
 
@@ -2853,6 +3161,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
2853
3161
 
2854
3162
 
2855
3163
 
3164
+
3165
+
3166
+
3167
+
3168
+
3169
+
3170
+
3171
+
3172
+
3173
+
3174
+
3175
+
3176
+
3177
+
3178
+
3179
+
3180
+
3181
+
3182
+
3183
+
2856
3184
 
2857
3185
 
2858
3186
 
@@ -3070,8 +3398,16 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
3070
3398
  /**
3071
3399
  * Get elements by rank range
3072
3400
 
3401
+
3402
+
3403
+
3404
+
3405
+
3406
+
3407
+
3408
+
3073
3409
  * @example
3074
- * // Pagination with rangeByRank
3410
+ * // Pagination by position in tree order
3075
3411
  * const tree = new TreeMultiSet<number>(
3076
3412
  * [10, 20, 30, 40, 50, 60, 70, 80, 90],
3077
3413
  * { enableOrderStatistic: true }
@@ -3091,6 +3427,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
3091
3427
 
3092
3428
 
3093
3429
 
3430
+
3431
+
3432
+
3433
+
3434
+
3435
+
3436
+
3437
+
3438
+
3439
+
3440
+
3441
+
3442
+
3443
+
3444
+
3445
+
3446
+
3447
+
3448
+
3449
+
3094
3450
 
3095
3451
  * @example
3096
3452
  * // Deep clone
@@ -3213,6 +3569,22 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
3213
3569
 
3214
3570
 
3215
3571
 
3572
+
3573
+
3574
+
3575
+
3576
+
3577
+
3578
+
3579
+
3580
+
3581
+
3582
+
3583
+
3584
+
3585
+
3586
+
3587
+
3216
3588
 
3217
3589
 
3218
3590
 
@@ -3381,6 +3753,26 @@ export declare class TreeMultiSet<K = any, R = K> implements Iterable<K> {
3381
3753
 
3382
3754
 
3383
3755
 
3756
+
3757
+
3758
+
3759
+
3760
+
3761
+
3762
+
3763
+
3764
+
3765
+
3766
+
3767
+
3768
+
3769
+
3770
+
3771
+
3772
+
3773
+
3774
+
3775
+
3384
3776
 
3385
3777
 
3386
3778