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
@@ -564,6 +564,27 @@ var Deque = class extends LinearBase {
564
564
 
565
565
 
566
566
 
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
567
588
  * @example
568
589
  * // Deque peek at both ends
569
590
  * const deque = new Deque<number>([10, 20, 30, 40, 50]);
@@ -598,6 +619,27 @@ var Deque = class extends LinearBase {
598
619
 
599
620
 
600
621
 
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
601
643
  * @example
602
644
  * // Peek at the back element
603
645
  * const dq = new Deque<string>(['a', 'b', 'c']);
@@ -637,6 +679,27 @@ var Deque = class extends LinearBase {
637
679
 
638
680
 
639
681
 
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
640
703
  * @example
641
704
  * // basic Deque creation and push/pop operations
642
705
  * // Create a simple Deque with initial values
@@ -689,6 +752,27 @@ var Deque = class extends LinearBase {
689
752
 
690
753
 
691
754
 
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
692
776
  * @example
693
777
  * // Remove from the back
694
778
  * const dq = new Deque<number>([1, 2, 3]);
@@ -728,6 +812,27 @@ var Deque = class extends LinearBase {
728
812
 
729
813
 
730
814
 
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
731
836
  * @example
732
837
  * // Remove from the front
733
838
  * const dq = new Deque<number>([1, 2, 3]);
@@ -768,6 +873,27 @@ var Deque = class extends LinearBase {
768
873
 
769
874
 
770
875
 
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
771
897
  * @example
772
898
  * // Deque shift and unshift operations
773
899
  * const deque = new Deque<number>([20, 30, 40]);
@@ -849,6 +975,27 @@ var Deque = class extends LinearBase {
849
975
 
850
976
 
851
977
 
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
852
999
  * @example
853
1000
  * // Check if empty
854
1001
  * const dq = new Deque();
@@ -870,6 +1017,27 @@ var Deque = class extends LinearBase {
870
1017
 
871
1018
 
872
1019
 
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
873
1041
  * @example
874
1042
  * // Remove all elements
875
1043
  * const dq = new Deque<number>([1, 2, 3]);
@@ -895,6 +1063,27 @@ var Deque = class extends LinearBase {
895
1063
 
896
1064
 
897
1065
 
1066
+
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
898
1087
  * @example
899
1088
  * // Access by index
900
1089
  * const dq = new Deque<string>(['a', 'b', 'c']);
@@ -1071,6 +1260,27 @@ var Deque = class extends LinearBase {
1071
1260
 
1072
1261
 
1073
1262
 
1263
+
1264
+
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1074
1284
  * @example
1075
1285
  * // Remove element
1076
1286
  * const dq = new Deque<number>([1, 2, 3]);
@@ -1134,6 +1344,27 @@ var Deque = class extends LinearBase {
1134
1344
 
1135
1345
 
1136
1346
 
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1137
1368
  * @example
1138
1369
  * // Deque for...of iteration and reverse
1139
1370
  * const deque = new Deque<string>(['A', 'B', 'C', 'D']);
@@ -1222,6 +1453,27 @@ var Deque = class extends LinearBase {
1222
1453
 
1223
1454
 
1224
1455
 
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1225
1477
  * @example
1226
1478
  * // Reclaim memory
1227
1479
  * const dq = new Deque<number>([1, 2, 3, 4, 5]);
@@ -1269,6 +1521,27 @@ var Deque = class extends LinearBase {
1269
1521
 
1270
1522
 
1271
1523
 
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1272
1545
  * @example
1273
1546
  * // Create independent copy
1274
1547
  * const dq = new Deque<number>([1, 2, 3]);
@@ -1299,6 +1572,27 @@ var Deque = class extends LinearBase {
1299
1572
 
1300
1573
 
1301
1574
 
1575
+
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+
1593
+
1594
+
1595
+
1302
1596
  * @example
1303
1597
  * // Filter elements
1304
1598
  * const dq = new Deque<number>([1, 2, 3, 4]);
@@ -1349,6 +1643,27 @@ var Deque = class extends LinearBase {
1349
1643
 
1350
1644
 
1351
1645
 
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1352
1667
  * @example
1353
1668
  * // Transform elements
1354
1669
  * const dq = new Deque<number>([1, 2, 3]);