deque-typed 2.5.0 → 2.5.1

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 (75) hide show
  1. package/dist/cjs/index.cjs +315 -0
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +315 -0
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +315 -0
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +315 -0
  8. package/dist/esm-legacy/index.mjs.map +1 -1
  9. package/dist/types/data-structures/base/index.d.ts +1 -0
  10. package/dist/types/data-structures/base/iterable-entry-base.d.ts +8 -8
  11. package/dist/types/data-structures/base/linear-base.d.ts +3 -3
  12. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +252 -0
  13. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +294 -0
  14. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +527 -2
  15. package/dist/types/data-structures/binary-tree/bst.d.ts +505 -1
  16. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +399 -0
  17. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +126 -1
  18. package/dist/types/data-structures/binary-tree/tree-map.d.ts +2881 -382
  19. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2867 -347
  20. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2328 -312
  21. package/dist/types/data-structures/binary-tree/tree-set.d.ts +2671 -277
  22. package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
  23. package/dist/types/data-structures/graph/directed-graph.d.ts +210 -0
  24. package/dist/types/data-structures/graph/undirected-graph.d.ts +189 -0
  25. package/dist/types/data-structures/hash/hash-map.d.ts +241 -10
  26. package/dist/types/data-structures/heap/heap.d.ts +294 -0
  27. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +360 -3
  28. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +318 -3
  29. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +380 -2
  30. package/dist/types/data-structures/matrix/matrix.d.ts +168 -0
  31. package/dist/types/data-structures/queue/deque.d.ts +319 -4
  32. package/dist/types/data-structures/queue/queue.d.ts +252 -0
  33. package/dist/types/data-structures/stack/stack.d.ts +210 -0
  34. package/dist/types/data-structures/trie/trie.d.ts +256 -4
  35. package/dist/types/interfaces/graph.d.ts +1 -1
  36. package/dist/types/types/common.d.ts +2 -2
  37. package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
  38. package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  39. package/dist/types/types/utils/validate-type.d.ts +4 -4
  40. package/dist/umd/deque-typed.js +315 -0
  41. package/dist/umd/deque-typed.js.map +1 -1
  42. package/dist/umd/deque-typed.min.js +1 -1
  43. package/dist/umd/deque-typed.min.js.map +1 -1
  44. package/package.json +2 -2
  45. package/src/data-structures/base/index.ts +1 -0
  46. package/src/data-structures/base/iterable-entry-base.ts +8 -8
  47. package/src/data-structures/base/linear-base.ts +3 -3
  48. package/src/data-structures/binary-tree/avl-tree.ts +252 -0
  49. package/src/data-structures/binary-tree/binary-indexed-tree.ts +295 -1
  50. package/src/data-structures/binary-tree/binary-tree.ts +527 -2
  51. package/src/data-structures/binary-tree/bst.ts +505 -1
  52. package/src/data-structures/binary-tree/red-black-tree.ts +399 -0
  53. package/src/data-structures/binary-tree/segment-tree.ts +127 -2
  54. package/src/data-structures/binary-tree/tree-map.ts +2958 -459
  55. package/src/data-structures/binary-tree/tree-multi-map.ts +3069 -549
  56. package/src/data-structures/binary-tree/tree-multi-set.ts +2476 -460
  57. package/src/data-structures/binary-tree/tree-set.ts +2816 -422
  58. package/src/data-structures/graph/abstract-graph.ts +4 -4
  59. package/src/data-structures/graph/directed-graph.ts +210 -0
  60. package/src/data-structures/graph/undirected-graph.ts +189 -0
  61. package/src/data-structures/hash/hash-map.ts +246 -15
  62. package/src/data-structures/heap/heap.ts +294 -0
  63. package/src/data-structures/linked-list/doubly-linked-list.ts +360 -3
  64. package/src/data-structures/linked-list/singly-linked-list.ts +318 -3
  65. package/src/data-structures/linked-list/skip-linked-list.ts +380 -2
  66. package/src/data-structures/matrix/matrix.ts +169 -1
  67. package/src/data-structures/queue/deque.ts +320 -5
  68. package/src/data-structures/queue/queue.ts +252 -0
  69. package/src/data-structures/stack/stack.ts +210 -0
  70. package/src/data-structures/trie/trie.ts +257 -5
  71. package/src/interfaces/graph.ts +1 -1
  72. package/src/types/common.ts +2 -2
  73. package/src/types/data-structures/heap/heap.ts +1 -0
  74. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  75. package/src/types/utils/validate-type.ts +4 -4
@@ -566,6 +566,27 @@ var Deque = class extends LinearBase {
566
566
 
567
567
 
568
568
 
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
569
590
  * @example
570
591
  * // Deque peek at both ends
571
592
  * const deque = new Deque<number>([10, 20, 30, 40, 50]);
@@ -600,6 +621,27 @@ var Deque = class extends LinearBase {
600
621
 
601
622
 
602
623
 
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
603
645
  * @example
604
646
  * // Peek at the back element
605
647
  * const dq = new Deque<string>(['a', 'b', 'c']);
@@ -639,6 +681,27 @@ var Deque = class extends LinearBase {
639
681
 
640
682
 
641
683
 
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
642
705
  * @example
643
706
  * // basic Deque creation and push/pop operations
644
707
  * // Create a simple Deque with initial values
@@ -691,6 +754,27 @@ var Deque = class extends LinearBase {
691
754
 
692
755
 
693
756
 
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
694
778
  * @example
695
779
  * // Remove from the back
696
780
  * const dq = new Deque<number>([1, 2, 3]);
@@ -730,6 +814,27 @@ var Deque = class extends LinearBase {
730
814
 
731
815
 
732
816
 
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
733
838
  * @example
734
839
  * // Remove from the front
735
840
  * const dq = new Deque<number>([1, 2, 3]);
@@ -770,6 +875,27 @@ var Deque = class extends LinearBase {
770
875
 
771
876
 
772
877
 
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
897
+
898
+
773
899
  * @example
774
900
  * // Deque shift and unshift operations
775
901
  * const deque = new Deque<number>([20, 30, 40]);
@@ -851,6 +977,27 @@ var Deque = class extends LinearBase {
851
977
 
852
978
 
853
979
 
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
854
1001
  * @example
855
1002
  * // Check if empty
856
1003
  * const dq = new Deque();
@@ -872,6 +1019,27 @@ var Deque = class extends LinearBase {
872
1019
 
873
1020
 
874
1021
 
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
875
1043
  * @example
876
1044
  * // Remove all elements
877
1045
  * const dq = new Deque<number>([1, 2, 3]);
@@ -897,6 +1065,27 @@ var Deque = class extends LinearBase {
897
1065
 
898
1066
 
899
1067
 
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
900
1089
  * @example
901
1090
  * // Access by index
902
1091
  * const dq = new Deque<string>(['a', 'b', 'c']);
@@ -1073,6 +1262,27 @@ var Deque = class extends LinearBase {
1073
1262
 
1074
1263
 
1075
1264
 
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+
1076
1286
  * @example
1077
1287
  * // Remove element
1078
1288
  * const dq = new Deque<number>([1, 2, 3]);
@@ -1136,6 +1346,27 @@ var Deque = class extends LinearBase {
1136
1346
 
1137
1347
 
1138
1348
 
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+
1369
+
1139
1370
  * @example
1140
1371
  * // Deque for...of iteration and reverse
1141
1372
  * const deque = new Deque<string>(['A', 'B', 'C', 'D']);
@@ -1224,6 +1455,27 @@ var Deque = class extends LinearBase {
1224
1455
 
1225
1456
 
1226
1457
 
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+
1227
1479
  * @example
1228
1480
  * // Reclaim memory
1229
1481
  * const dq = new Deque<number>([1, 2, 3, 4, 5]);
@@ -1271,6 +1523,27 @@ var Deque = class extends LinearBase {
1271
1523
 
1272
1524
 
1273
1525
 
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1274
1547
  * @example
1275
1548
  * // Create independent copy
1276
1549
  * const dq = new Deque<number>([1, 2, 3]);
@@ -1301,6 +1574,27 @@ var Deque = class extends LinearBase {
1301
1574
 
1302
1575
 
1303
1576
 
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+
1593
+
1594
+
1595
+
1596
+
1597
+
1304
1598
  * @example
1305
1599
  * // Filter elements
1306
1600
  * const dq = new Deque<number>([1, 2, 3, 4]);
@@ -1351,6 +1645,27 @@ var Deque = class extends LinearBase {
1351
1645
 
1352
1646
 
1353
1647
 
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+
1354
1669
  * @example
1355
1670
  * // Transform elements
1356
1671
  * const dq = new Deque<number>([1, 2, 3]);