linked-list-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 +219 -0
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +219 -0
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +219 -0
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +219 -0
  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/linked-list-typed.js +219 -0
  33. package/dist/umd/linked-list-typed.js.map +1 -1
  34. package/dist/umd/linked-list-typed.min.js +1 -1
  35. package/dist/umd/linked-list-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
@@ -833,6 +833,10 @@ var linkedListTyped = (() => {
833
833
 
834
834
 
835
835
 
836
+
837
+
838
+
839
+
836
840
 
837
841
 
838
842
 
@@ -900,6 +904,10 @@ var linkedListTyped = (() => {
900
904
 
901
905
 
902
906
 
907
+
908
+
909
+
910
+
903
911
 
904
912
 
905
913
 
@@ -973,6 +981,10 @@ var linkedListTyped = (() => {
973
981
 
974
982
 
975
983
 
984
+
985
+
986
+
987
+
976
988
 
977
989
 
978
990
 
@@ -1027,6 +1039,10 @@ var linkedListTyped = (() => {
1027
1039
 
1028
1040
 
1029
1041
 
1042
+
1043
+
1044
+
1045
+
1030
1046
 
1031
1047
 
1032
1048
 
@@ -1142,6 +1158,10 @@ var linkedListTyped = (() => {
1142
1158
 
1143
1159
 
1144
1160
 
1161
+
1162
+
1163
+
1164
+
1145
1165
 
1146
1166
 
1147
1167
 
@@ -1201,6 +1221,10 @@ var linkedListTyped = (() => {
1201
1221
 
1202
1222
 
1203
1223
 
1224
+
1225
+
1226
+
1227
+
1204
1228
 
1205
1229
 
1206
1230
 
@@ -1249,6 +1273,10 @@ var linkedListTyped = (() => {
1249
1273
 
1250
1274
 
1251
1275
 
1276
+
1277
+
1278
+
1279
+
1252
1280
 
1253
1281
 
1254
1282
 
@@ -1303,6 +1331,10 @@ var linkedListTyped = (() => {
1303
1331
 
1304
1332
 
1305
1333
 
1334
+
1335
+
1336
+
1337
+
1306
1338
 
1307
1339
 
1308
1340
 
@@ -1362,6 +1394,10 @@ var linkedListTyped = (() => {
1362
1394
 
1363
1395
 
1364
1396
 
1397
+
1398
+
1399
+
1400
+
1365
1401
 
1366
1402
 
1367
1403
 
@@ -1429,6 +1465,10 @@ var linkedListTyped = (() => {
1429
1465
 
1430
1466
 
1431
1467
 
1468
+
1469
+
1470
+
1471
+
1432
1472
 
1433
1473
 
1434
1474
 
@@ -1473,6 +1513,10 @@ var linkedListTyped = (() => {
1473
1513
 
1474
1514
 
1475
1515
 
1516
+
1517
+
1518
+
1519
+
1476
1520
 
1477
1521
 
1478
1522
 
@@ -1523,6 +1567,10 @@ var linkedListTyped = (() => {
1523
1567
 
1524
1568
 
1525
1569
 
1570
+
1571
+
1572
+
1573
+
1526
1574
 
1527
1575
 
1528
1576
 
@@ -1739,6 +1787,10 @@ var linkedListTyped = (() => {
1739
1787
 
1740
1788
 
1741
1789
 
1790
+
1791
+
1792
+
1793
+
1742
1794
 
1743
1795
 
1744
1796
 
@@ -1793,6 +1845,10 @@ var linkedListTyped = (() => {
1793
1845
 
1794
1846
 
1795
1847
 
1848
+
1849
+
1850
+
1851
+
1796
1852
 
1797
1853
 
1798
1854
 
@@ -1875,6 +1931,10 @@ var linkedListTyped = (() => {
1875
1931
 
1876
1932
 
1877
1933
 
1934
+
1935
+
1936
+
1937
+
1878
1938
 
1879
1939
 
1880
1940
 
@@ -2190,6 +2250,10 @@ var linkedListTyped = (() => {
2190
2250
 
2191
2251
 
2192
2252
 
2253
+
2254
+
2255
+
2256
+
2193
2257
 
2194
2258
 
2195
2259
 
@@ -2259,6 +2323,10 @@ var linkedListTyped = (() => {
2259
2323
 
2260
2324
 
2261
2325
 
2326
+
2327
+
2328
+
2329
+
2262
2330
 
2263
2331
 
2264
2332
 
@@ -2327,6 +2395,10 @@ var linkedListTyped = (() => {
2327
2395
 
2328
2396
 
2329
2397
 
2398
+
2399
+
2400
+
2401
+
2330
2402
 
2331
2403
 
2332
2404
 
@@ -2386,6 +2458,10 @@ var linkedListTyped = (() => {
2386
2458
 
2387
2459
 
2388
2460
 
2461
+
2462
+
2463
+
2464
+
2389
2465
 
2390
2466
 
2391
2467
 
@@ -2474,6 +2550,10 @@ var linkedListTyped = (() => {
2474
2550
 
2475
2551
 
2476
2552
 
2553
+
2554
+
2555
+
2556
+
2477
2557
 
2478
2558
 
2479
2559
 
@@ -2523,6 +2603,10 @@ var linkedListTyped = (() => {
2523
2603
 
2524
2604
 
2525
2605
 
2606
+
2607
+
2608
+
2609
+
2526
2610
 
2527
2611
 
2528
2612
 
@@ -2603,6 +2687,10 @@ var linkedListTyped = (() => {
2603
2687
 
2604
2688
 
2605
2689
 
2690
+
2691
+
2692
+
2693
+
2606
2694
 
2607
2695
 
2608
2696
 
@@ -2711,6 +2799,10 @@ var linkedListTyped = (() => {
2711
2799
 
2712
2800
 
2713
2801
 
2802
+
2803
+
2804
+
2805
+
2714
2806
 
2715
2807
 
2716
2808
 
@@ -2766,6 +2858,10 @@ var linkedListTyped = (() => {
2766
2858
 
2767
2859
 
2768
2860
 
2861
+
2862
+
2863
+
2864
+
2769
2865
 
2770
2866
 
2771
2867
 
@@ -2823,6 +2919,10 @@ var linkedListTyped = (() => {
2823
2919
 
2824
2920
 
2825
2921
 
2922
+
2923
+
2924
+
2925
+
2826
2926
 
2827
2927
 
2828
2928
 
@@ -2867,6 +2967,10 @@ var linkedListTyped = (() => {
2867
2967
 
2868
2968
 
2869
2969
 
2970
+
2971
+
2972
+
2973
+
2870
2974
 
2871
2975
 
2872
2976
 
@@ -2915,6 +3019,10 @@ var linkedListTyped = (() => {
2915
3019
 
2916
3020
 
2917
3021
 
3022
+
3023
+
3024
+
3025
+
2918
3026
 
2919
3027
 
2920
3028
 
@@ -2967,6 +3075,10 @@ var linkedListTyped = (() => {
2967
3075
 
2968
3076
 
2969
3077
 
3078
+
3079
+
3080
+
3081
+
2970
3082
 
2971
3083
 
2972
3084
 
@@ -3022,6 +3134,10 @@ var linkedListTyped = (() => {
3022
3134
 
3023
3135
 
3024
3136
 
3137
+
3138
+
3139
+
3140
+
3025
3141
 
3026
3142
 
3027
3143
 
@@ -3043,6 +3159,25 @@ var linkedListTyped = (() => {
3043
3159
  }
3044
3160
  return this;
3045
3161
  }
3162
+ /**
3163
+ * Delete the first element that satisfies a predicate.
3164
+ * @remarks Time O(N), Space O(1)
3165
+ * @param predicate - Function (value, index, list) → boolean to decide deletion.
3166
+ * @returns True if a match was removed.
3167
+ */
3168
+ deleteWhere(predicate) {
3169
+ let current = this.head;
3170
+ let index = 0;
3171
+ while (current) {
3172
+ if (predicate(current.value, index, this)) {
3173
+ this.delete(current);
3174
+ return true;
3175
+ }
3176
+ current = current.next;
3177
+ index++;
3178
+ }
3179
+ return false;
3180
+ }
3046
3181
  /**
3047
3182
  * Set the equality comparator used to compare values.
3048
3183
  * @remarks Time O(1), Space O(1)
@@ -3085,6 +3220,10 @@ var linkedListTyped = (() => {
3085
3220
 
3086
3221
 
3087
3222
 
3223
+
3224
+
3225
+
3226
+
3088
3227
 
3089
3228
 
3090
3229
 
@@ -3138,6 +3277,10 @@ var linkedListTyped = (() => {
3138
3277
 
3139
3278
 
3140
3279
 
3280
+
3281
+
3282
+
3283
+
3141
3284
 
3142
3285
 
3143
3286
 
@@ -3210,6 +3353,10 @@ var linkedListTyped = (() => {
3210
3353
 
3211
3354
 
3212
3355
 
3356
+
3357
+
3358
+
3359
+
3213
3360
 
3214
3361
 
3215
3362
 
@@ -3605,6 +3752,10 @@ var linkedListTyped = (() => {
3605
3752
 
3606
3753
 
3607
3754
 
3755
+
3756
+
3757
+
3758
+
3608
3759
 
3609
3760
 
3610
3761
 
@@ -3647,6 +3798,10 @@ var linkedListTyped = (() => {
3647
3798
 
3648
3799
 
3649
3800
 
3801
+
3802
+
3803
+
3804
+
3650
3805
 
3651
3806
 
3652
3807
 
@@ -3692,6 +3847,10 @@ var linkedListTyped = (() => {
3692
3847
 
3693
3848
 
3694
3849
 
3850
+
3851
+
3852
+
3853
+
3695
3854
 
3696
3855
 
3697
3856
 
@@ -3745,6 +3904,10 @@ var linkedListTyped = (() => {
3745
3904
 
3746
3905
 
3747
3906
 
3907
+
3908
+
3909
+
3910
+
3748
3911
 
3749
3912
 
3750
3913
 
@@ -3823,6 +3986,10 @@ var linkedListTyped = (() => {
3823
3986
 
3824
3987
 
3825
3988
 
3989
+
3990
+
3991
+
3992
+
3826
3993
 
3827
3994
 
3828
3995
 
@@ -3886,6 +4053,10 @@ var linkedListTyped = (() => {
3886
4053
 
3887
4054
 
3888
4055
 
4056
+
4057
+
4058
+
4059
+
3889
4060
 
3890
4061
 
3891
4062
 
@@ -3932,6 +4103,10 @@ var linkedListTyped = (() => {
3932
4103
 
3933
4104
 
3934
4105
 
4106
+
4107
+
4108
+
4109
+
3935
4110
 
3936
4111
 
3937
4112
 
@@ -3998,6 +4173,10 @@ var linkedListTyped = (() => {
3998
4173
 
3999
4174
 
4000
4175
 
4176
+
4177
+
4178
+
4179
+
4001
4180
 
4002
4181
 
4003
4182
 
@@ -4044,6 +4223,10 @@ var linkedListTyped = (() => {
4044
4223
 
4045
4224
 
4046
4225
 
4226
+
4227
+
4228
+
4229
+
4047
4230
 
4048
4231
 
4049
4232
 
@@ -4092,6 +4275,10 @@ var linkedListTyped = (() => {
4092
4275
 
4093
4276
 
4094
4277
 
4278
+
4279
+
4280
+
4281
+
4095
4282
 
4096
4283
 
4097
4284
 
@@ -4138,6 +4325,10 @@ var linkedListTyped = (() => {
4138
4325
 
4139
4326
 
4140
4327
 
4328
+
4329
+
4330
+
4331
+
4141
4332
 
4142
4333
 
4143
4334
 
@@ -4187,6 +4378,10 @@ var linkedListTyped = (() => {
4187
4378
 
4188
4379
 
4189
4380
 
4381
+
4382
+
4383
+
4384
+
4190
4385
 
4191
4386
 
4192
4387
 
@@ -4241,6 +4436,10 @@ var linkedListTyped = (() => {
4241
4436
 
4242
4437
 
4243
4438
 
4439
+
4440
+
4441
+
4442
+
4244
4443
 
4245
4444
 
4246
4445
 
@@ -4293,6 +4492,10 @@ var linkedListTyped = (() => {
4293
4492
 
4294
4493
 
4295
4494
 
4495
+
4496
+
4497
+
4498
+
4296
4499
 
4297
4500
 
4298
4501
 
@@ -4344,6 +4547,10 @@ var linkedListTyped = (() => {
4344
4547
 
4345
4548
 
4346
4549
 
4550
+
4551
+
4552
+
4553
+
4347
4554
 
4348
4555
 
4349
4556
 
@@ -4401,6 +4608,10 @@ var linkedListTyped = (() => {
4401
4608
 
4402
4609
 
4403
4610
 
4611
+
4612
+
4613
+
4614
+
4404
4615
 
4405
4616
 
4406
4617
 
@@ -4466,6 +4677,10 @@ var linkedListTyped = (() => {
4466
4677
 
4467
4678
 
4468
4679
 
4680
+
4681
+
4682
+
4683
+
4469
4684
 
4470
4685
 
4471
4686
 
@@ -4515,6 +4730,10 @@ var linkedListTyped = (() => {
4515
4730
 
4516
4731
 
4517
4732
 
4733
+
4734
+
4735
+
4736
+
4518
4737
 
4519
4738
 
4520
4739