max-priority-queue-typed 2.5.3 → 2.6.0

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 (61) hide show
  1. package/dist/cjs/index.cjs +71 -0
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +71 -0
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +71 -0
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +71 -0
  8. package/dist/esm-legacy/index.mjs.map +1 -1
  9. package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
  10. package/dist/types/data-structures/base/linear-base.d.ts +6 -0
  11. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +36 -0
  12. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
  13. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +75 -0
  14. package/dist/types/data-structures/binary-tree/bst.d.ts +72 -0
  15. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
  16. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
  17. package/dist/types/data-structures/binary-tree/tree-map.d.ts +375 -0
  18. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
  19. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
  20. package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -0
  21. package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
  22. package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
  23. package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
  24. package/dist/types/data-structures/heap/heap.d.ts +42 -0
  25. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -2
  26. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
  27. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
  28. package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
  29. package/dist/types/data-structures/queue/deque.d.ts +90 -1
  30. package/dist/types/data-structures/queue/queue.d.ts +36 -0
  31. package/dist/types/data-structures/stack/stack.d.ts +30 -0
  32. package/dist/types/data-structures/trie/trie.d.ts +36 -0
  33. package/dist/umd/max-priority-queue-typed.js +71 -0
  34. package/dist/umd/max-priority-queue-typed.js.map +1 -1
  35. package/dist/umd/max-priority-queue-typed.min.js +1 -1
  36. package/dist/umd/max-priority-queue-typed.min.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/data-structures/base/iterable-element-base.ts +32 -0
  39. package/src/data-structures/base/linear-base.ts +11 -0
  40. package/src/data-structures/binary-tree/avl-tree.ts +36 -0
  41. package/src/data-structures/binary-tree/binary-indexed-tree.ts +42 -0
  42. package/src/data-structures/binary-tree/binary-tree.ts +75 -0
  43. package/src/data-structures/binary-tree/bst.ts +72 -0
  44. package/src/data-structures/binary-tree/red-black-tree.ts +57 -0
  45. package/src/data-structures/binary-tree/segment-tree.ts +18 -0
  46. package/src/data-structures/binary-tree/tree-map.ts +375 -0
  47. package/src/data-structures/binary-tree/tree-multi-map.ts +392 -0
  48. package/src/data-structures/binary-tree/tree-multi-set.ts +336 -0
  49. package/src/data-structures/binary-tree/tree-set.ts +492 -0
  50. package/src/data-structures/graph/directed-graph.ts +30 -0
  51. package/src/data-structures/graph/undirected-graph.ts +27 -0
  52. package/src/data-structures/hash/hash-map.ts +33 -0
  53. package/src/data-structures/heap/heap.ts +42 -0
  54. package/src/data-structures/linked-list/doubly-linked-list.ts +90 -2
  55. package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
  56. package/src/data-structures/linked-list/skip-linked-list.ts +54 -0
  57. package/src/data-structures/matrix/matrix.ts +24 -0
  58. package/src/data-structures/queue/deque.ts +103 -1
  59. package/src/data-structures/queue/queue.ts +36 -0
  60. package/src/data-structures/stack/stack.ts +30 -0
  61. package/src/data-structures/trie/trie.ts +36 -0
@@ -213,6 +213,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
213
213
 
214
214
 
215
215
 
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
216
231
 
217
232
 
218
233
 
@@ -399,6 +414,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
399
414
 
400
415
 
401
416
 
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
402
432
 
403
433
 
404
434
 
@@ -452,6 +482,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
452
482
 
453
483
 
454
484
 
485
+
486
+
487
+
455
488
 
456
489
 
457
490
 
@@ -493,6 +526,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
493
526
 
494
527
 
495
528
 
529
+
530
+
531
+
496
532
 
497
533
 
498
534
 
@@ -710,6 +746,24 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
710
746
 
711
747
 
712
748
 
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
713
767
 
714
768
 
715
769
 
@@ -941,6 +995,24 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
941
995
 
942
996
 
943
997
 
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
944
1016
 
945
1017
 
946
1018
 
@@ -1127,6 +1199,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1127
1199
 
1128
1200
 
1129
1201
 
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+
1130
1217
 
1131
1218
 
1132
1219
 
@@ -1354,6 +1441,24 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1354
1441
 
1355
1442
 
1356
1443
 
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1357
1462
 
1358
1463
 
1359
1464
 
@@ -1586,6 +1691,24 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1586
1691
 
1587
1692
 
1588
1693
 
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+
1589
1712
 
1590
1713
 
1591
1714
 
@@ -1643,6 +1766,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1643
1766
 
1644
1767
 
1645
1768
 
1769
+
1770
+
1771
+
1646
1772
 
1647
1773
 
1648
1774
 
@@ -1684,6 +1810,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1684
1810
 
1685
1811
 
1686
1812
 
1813
+
1814
+
1815
+
1687
1816
 
1688
1817
 
1689
1818
 
@@ -1726,6 +1855,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1726
1855
 
1727
1856
 
1728
1857
 
1858
+
1859
+
1860
+
1729
1861
 
1730
1862
 
1731
1863
 
@@ -1910,6 +2042,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
1910
2042
 
1911
2043
 
1912
2044
 
2045
+
2046
+
2047
+
2048
+
2049
+
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
1913
2060
 
1914
2061
 
1915
2062
 
@@ -2099,6 +2246,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2099
2246
 
2100
2247
 
2101
2248
 
2249
+
2250
+
2251
+
2252
+
2253
+
2254
+
2255
+
2256
+
2257
+
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+
2102
2264
 
2103
2265
 
2104
2266
 
@@ -2123,6 +2285,29 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2123
2285
  * console.log([...mm.values()]); // [['a', 'b']];
2124
2286
  */
2125
2287
  values(): IterableIterator<V[]>;
2288
+ /**
2289
+ * Iterate over all `[key, values[]]` entries (Map-compatible).
2290
+ * @remarks Time O(n), Space O(1) per step.
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+ * @example
2300
+ * // Iterate over entries
2301
+ * const mm = new TreeMultiMap<number, string>();
2302
+ * mm.set(1, 'a');
2303
+ * mm.set(1, 'b');
2304
+ * mm.set(2, 'c');
2305
+ * console.log([...mm.entries()]); // [
2306
+ * // [1, ['a', 'b']],
2307
+ * // [2, ['c']]
2308
+ * // ];
2309
+ */
2310
+ entries(): IterableIterator<[K, V[]]>;
2126
2311
  /**
2127
2312
  * Iterates over all entries for a specific key.
2128
2313
  * @remarks Time O(log n + m), Space O(1) where m is bucket size
@@ -2152,6 +2337,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2152
2337
 
2153
2338
 
2154
2339
 
2340
+
2341
+
2342
+
2155
2343
 
2156
2344
 
2157
2345
 
@@ -2193,6 +2381,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2193
2381
 
2194
2382
 
2195
2383
 
2384
+
2385
+
2386
+
2196
2387
 
2197
2388
 
2198
2389
 
@@ -2234,6 +2425,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2234
2425
 
2235
2426
 
2236
2427
 
2428
+
2429
+
2430
+
2237
2431
 
2238
2432
 
2239
2433
 
@@ -2313,6 +2507,12 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2313
2507
 
2314
2508
 
2315
2509
 
2510
+
2511
+
2512
+
2513
+
2514
+
2515
+
2316
2516
 
2317
2517
 
2318
2518
 
@@ -2394,6 +2594,12 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2394
2594
 
2395
2595
 
2396
2596
 
2597
+
2598
+
2599
+
2600
+
2601
+
2602
+
2397
2603
 
2398
2604
 
2399
2605
 
@@ -2439,6 +2645,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2439
2645
 
2440
2646
 
2441
2647
 
2648
+
2649
+
2650
+
2442
2651
 
2443
2652
 
2444
2653
 
@@ -2483,6 +2692,9 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2483
2692
 
2484
2693
 
2485
2694
 
2695
+
2696
+
2697
+
2486
2698
 
2487
2699
 
2488
2700
 
@@ -2664,6 +2876,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2664
2876
 
2665
2877
 
2666
2878
 
2879
+
2880
+
2881
+
2882
+
2883
+
2884
+
2885
+
2886
+
2887
+
2888
+
2889
+
2890
+
2891
+
2892
+
2893
+
2667
2894
 
2668
2895
 
2669
2896
 
@@ -2857,6 +3084,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
2857
3084
 
2858
3085
 
2859
3086
 
3087
+
3088
+
3089
+
3090
+
3091
+
3092
+
3093
+
3094
+
3095
+
3096
+
3097
+
3098
+
3099
+
3100
+
3101
+
2860
3102
 
2861
3103
 
2862
3104
 
@@ -3014,6 +3256,18 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3014
3256
 
3015
3257
 
3016
3258
 
3259
+
3260
+
3261
+
3262
+
3263
+
3264
+
3265
+
3266
+
3267
+
3268
+
3269
+
3270
+
3017
3271
 
3018
3272
 
3019
3273
 
@@ -3167,6 +3421,18 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3167
3421
 
3168
3422
 
3169
3423
 
3424
+
3425
+
3426
+
3427
+
3428
+
3429
+
3430
+
3431
+
3432
+
3433
+
3434
+
3435
+
3170
3436
 
3171
3437
 
3172
3438
 
@@ -3353,6 +3619,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3353
3619
 
3354
3620
 
3355
3621
 
3622
+
3623
+
3624
+
3625
+
3626
+
3627
+
3628
+
3629
+
3630
+
3631
+
3632
+
3633
+
3634
+
3635
+
3636
+
3356
3637
 
3357
3638
 
3358
3639
 
@@ -3541,6 +3822,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3541
3822
 
3542
3823
 
3543
3824
 
3825
+
3826
+
3827
+
3828
+
3829
+
3830
+
3831
+
3832
+
3833
+
3834
+
3835
+
3836
+
3837
+
3838
+
3839
+
3544
3840
 
3545
3841
 
3546
3842
 
@@ -3732,6 +4028,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3732
4028
 
3733
4029
 
3734
4030
 
4031
+
4032
+
4033
+
4034
+
4035
+
4036
+
4037
+
4038
+
4039
+
4040
+
4041
+
4042
+
4043
+
4044
+
4045
+
3735
4046
 
3736
4047
 
3737
4048
 
@@ -3923,6 +4234,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
3923
4234
 
3924
4235
 
3925
4236
 
4237
+
4238
+
4239
+
4240
+
4241
+
4242
+
4243
+
4244
+
4245
+
4246
+
4247
+
4248
+
4249
+
4250
+
4251
+
3926
4252
 
3927
4253
 
3928
4254
 
@@ -4112,6 +4438,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
4112
4438
 
4113
4439
 
4114
4440
 
4441
+
4442
+
4443
+
4444
+
4445
+
4446
+
4447
+
4448
+
4449
+
4450
+
4451
+
4452
+
4453
+
4454
+
4455
+
4115
4456
 
4116
4457
 
4117
4458
 
@@ -4294,6 +4635,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
4294
4635
 
4295
4636
 
4296
4637
 
4638
+
4639
+
4640
+
4641
+
4642
+
4643
+
4644
+
4645
+
4646
+
4647
+
4648
+
4649
+
4650
+
4651
+
4652
+
4297
4653
 
4298
4654
 
4299
4655
 
@@ -4449,6 +4805,18 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
4449
4805
 
4450
4806
 
4451
4807
 
4808
+
4809
+
4810
+
4811
+
4812
+
4813
+
4814
+
4815
+
4816
+
4817
+
4818
+
4819
+
4452
4820
 
4453
4821
 
4454
4822
 
@@ -4664,6 +5032,12 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
4664
5032
 
4665
5033
 
4666
5034
 
5035
+
5036
+
5037
+
5038
+
5039
+
5040
+
4667
5041
  * @example
4668
5042
  * // Pagination by position in tree order
4669
5043
  * const tree = new TreeMultiMap<number>(
@@ -4700,6 +5074,21 @@ export declare class TreeMultiMap<K = any, V = any, R = any> implements Iterable
4700
5074
 
4701
5075
 
4702
5076
 
5077
+
5078
+
5079
+
5080
+
5081
+
5082
+
5083
+
5084
+
5085
+
5086
+
5087
+
5088
+
5089
+
5090
+
5091
+
4703
5092
 
4704
5093
 
4705
5094