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.
- package/dist/cjs/index.cjs +1060 -10
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +1060 -10
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1060 -10
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +1060 -10
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/base/index.d.ts +1 -0
- package/dist/types/data-structures/base/iterable-entry-base.d.ts +8 -8
- package/dist/types/data-structures/base/linear-base.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +252 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +294 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +527 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +505 -1
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +399 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +126 -1
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +2881 -382
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2867 -347
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2328 -312
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +2671 -277
- package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
- package/dist/types/data-structures/graph/directed-graph.d.ts +210 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +189 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +241 -10
- package/dist/types/data-structures/heap/heap.d.ts +294 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +360 -3
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +318 -3
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +380 -2
- package/dist/types/data-structures/matrix/matrix.d.ts +168 -0
- package/dist/types/data-structures/queue/deque.d.ts +319 -4
- package/dist/types/data-structures/queue/queue.d.ts +252 -0
- package/dist/types/data-structures/stack/stack.d.ts +210 -0
- package/dist/types/data-structures/trie/trie.d.ts +256 -4
- package/dist/types/interfaces/graph.d.ts +1 -1
- package/dist/types/types/common.d.ts +2 -2
- package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/types/types/utils/validate-type.d.ts +4 -4
- package/dist/umd/linked-list-typed.js +1060 -10
- package/dist/umd/linked-list-typed.js.map +1 -1
- package/dist/umd/linked-list-typed.min.js +1 -1
- package/dist/umd/linked-list-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/data-structures/base/index.ts +1 -0
- package/src/data-structures/base/iterable-entry-base.ts +8 -8
- package/src/data-structures/base/linear-base.ts +3 -3
- package/src/data-structures/binary-tree/avl-tree.ts +252 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +295 -1
- package/src/data-structures/binary-tree/binary-tree.ts +527 -2
- package/src/data-structures/binary-tree/bst.ts +505 -1
- package/src/data-structures/binary-tree/red-black-tree.ts +399 -0
- package/src/data-structures/binary-tree/segment-tree.ts +127 -2
- package/src/data-structures/binary-tree/tree-map.ts +2958 -459
- package/src/data-structures/binary-tree/tree-multi-map.ts +3069 -549
- package/src/data-structures/binary-tree/tree-multi-set.ts +2476 -460
- package/src/data-structures/binary-tree/tree-set.ts +2816 -422
- package/src/data-structures/graph/abstract-graph.ts +4 -4
- package/src/data-structures/graph/directed-graph.ts +210 -0
- package/src/data-structures/graph/undirected-graph.ts +189 -0
- package/src/data-structures/hash/hash-map.ts +246 -15
- package/src/data-structures/heap/heap.ts +294 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +360 -3
- package/src/data-structures/linked-list/singly-linked-list.ts +318 -3
- package/src/data-structures/linked-list/skip-linked-list.ts +380 -2
- package/src/data-structures/matrix/matrix.ts +169 -1
- package/src/data-structures/queue/deque.ts +320 -5
- package/src/data-structures/queue/queue.ts +252 -0
- package/src/data-structures/stack/stack.ts +210 -0
- package/src/data-structures/trie/trie.ts +257 -5
- package/src/interfaces/graph.ts +1 -1
- package/src/types/common.ts +2 -2
- package/src/types/data-structures/heap/heap.ts +1 -0
- package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
- package/src/types/utils/validate-type.ts +4 -4
|
@@ -762,6 +762,27 @@ var linkedListTyped = (() => {
|
|
|
762
762
|
|
|
763
763
|
|
|
764
764
|
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
765
786
|
* @example
|
|
766
787
|
* // basic SinglyLinkedList creation and push operation
|
|
767
788
|
* // Create a simple SinglyLinkedList with initial values
|
|
@@ -805,6 +826,27 @@ var linkedListTyped = (() => {
|
|
|
805
826
|
|
|
806
827
|
|
|
807
828
|
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
808
850
|
* @example
|
|
809
851
|
* // SinglyLinkedList pop and shift operations
|
|
810
852
|
* const list = new SinglyLinkedList<number>([10, 20, 30, 40, 50]);
|
|
@@ -854,6 +896,27 @@ var linkedListTyped = (() => {
|
|
|
854
896
|
|
|
855
897
|
|
|
856
898
|
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
857
920
|
* @example
|
|
858
921
|
* // Remove from the front
|
|
859
922
|
* const list = new SinglyLinkedList<number>([10, 20, 30]);
|
|
@@ -884,6 +947,27 @@ var linkedListTyped = (() => {
|
|
|
884
947
|
|
|
885
948
|
|
|
886
949
|
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
|
|
887
971
|
* @example
|
|
888
972
|
* // SinglyLinkedList unshift and forward traversal
|
|
889
973
|
* const list = new SinglyLinkedList<number>([20, 30, 40]);
|
|
@@ -975,6 +1059,27 @@ var linkedListTyped = (() => {
|
|
|
975
1059
|
|
|
976
1060
|
|
|
977
1061
|
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
978
1083
|
* @example
|
|
979
1084
|
* // Access element by index
|
|
980
1085
|
* const list = new SinglyLinkedList<string>(['a', 'b', 'c', 'd']);
|
|
@@ -1010,6 +1115,27 @@ var linkedListTyped = (() => {
|
|
|
1010
1115
|
|
|
1011
1116
|
|
|
1012
1117
|
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
|
|
1013
1139
|
* @example
|
|
1014
1140
|
* // Get node at index
|
|
1015
1141
|
* const list = new SinglyLinkedList<string>(['a', 'b', 'c']);
|
|
@@ -1034,6 +1160,27 @@ var linkedListTyped = (() => {
|
|
|
1034
1160
|
|
|
1035
1161
|
|
|
1036
1162
|
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
|
|
1037
1184
|
* @example
|
|
1038
1185
|
* // Remove by index
|
|
1039
1186
|
* const list = new SinglyLinkedList<string>(['a', 'b', 'c']);
|
|
@@ -1064,6 +1211,27 @@ var linkedListTyped = (() => {
|
|
|
1064
1211
|
|
|
1065
1212
|
|
|
1066
1213
|
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
|
|
1067
1235
|
* @example
|
|
1068
1236
|
* // Remove first occurrence
|
|
1069
1237
|
* const list = new SinglyLinkedList<number>([1, 2, 3, 2]);
|
|
@@ -1099,6 +1267,27 @@ var linkedListTyped = (() => {
|
|
|
1099
1267
|
|
|
1100
1268
|
|
|
1101
1269
|
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
|
|
1102
1291
|
* @example
|
|
1103
1292
|
* // Insert at index
|
|
1104
1293
|
* const list = new SinglyLinkedList<number>([1, 3]);
|
|
@@ -1142,6 +1331,27 @@ var linkedListTyped = (() => {
|
|
|
1142
1331
|
|
|
1143
1332
|
|
|
1144
1333
|
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1145
1355
|
* @example
|
|
1146
1356
|
* // Check empty
|
|
1147
1357
|
* console.log(new SinglyLinkedList().isEmpty()); // true;
|
|
@@ -1162,6 +1372,27 @@ var linkedListTyped = (() => {
|
|
|
1162
1372
|
|
|
1163
1373
|
|
|
1164
1374
|
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
|
|
1165
1396
|
* @example
|
|
1166
1397
|
* // Remove all
|
|
1167
1398
|
* const list = new SinglyLinkedList<number>([1, 2, 3]);
|
|
@@ -1188,6 +1419,27 @@ var linkedListTyped = (() => {
|
|
|
1188
1419
|
|
|
1189
1420
|
|
|
1190
1421
|
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
|
|
1191
1443
|
* @example
|
|
1192
1444
|
* // Reverse the list in-place
|
|
1193
1445
|
* const list = new SinglyLinkedList<number>([1, 2, 3, 4]);
|
|
@@ -1380,10 +1632,31 @@ var linkedListTyped = (() => {
|
|
|
1380
1632
|
|
|
1381
1633
|
|
|
1382
1634
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
* @example
|
|
1657
|
+
* // Deep copy
|
|
1658
|
+
* const list = new SinglyLinkedList<number>([1, 2, 3]);
|
|
1659
|
+
* const copy = list.clone();
|
|
1387
1660
|
* copy.pop();
|
|
1388
1661
|
* console.log(list.length); // 3;
|
|
1389
1662
|
* console.log(copy.length); // 2;
|
|
@@ -1410,6 +1683,27 @@ var linkedListTyped = (() => {
|
|
|
1410
1683
|
|
|
1411
1684
|
|
|
1412
1685
|
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
|
|
1413
1707
|
* @example
|
|
1414
1708
|
* // SinglyLinkedList filter and map operations
|
|
1415
1709
|
* const list = new SinglyLinkedList<number>([1, 2, 3, 4, 5]);
|
|
@@ -1468,6 +1762,27 @@ var linkedListTyped = (() => {
|
|
|
1468
1762
|
|
|
1469
1763
|
|
|
1470
1764
|
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
|
|
1471
1786
|
* @example
|
|
1472
1787
|
* // Transform elements
|
|
1473
1788
|
* const list = new SinglyLinkedList<number>([1, 2, 3]);
|
|
@@ -1759,6 +2074,27 @@ var linkedListTyped = (() => {
|
|
|
1759
2074
|
|
|
1760
2075
|
|
|
1761
2076
|
|
|
2077
|
+
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
|
|
1762
2098
|
* @example
|
|
1763
2099
|
* // basic DoublyLinkedList creation and push operation
|
|
1764
2100
|
* // Create a simple DoublyLinkedList with initial values
|
|
@@ -1804,6 +2140,27 @@ var linkedListTyped = (() => {
|
|
|
1804
2140
|
|
|
1805
2141
|
|
|
1806
2142
|
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
|
|
1807
2164
|
* @example
|
|
1808
2165
|
* // DoublyLinkedList pop and shift operations
|
|
1809
2166
|
* const list = new DoublyLinkedList<number>([10, 20, 30, 40, 50]);
|
|
@@ -1848,6 +2205,27 @@ var linkedListTyped = (() => {
|
|
|
1848
2205
|
|
|
1849
2206
|
|
|
1850
2207
|
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
|
|
1851
2229
|
* @example
|
|
1852
2230
|
* // Remove from the front
|
|
1853
2231
|
* const list = new DoublyLinkedList<number>([10, 20, 30]);
|
|
@@ -1883,6 +2261,27 @@ var linkedListTyped = (() => {
|
|
|
1883
2261
|
|
|
1884
2262
|
|
|
1885
2263
|
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
|
|
1886
2285
|
* @example
|
|
1887
2286
|
* // Add to the front
|
|
1888
2287
|
* const list = new DoublyLinkedList<number>([2, 3]);
|
|
@@ -1947,6 +2346,27 @@ var linkedListTyped = (() => {
|
|
|
1947
2346
|
|
|
1948
2347
|
|
|
1949
2348
|
|
|
2349
|
+
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
|
|
2359
|
+
|
|
2360
|
+
|
|
2361
|
+
|
|
2362
|
+
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
|
|
2369
|
+
|
|
1950
2370
|
* @example
|
|
1951
2371
|
* // Access by index
|
|
1952
2372
|
* const list = new DoublyLinkedList<string>(['a', 'b', 'c']);
|
|
@@ -1972,6 +2392,27 @@ var linkedListTyped = (() => {
|
|
|
1972
2392
|
|
|
1973
2393
|
|
|
1974
2394
|
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
|
|
2409
|
+
|
|
2410
|
+
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
|
|
2415
|
+
|
|
1975
2416
|
* @example
|
|
1976
2417
|
* // Get node at index
|
|
1977
2418
|
* const list = new DoublyLinkedList<string>(['a', 'b', 'c']);
|
|
@@ -2028,6 +2469,27 @@ var linkedListTyped = (() => {
|
|
|
2028
2469
|
|
|
2029
2470
|
|
|
2030
2471
|
|
|
2472
|
+
|
|
2473
|
+
|
|
2474
|
+
|
|
2475
|
+
|
|
2476
|
+
|
|
2477
|
+
|
|
2478
|
+
|
|
2479
|
+
|
|
2480
|
+
|
|
2481
|
+
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
|
|
2492
|
+
|
|
2031
2493
|
* @example
|
|
2032
2494
|
* // Insert at position
|
|
2033
2495
|
* const list = new DoublyLinkedList<number>([1, 3]);
|
|
@@ -2112,6 +2574,27 @@ var linkedListTyped = (() => {
|
|
|
2112
2574
|
|
|
2113
2575
|
|
|
2114
2576
|
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
|
|
2588
|
+
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
|
|
2593
|
+
|
|
2594
|
+
|
|
2595
|
+
|
|
2596
|
+
|
|
2597
|
+
|
|
2115
2598
|
* @example
|
|
2116
2599
|
* // Remove by index
|
|
2117
2600
|
* const list = new DoublyLinkedList<string>(['a', 'b', 'c']);
|
|
@@ -2143,6 +2626,27 @@ var linkedListTyped = (() => {
|
|
|
2143
2626
|
|
|
2144
2627
|
|
|
2145
2628
|
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
|
|
2635
|
+
|
|
2636
|
+
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
|
|
2641
|
+
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
|
|
2646
|
+
|
|
2647
|
+
|
|
2648
|
+
|
|
2649
|
+
|
|
2146
2650
|
* @example
|
|
2147
2651
|
* // Remove first occurrence
|
|
2148
2652
|
* const list = new DoublyLinkedList<number>([1, 2, 3, 2]);
|
|
@@ -2176,6 +2680,27 @@ var linkedListTyped = (() => {
|
|
|
2176
2680
|
|
|
2177
2681
|
|
|
2178
2682
|
|
|
2683
|
+
|
|
2684
|
+
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
|
|
2694
|
+
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
|
|
2703
|
+
|
|
2179
2704
|
* @example
|
|
2180
2705
|
* // Check empty
|
|
2181
2706
|
* console.log(new DoublyLinkedList().isEmpty()); // true;
|
|
@@ -2196,6 +2721,27 @@ var linkedListTyped = (() => {
|
|
|
2196
2721
|
|
|
2197
2722
|
|
|
2198
2723
|
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
|
|
2736
|
+
|
|
2737
|
+
|
|
2738
|
+
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
|
|
2199
2745
|
* @example
|
|
2200
2746
|
* // Remove all
|
|
2201
2747
|
* const list = new DoublyLinkedList<number>([1, 2]);
|
|
@@ -2220,6 +2766,27 @@ var linkedListTyped = (() => {
|
|
|
2220
2766
|
|
|
2221
2767
|
|
|
2222
2768
|
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
|
|
2783
|
+
|
|
2784
|
+
|
|
2785
|
+
|
|
2786
|
+
|
|
2787
|
+
|
|
2788
|
+
|
|
2789
|
+
|
|
2223
2790
|
* @example
|
|
2224
2791
|
* // Search with predicate
|
|
2225
2792
|
* const list = new DoublyLinkedList<number>([10, 20, 30]);
|
|
@@ -2248,6 +2815,27 @@ var linkedListTyped = (() => {
|
|
|
2248
2815
|
|
|
2249
2816
|
|
|
2250
2817
|
|
|
2818
|
+
|
|
2819
|
+
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
|
|
2823
|
+
|
|
2824
|
+
|
|
2825
|
+
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
|
|
2833
|
+
|
|
2834
|
+
|
|
2835
|
+
|
|
2836
|
+
|
|
2837
|
+
|
|
2838
|
+
|
|
2251
2839
|
* @example
|
|
2252
2840
|
* // Find value scanning from tail
|
|
2253
2841
|
* const list = new DoublyLinkedList<number>([1, 2, 3, 4]);
|
|
@@ -2279,6 +2867,27 @@ var linkedListTyped = (() => {
|
|
|
2279
2867
|
|
|
2280
2868
|
|
|
2281
2869
|
|
|
2870
|
+
|
|
2871
|
+
|
|
2872
|
+
|
|
2873
|
+
|
|
2874
|
+
|
|
2875
|
+
|
|
2876
|
+
|
|
2877
|
+
|
|
2878
|
+
|
|
2879
|
+
|
|
2880
|
+
|
|
2881
|
+
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
|
|
2885
|
+
|
|
2886
|
+
|
|
2887
|
+
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
|
+
|
|
2282
2891
|
* @example
|
|
2283
2892
|
* // Reverse in-place
|
|
2284
2893
|
* const list = new DoublyLinkedList<number>([1, 2, 3]);
|
|
@@ -2318,6 +2927,27 @@ var linkedListTyped = (() => {
|
|
|
2318
2927
|
|
|
2319
2928
|
|
|
2320
2929
|
|
|
2930
|
+
|
|
2931
|
+
|
|
2932
|
+
|
|
2933
|
+
|
|
2934
|
+
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
|
|
2938
|
+
|
|
2939
|
+
|
|
2940
|
+
|
|
2941
|
+
|
|
2942
|
+
|
|
2943
|
+
|
|
2944
|
+
|
|
2945
|
+
|
|
2946
|
+
|
|
2947
|
+
|
|
2948
|
+
|
|
2949
|
+
|
|
2950
|
+
|
|
2321
2951
|
* @example
|
|
2322
2952
|
* // Deep copy
|
|
2323
2953
|
* const list = new DoublyLinkedList<number>([1, 2, 3]);
|
|
@@ -2347,6 +2977,27 @@ var linkedListTyped = (() => {
|
|
|
2347
2977
|
|
|
2348
2978
|
|
|
2349
2979
|
|
|
2980
|
+
|
|
2981
|
+
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
|
|
2350
3001
|
* @example
|
|
2351
3002
|
* // Filter elements
|
|
2352
3003
|
* const list = new DoublyLinkedList<number>([1, 2, 3, 4, 5]);
|
|
@@ -2395,6 +3046,27 @@ var linkedListTyped = (() => {
|
|
|
2395
3046
|
|
|
2396
3047
|
|
|
2397
3048
|
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
|
|
3062
|
+
|
|
3063
|
+
|
|
3064
|
+
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
|
|
3068
|
+
|
|
3069
|
+
|
|
2398
3070
|
* @example
|
|
2399
3071
|
* // DoublyLinkedList for...of iteration and map operation
|
|
2400
3072
|
* const list = new DoublyLinkedList<number>([1, 2, 3, 4, 5]);
|
|
@@ -2812,6 +3484,27 @@ var linkedListTyped = (() => {
|
|
|
2812
3484
|
|
|
2813
3485
|
|
|
2814
3486
|
|
|
3487
|
+
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
|
|
3491
|
+
|
|
3492
|
+
|
|
3493
|
+
|
|
3494
|
+
|
|
3495
|
+
|
|
3496
|
+
|
|
3497
|
+
|
|
3498
|
+
|
|
3499
|
+
|
|
3500
|
+
|
|
3501
|
+
|
|
3502
|
+
|
|
3503
|
+
|
|
3504
|
+
|
|
3505
|
+
|
|
3506
|
+
|
|
3507
|
+
|
|
2815
3508
|
* @example
|
|
2816
3509
|
* // Check if empty
|
|
2817
3510
|
* const sl = new SkipList<number, string>();
|
|
@@ -2830,6 +3523,27 @@ var linkedListTyped = (() => {
|
|
|
2830
3523
|
|
|
2831
3524
|
|
|
2832
3525
|
|
|
3526
|
+
|
|
3527
|
+
|
|
3528
|
+
|
|
3529
|
+
|
|
3530
|
+
|
|
3531
|
+
|
|
3532
|
+
|
|
3533
|
+
|
|
3534
|
+
|
|
3535
|
+
|
|
3536
|
+
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
|
|
3546
|
+
|
|
2833
3547
|
* @example
|
|
2834
3548
|
* // Remove all entries
|
|
2835
3549
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b']]);
|
|
@@ -2851,6 +3565,27 @@ var linkedListTyped = (() => {
|
|
|
2851
3565
|
|
|
2852
3566
|
|
|
2853
3567
|
|
|
3568
|
+
|
|
3569
|
+
|
|
3570
|
+
|
|
3571
|
+
|
|
3572
|
+
|
|
3573
|
+
|
|
3574
|
+
|
|
3575
|
+
|
|
3576
|
+
|
|
3577
|
+
|
|
3578
|
+
|
|
3579
|
+
|
|
3580
|
+
|
|
3581
|
+
|
|
3582
|
+
|
|
3583
|
+
|
|
3584
|
+
|
|
3585
|
+
|
|
3586
|
+
|
|
3587
|
+
|
|
3588
|
+
|
|
2854
3589
|
* @example
|
|
2855
3590
|
* // Create independent copy
|
|
2856
3591
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b']]);
|
|
@@ -2880,6 +3615,27 @@ var linkedListTyped = (() => {
|
|
|
2880
3615
|
|
|
2881
3616
|
|
|
2882
3617
|
|
|
3618
|
+
|
|
3619
|
+
|
|
3620
|
+
|
|
3621
|
+
|
|
3622
|
+
|
|
3623
|
+
|
|
3624
|
+
|
|
3625
|
+
|
|
3626
|
+
|
|
3627
|
+
|
|
3628
|
+
|
|
3629
|
+
|
|
3630
|
+
|
|
3631
|
+
|
|
3632
|
+
|
|
3633
|
+
|
|
3634
|
+
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
|
|
3638
|
+
|
|
2883
3639
|
* @example
|
|
2884
3640
|
* // In-memory sorted key-value store
|
|
2885
3641
|
* const store = new SkipList<number, string>();
|
|
@@ -2934,17 +3690,38 @@ var linkedListTyped = (() => {
|
|
|
2934
3690
|
|
|
2935
3691
|
|
|
2936
3692
|
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
3693
|
+
|
|
3694
|
+
|
|
3695
|
+
|
|
3696
|
+
|
|
3697
|
+
|
|
3698
|
+
|
|
3699
|
+
|
|
3700
|
+
|
|
3701
|
+
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
|
|
3706
|
+
|
|
3707
|
+
|
|
3708
|
+
|
|
3709
|
+
|
|
3710
|
+
|
|
3711
|
+
|
|
3712
|
+
|
|
3713
|
+
|
|
3714
|
+
* @example
|
|
3715
|
+
* // Building a sorted index
|
|
3716
|
+
* type Product = { id: number; name: string; price: number };
|
|
3717
|
+
* const products: Product[] = [
|
|
2941
3718
|
* { id: 1, name: 'Widget', price: 25 },
|
|
2942
3719
|
* { id: 2, name: 'Gadget', price: 50 },
|
|
2943
3720
|
* { id: 3, name: 'Doohickey', price: 15 }
|
|
2944
3721
|
* ];
|
|
2945
3722
|
*
|
|
2946
|
-
* const index = new SkipList<number, Product>(products
|
|
2947
|
-
* toEntryFn: (p:
|
|
3723
|
+
* const index = new SkipList<number, Product, Product>(products, {
|
|
3724
|
+
* toEntryFn: (p: Product) => [p.price, p]
|
|
2948
3725
|
* });
|
|
2949
3726
|
*
|
|
2950
3727
|
* // Iterate in sorted order by price
|
|
@@ -2973,6 +3750,27 @@ var linkedListTyped = (() => {
|
|
|
2973
3750
|
|
|
2974
3751
|
|
|
2975
3752
|
|
|
3753
|
+
|
|
3754
|
+
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
|
+
|
|
3760
|
+
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
|
|
3764
|
+
|
|
3765
|
+
|
|
3766
|
+
|
|
3767
|
+
|
|
3768
|
+
|
|
3769
|
+
|
|
3770
|
+
|
|
3771
|
+
|
|
3772
|
+
|
|
3773
|
+
|
|
2976
3774
|
* @example
|
|
2977
3775
|
* // Check key existence
|
|
2978
3776
|
* const sl = new SkipList<number, string>([[1, 'a'], [3, 'c'], [5, 'e']]);
|
|
@@ -2995,6 +3793,27 @@ var linkedListTyped = (() => {
|
|
|
2995
3793
|
|
|
2996
3794
|
|
|
2997
3795
|
|
|
3796
|
+
|
|
3797
|
+
|
|
3798
|
+
|
|
3799
|
+
|
|
3800
|
+
|
|
3801
|
+
|
|
3802
|
+
|
|
3803
|
+
|
|
3804
|
+
|
|
3805
|
+
|
|
3806
|
+
|
|
3807
|
+
|
|
3808
|
+
|
|
3809
|
+
|
|
3810
|
+
|
|
3811
|
+
|
|
3812
|
+
|
|
3813
|
+
|
|
3814
|
+
|
|
3815
|
+
|
|
3816
|
+
|
|
2998
3817
|
* @example
|
|
2999
3818
|
* // Fast lookup with deletion
|
|
3000
3819
|
* const cache = new SkipList<string, number>();
|
|
@@ -3037,6 +3856,27 @@ var linkedListTyped = (() => {
|
|
|
3037
3856
|
|
|
3038
3857
|
|
|
3039
3858
|
|
|
3859
|
+
|
|
3860
|
+
|
|
3861
|
+
|
|
3862
|
+
|
|
3863
|
+
|
|
3864
|
+
|
|
3865
|
+
|
|
3866
|
+
|
|
3867
|
+
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
|
|
3871
|
+
|
|
3872
|
+
|
|
3873
|
+
|
|
3874
|
+
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
|
|
3878
|
+
|
|
3879
|
+
|
|
3040
3880
|
* @example
|
|
3041
3881
|
* // Access the minimum entry
|
|
3042
3882
|
* const sl = new SkipList<number, string>([[5, 'e'], [1, 'a'], [3, 'c']]);
|
|
@@ -3059,6 +3899,27 @@ var linkedListTyped = (() => {
|
|
|
3059
3899
|
|
|
3060
3900
|
|
|
3061
3901
|
|
|
3902
|
+
|
|
3903
|
+
|
|
3904
|
+
|
|
3905
|
+
|
|
3906
|
+
|
|
3907
|
+
|
|
3908
|
+
|
|
3909
|
+
|
|
3910
|
+
|
|
3911
|
+
|
|
3912
|
+
|
|
3913
|
+
|
|
3914
|
+
|
|
3915
|
+
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
|
|
3919
|
+
|
|
3920
|
+
|
|
3921
|
+
|
|
3922
|
+
|
|
3062
3923
|
* @example
|
|
3063
3924
|
* // Access the maximum entry
|
|
3064
3925
|
* const sl = new SkipList<number, string>([[5, 'e'], [1, 'a'], [3, 'c']]);
|
|
@@ -3083,6 +3944,27 @@ var linkedListTyped = (() => {
|
|
|
3083
3944
|
|
|
3084
3945
|
|
|
3085
3946
|
|
|
3947
|
+
|
|
3948
|
+
|
|
3949
|
+
|
|
3950
|
+
|
|
3951
|
+
|
|
3952
|
+
|
|
3953
|
+
|
|
3954
|
+
|
|
3955
|
+
|
|
3956
|
+
|
|
3957
|
+
|
|
3958
|
+
|
|
3959
|
+
|
|
3960
|
+
|
|
3961
|
+
|
|
3962
|
+
|
|
3963
|
+
|
|
3964
|
+
|
|
3965
|
+
|
|
3966
|
+
|
|
3967
|
+
|
|
3086
3968
|
* @example
|
|
3087
3969
|
* // Remove and return smallest
|
|
3088
3970
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b'], [3, 'c']]);
|
|
@@ -3105,6 +3987,27 @@ var linkedListTyped = (() => {
|
|
|
3105
3987
|
|
|
3106
3988
|
|
|
3107
3989
|
|
|
3990
|
+
|
|
3991
|
+
|
|
3992
|
+
|
|
3993
|
+
|
|
3994
|
+
|
|
3995
|
+
|
|
3996
|
+
|
|
3997
|
+
|
|
3998
|
+
|
|
3999
|
+
|
|
4000
|
+
|
|
4001
|
+
|
|
4002
|
+
|
|
4003
|
+
|
|
4004
|
+
|
|
4005
|
+
|
|
4006
|
+
|
|
4007
|
+
|
|
4008
|
+
|
|
4009
|
+
|
|
4010
|
+
|
|
3108
4011
|
* @example
|
|
3109
4012
|
* // Remove and return largest
|
|
3110
4013
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b'], [3, 'c']]);
|
|
@@ -3130,6 +4033,27 @@ var linkedListTyped = (() => {
|
|
|
3130
4033
|
|
|
3131
4034
|
|
|
3132
4035
|
|
|
4036
|
+
|
|
4037
|
+
|
|
4038
|
+
|
|
4039
|
+
|
|
4040
|
+
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
|
|
4055
|
+
|
|
4056
|
+
|
|
3133
4057
|
* @example
|
|
3134
4058
|
* // Least entry ≥ key
|
|
3135
4059
|
* const sl = new SkipList<number, string>([[10, 'a'], [20, 'b'], [30, 'c']]);
|
|
@@ -3160,6 +4084,27 @@ var linkedListTyped = (() => {
|
|
|
3160
4084
|
|
|
3161
4085
|
|
|
3162
4086
|
|
|
4087
|
+
|
|
4088
|
+
|
|
4089
|
+
|
|
4090
|
+
|
|
4091
|
+
|
|
4092
|
+
|
|
4093
|
+
|
|
4094
|
+
|
|
4095
|
+
|
|
4096
|
+
|
|
4097
|
+
|
|
4098
|
+
|
|
4099
|
+
|
|
4100
|
+
|
|
4101
|
+
|
|
4102
|
+
|
|
4103
|
+
|
|
4104
|
+
|
|
4105
|
+
|
|
4106
|
+
|
|
4107
|
+
|
|
3163
4108
|
* @example
|
|
3164
4109
|
* // Greatest entry ≤ key
|
|
3165
4110
|
* const sl = new SkipList<number, string>([[10, 'a'], [20, 'b'], [30, 'c']]);
|
|
@@ -3188,6 +4133,27 @@ var linkedListTyped = (() => {
|
|
|
3188
4133
|
|
|
3189
4134
|
|
|
3190
4135
|
|
|
4136
|
+
|
|
4137
|
+
|
|
4138
|
+
|
|
4139
|
+
|
|
4140
|
+
|
|
4141
|
+
|
|
4142
|
+
|
|
4143
|
+
|
|
4144
|
+
|
|
4145
|
+
|
|
4146
|
+
|
|
4147
|
+
|
|
4148
|
+
|
|
4149
|
+
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
|
+
|
|
4153
|
+
|
|
4154
|
+
|
|
4155
|
+
|
|
4156
|
+
|
|
3191
4157
|
* @example
|
|
3192
4158
|
* // Strictly greater entry
|
|
3193
4159
|
* const sl = new SkipList<number, string>([[10, 'a'], [20, 'b'], [30, 'c']]);
|
|
@@ -3215,6 +4181,27 @@ var linkedListTyped = (() => {
|
|
|
3215
4181
|
|
|
3216
4182
|
|
|
3217
4183
|
|
|
4184
|
+
|
|
4185
|
+
|
|
4186
|
+
|
|
4187
|
+
|
|
4188
|
+
|
|
4189
|
+
|
|
4190
|
+
|
|
4191
|
+
|
|
4192
|
+
|
|
4193
|
+
|
|
4194
|
+
|
|
4195
|
+
|
|
4196
|
+
|
|
4197
|
+
|
|
4198
|
+
|
|
4199
|
+
|
|
4200
|
+
|
|
4201
|
+
|
|
4202
|
+
|
|
4203
|
+
|
|
4204
|
+
|
|
3218
4205
|
* @example
|
|
3219
4206
|
* // Strictly less entry
|
|
3220
4207
|
* const sl = new SkipList<number, string>([[10, 'a'], [20, 'b'], [30, 'c']]);
|
|
@@ -3248,6 +4235,27 @@ var linkedListTyped = (() => {
|
|
|
3248
4235
|
|
|
3249
4236
|
|
|
3250
4237
|
|
|
4238
|
+
|
|
4239
|
+
|
|
4240
|
+
|
|
4241
|
+
|
|
4242
|
+
|
|
4243
|
+
|
|
4244
|
+
|
|
4245
|
+
|
|
4246
|
+
|
|
4247
|
+
|
|
4248
|
+
|
|
4249
|
+
|
|
4250
|
+
|
|
4251
|
+
|
|
4252
|
+
|
|
4253
|
+
|
|
4254
|
+
|
|
4255
|
+
|
|
4256
|
+
|
|
4257
|
+
|
|
4258
|
+
|
|
3251
4259
|
* @example
|
|
3252
4260
|
* // Find entries in a range
|
|
3253
4261
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b'], [3, 'c'], [4, 'd'], [5, 'e']]);
|
|
@@ -3289,6 +4297,27 @@ var linkedListTyped = (() => {
|
|
|
3289
4297
|
|
|
3290
4298
|
|
|
3291
4299
|
|
|
4300
|
+
|
|
4301
|
+
|
|
4302
|
+
|
|
4303
|
+
|
|
4304
|
+
|
|
4305
|
+
|
|
4306
|
+
|
|
4307
|
+
|
|
4308
|
+
|
|
4309
|
+
|
|
4310
|
+
|
|
4311
|
+
|
|
4312
|
+
|
|
4313
|
+
|
|
4314
|
+
|
|
4315
|
+
|
|
4316
|
+
|
|
4317
|
+
|
|
4318
|
+
|
|
4319
|
+
|
|
4320
|
+
|
|
3292
4321
|
* @example
|
|
3293
4322
|
* // Transform entries
|
|
3294
4323
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b']]);
|
|
@@ -3314,6 +4343,27 @@ var linkedListTyped = (() => {
|
|
|
3314
4343
|
|
|
3315
4344
|
|
|
3316
4345
|
|
|
4346
|
+
|
|
4347
|
+
|
|
4348
|
+
|
|
4349
|
+
|
|
4350
|
+
|
|
4351
|
+
|
|
4352
|
+
|
|
4353
|
+
|
|
4354
|
+
|
|
4355
|
+
|
|
4356
|
+
|
|
4357
|
+
|
|
4358
|
+
|
|
4359
|
+
|
|
4360
|
+
|
|
4361
|
+
|
|
4362
|
+
|
|
4363
|
+
|
|
4364
|
+
|
|
4365
|
+
|
|
4366
|
+
|
|
3317
4367
|
* @example
|
|
3318
4368
|
* // Filter entries
|
|
3319
4369
|
* const sl = new SkipList<number, string>([[1, 'a'], [2, 'b'], [3, 'c']]);
|