singly-linked-list-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/singly-linked-list-typed.js +315 -0
  41. package/dist/umd/singly-linked-list-typed.js.map +1 -1
  42. package/dist/umd/singly-linked-list-typed.min.js +1 -1
  43. package/dist/umd/singly-linked-list-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
@@ -740,6 +740,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
740
740
 
741
741
 
742
742
 
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
743
764
  * @example
744
765
  * // basic SinglyLinkedList creation and push operation
745
766
  * // Create a simple SinglyLinkedList with initial values
@@ -783,6 +804,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
783
804
 
784
805
 
785
806
 
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
786
828
  * @example
787
829
  * // SinglyLinkedList pop and shift operations
788
830
  * const list = new SinglyLinkedList<number>([10, 20, 30, 40, 50]);
@@ -831,6 +873,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
831
873
 
832
874
 
833
875
 
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
834
897
  * @example
835
898
  * // Remove from the front
836
899
  * const list = new SinglyLinkedList<number>([10, 20, 30]);
@@ -861,6 +924,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
861
924
 
862
925
 
863
926
 
927
+
928
+
929
+
930
+
931
+
932
+
933
+
934
+
935
+
936
+
937
+
938
+
939
+
940
+
941
+
942
+
943
+
944
+
945
+
946
+
947
+
864
948
  * @example
865
949
  * // SinglyLinkedList unshift and forward traversal
866
950
  * const list = new SinglyLinkedList<number>([20, 30, 40]);
@@ -952,6 +1036,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
952
1036
 
953
1037
 
954
1038
 
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+
1059
+
955
1060
  * @example
956
1061
  * // Access element by index
957
1062
  * const list = new SinglyLinkedList<string>(['a', 'b', 'c', 'd']);
@@ -987,6 +1092,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
987
1092
 
988
1093
 
989
1094
 
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
990
1116
  * @example
991
1117
  * // Get node at index
992
1118
  * const list = new SinglyLinkedList<string>(['a', 'b', 'c']);
@@ -1011,6 +1137,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1011
1137
 
1012
1138
 
1013
1139
 
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1014
1161
  * @example
1015
1162
  * // Remove by index
1016
1163
  * const list = new SinglyLinkedList<string>(['a', 'b', 'c']);
@@ -1041,6 +1188,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1041
1188
 
1042
1189
 
1043
1190
 
1191
+
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1044
1212
  * @example
1045
1213
  * // Remove first occurrence
1046
1214
  * const list = new SinglyLinkedList<number>([1, 2, 3, 2]);
@@ -1076,6 +1244,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1076
1244
 
1077
1245
 
1078
1246
 
1247
+
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+
1267
+
1079
1268
  * @example
1080
1269
  * // Insert at index
1081
1270
  * const list = new SinglyLinkedList<number>([1, 3]);
@@ -1119,6 +1308,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1119
1308
 
1120
1309
 
1121
1310
 
1311
+
1312
+
1313
+
1314
+
1315
+
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1122
1332
  * @example
1123
1333
  * // Check empty
1124
1334
  * console.log(new SinglyLinkedList().isEmpty()); // true;
@@ -1139,6 +1349,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1139
1349
 
1140
1350
 
1141
1351
 
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+
1369
+
1370
+
1371
+
1372
+
1142
1373
  * @example
1143
1374
  * // Remove all
1144
1375
  * const list = new SinglyLinkedList<number>([1, 2, 3]);
@@ -1165,6 +1396,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1165
1396
 
1166
1397
 
1167
1398
 
1399
+
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+
1168
1420
  * @example
1169
1421
  * // Reverse the list in-place
1170
1422
  * const list = new SinglyLinkedList<number>([1, 2, 3, 4]);
@@ -1357,6 +1609,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1357
1609
 
1358
1610
 
1359
1611
 
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+
1628
+
1629
+
1630
+
1631
+
1632
+
1360
1633
  * @example
1361
1634
  * // Deep copy
1362
1635
  * const list = new SinglyLinkedList<number>([1, 2, 3]);
@@ -1387,6 +1660,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1387
1660
 
1388
1661
 
1389
1662
 
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+
1680
+
1681
+
1682
+
1683
+
1390
1684
  * @example
1391
1685
  * // SinglyLinkedList filter and map operations
1392
1686
  * const list = new SinglyLinkedList<number>([1, 2, 3, 4, 5]);
@@ -1445,6 +1739,27 @@ var SinglyLinkedList = class extends LinearLinkedBase {
1445
1739
 
1446
1740
 
1447
1741
 
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+
1754
+
1755
+
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1448
1763
  * @example
1449
1764
  * // Transform elements
1450
1765
  * const list = new SinglyLinkedList<number>([1, 2, 3]);