data-structure-typed 2.6.0 → 2.6.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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
- package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
- package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
- package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
- package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
- package/package.json +45 -46
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +0 -3
- package/src/data-structures/base/linear-base.ts +2 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -529
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
- package/src/data-structures/binary-tree/bst.ts +158 -1082
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
- package/src/data-structures/binary-tree/segment-tree.ts +73 -351
- package/src/data-structures/binary-tree/tree-map.ts +462 -5124
- package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
- package/src/data-structures/binary-tree/tree-multi-set.ts +284 -3972
- package/src/data-structures/binary-tree/tree-set.ts +338 -4836
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -562
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -511
- package/src/data-structures/hash/hash-map.ts +154 -582
- package/src/data-structures/heap/heap.ts +200 -795
- package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
- package/src/data-structures/matrix/matrix.ts +179 -518
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +214 -882
- package/src/data-structures/queue/queue.ts +102 -625
- package/src/data-structures/stack/stack.ts +76 -505
- package/src/data-structures/trie/trie.ts +98 -628
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
|
@@ -43,7 +43,7 @@ minTree.query(0, 4); // 1
|
|
|
43
43
|
iterator: IterableIterator<E>;
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
46
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:604](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L604)
|
|
47
47
|
|
|
48
48
|
Iterates over leaf values in index order.
|
|
49
49
|
|
|
@@ -65,7 +65,7 @@ Iterable.[iterator]
|
|
|
65
65
|
get(index): E;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
68
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:372](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L372)
|
|
69
69
|
|
|
70
70
|
Get element at index.
|
|
71
71
|
Time: O(1)
|
|
@@ -99,7 +99,7 @@ Time: O(1)
|
|
|
99
99
|
maxRight(left, predicate): number;
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
102
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:435](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L435)
|
|
103
103
|
|
|
104
104
|
Find the largest r such that predicate(query(left, r)) is true.
|
|
105
105
|
Returns left-1 if predicate(identity) is false.
|
|
@@ -142,7 +142,7 @@ Time: O(log n)
|
|
|
142
142
|
minLeft(right, predicate): number;
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
145
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:533](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L533)
|
|
146
146
|
|
|
147
147
|
Find the smallest l such that predicate(query(l, right)) is true.
|
|
148
148
|
Returns right+1 if predicate(identity) is false.
|
|
@@ -184,7 +184,7 @@ Time: O(log n)
|
|
|
184
184
|
query(start, end): E;
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
187
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:295](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L295)
|
|
188
188
|
|
|
189
189
|
Range query: returns merger result over [start, end] (inclusive).
|
|
190
190
|
Time: O(log n)
|
|
@@ -229,7 +229,7 @@ Time: O(log n)
|
|
|
229
229
|
update(index, value): void;
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
232
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:223](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L223)
|
|
233
233
|
|
|
234
234
|
Point update: set element at index to value.
|
|
235
235
|
Time: O(log n)
|
|
@@ -279,7 +279,7 @@ Time: O(log n)
|
|
|
279
279
|
static max(elements): SegmentTree<number>;
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
282
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L151)
|
|
283
283
|
|
|
284
284
|
Create a max segment tree.
|
|
285
285
|
|
|
@@ -308,7 +308,7 @@ st.query(1, 4); // 5
|
|
|
308
308
|
static min(elements): SegmentTree<number>;
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
Defined in: [data-structures/binary-tree/segment-tree.ts:
|
|
311
|
+
Defined in: [data-structures/binary-tree/segment-tree.ts:136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L136)
|
|
312
312
|
|
|
313
313
|
Create a min segment tree.
|
|
314
314
|
|
|
@@ -442,7 +442,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
442
442
|
addAfter(existingElementOrNode, newElementOrNode): boolean;
|
|
443
443
|
```
|
|
444
444
|
|
|
445
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
445
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1225](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1225)
|
|
446
446
|
|
|
447
447
|
Insert a new element/node after an existing one.
|
|
448
448
|
|
|
@@ -482,7 +482,7 @@ Time O(N), Space O(1)
|
|
|
482
482
|
addAt(index, newElementOrNode): boolean;
|
|
483
483
|
```
|
|
484
484
|
|
|
485
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
485
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:961](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L961)
|
|
486
486
|
|
|
487
487
|
Insert a new element/node at an index, shifting following nodes.
|
|
488
488
|
|
|
@@ -533,7 +533,7 @@ Time O(N), Space O(1)
|
|
|
533
533
|
addBefore(existingElementOrNode, newElementOrNode): boolean;
|
|
534
534
|
```
|
|
535
535
|
|
|
536
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
536
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1195)
|
|
537
537
|
|
|
538
538
|
Insert a new element/node before an existing one.
|
|
539
539
|
|
|
@@ -573,7 +573,7 @@ Time O(N), Space O(1)
|
|
|
573
573
|
at(index): E | undefined;
|
|
574
574
|
```
|
|
575
575
|
|
|
576
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
576
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:701](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L701)
|
|
577
577
|
|
|
578
578
|
Get the element at a given index.
|
|
579
579
|
|
|
@@ -619,7 +619,7 @@ Time O(N), Space O(1)
|
|
|
619
619
|
clear(): void;
|
|
620
620
|
```
|
|
621
621
|
|
|
622
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
622
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1092](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1092)
|
|
623
623
|
|
|
624
624
|
Remove all nodes and reset length.
|
|
625
625
|
|
|
@@ -656,7 +656,7 @@ Time O(N), Space O(1)
|
|
|
656
656
|
clone(): this;
|
|
657
657
|
```
|
|
658
658
|
|
|
659
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
659
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1406](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1406)
|
|
660
660
|
|
|
661
661
|
Deep clone this list (values are copied by reference).
|
|
662
662
|
|
|
@@ -695,7 +695,7 @@ Time O(N), Space O(N)
|
|
|
695
695
|
concat(...items): this;
|
|
696
696
|
```
|
|
697
697
|
|
|
698
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
698
|
+
Defined in: [data-structures/base/linear-base.ts:484](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L484)
|
|
699
699
|
|
|
700
700
|
Concatenate lists/elements preserving order.
|
|
701
701
|
|
|
@@ -731,7 +731,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
731
731
|
countOccurrences(elementOrNode): number;
|
|
732
732
|
```
|
|
733
733
|
|
|
734
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
734
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1301](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1301)
|
|
735
735
|
|
|
736
736
|
Count how many nodes match a value/node/predicate.
|
|
737
737
|
|
|
@@ -763,7 +763,7 @@ Time O(N), Space O(1)
|
|
|
763
763
|
delete(elementOrNode?): boolean;
|
|
764
764
|
```
|
|
765
765
|
|
|
766
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
766
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:892](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L892)
|
|
767
767
|
|
|
768
768
|
Delete the first match by value/node.
|
|
769
769
|
|
|
@@ -808,7 +808,7 @@ Time O(N), Space O(1)
|
|
|
808
808
|
deleteAt(index): E | undefined;
|
|
809
809
|
```
|
|
810
810
|
|
|
811
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
811
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:829](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L829)
|
|
812
812
|
|
|
813
813
|
Delete the element at an index.
|
|
814
814
|
|
|
@@ -853,7 +853,7 @@ Time O(N), Space O(1)
|
|
|
853
853
|
deleteWhere(predicate): boolean;
|
|
854
854
|
```
|
|
855
855
|
|
|
856
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
856
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1331](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1331)
|
|
857
857
|
|
|
858
858
|
Delete the first node whose value matches a predicate.
|
|
859
859
|
|
|
@@ -877,6 +877,30 @@ Time O(N), Space O(1)
|
|
|
877
877
|
|
|
878
878
|
***
|
|
879
879
|
|
|
880
|
+
### entries()
|
|
881
|
+
|
|
882
|
+
```ts
|
|
883
|
+
entries(): IterableIterator<[number, E]>;
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
Defined in: [data-structures/base/iterable-element-base.ts:208](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L208)
|
|
887
|
+
|
|
888
|
+
Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
889
|
+
|
|
890
|
+
#### Returns
|
|
891
|
+
|
|
892
|
+
`IterableIterator`\<\[`number`, `E`\]\>
|
|
893
|
+
|
|
894
|
+
#### Remarks
|
|
895
|
+
|
|
896
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
897
|
+
|
|
898
|
+
#### Inherited from
|
|
899
|
+
|
|
900
|
+
[`LinearLinkedBase`](LinearLinkedBase.md).[`entries`](LinearLinkedBase.md#entries)
|
|
901
|
+
|
|
902
|
+
***
|
|
903
|
+
|
|
880
904
|
### every()
|
|
881
905
|
|
|
882
906
|
```ts
|
|
@@ -972,7 +996,7 @@ Time O(n), Space O(1)
|
|
|
972
996
|
filter(callback, thisArg?): this;
|
|
973
997
|
```
|
|
974
998
|
|
|
975
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
999
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1477](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1477)
|
|
976
1000
|
|
|
977
1001
|
Filter values into a new list of the same class.
|
|
978
1002
|
|
|
@@ -1203,7 +1227,7 @@ Time O(n), Space O(1).
|
|
|
1203
1227
|
getNode(elementNodeOrPredicate?): SinglyLinkedListNode<E> | undefined;
|
|
1204
1228
|
```
|
|
1205
1229
|
|
|
1206
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1230
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1173](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1173)
|
|
1207
1231
|
|
|
1208
1232
|
Find a node by value, reference, or predicate.
|
|
1209
1233
|
|
|
@@ -1235,7 +1259,7 @@ Time O(N), Space O(1)
|
|
|
1235
1259
|
getNodeAt(index): SinglyLinkedListNode<E> | undefined;
|
|
1236
1260
|
```
|
|
1237
1261
|
|
|
1238
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1262
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:771](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L771)
|
|
1239
1263
|
|
|
1240
1264
|
Get the node reference at a given index.
|
|
1241
1265
|
|
|
@@ -1307,13 +1331,47 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1307
1331
|
|
|
1308
1332
|
***
|
|
1309
1333
|
|
|
1334
|
+
### includes()
|
|
1335
|
+
|
|
1336
|
+
```ts
|
|
1337
|
+
includes(element): boolean;
|
|
1338
|
+
```
|
|
1339
|
+
|
|
1340
|
+
Defined in: [data-structures/base/iterable-element-base.ts:200](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L200)
|
|
1341
|
+
|
|
1342
|
+
Check whether a value exists (Array-compatible alias for `has`).
|
|
1343
|
+
|
|
1344
|
+
#### Parameters
|
|
1345
|
+
|
|
1346
|
+
##### element
|
|
1347
|
+
|
|
1348
|
+
`E`
|
|
1349
|
+
|
|
1350
|
+
Element to search for (uses `===`).
|
|
1351
|
+
|
|
1352
|
+
#### Returns
|
|
1353
|
+
|
|
1354
|
+
`boolean`
|
|
1355
|
+
|
|
1356
|
+
`true` if found.
|
|
1357
|
+
|
|
1358
|
+
#### Remarks
|
|
1359
|
+
|
|
1360
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1).
|
|
1361
|
+
|
|
1362
|
+
#### Inherited from
|
|
1363
|
+
|
|
1364
|
+
[`LinearLinkedBase`](LinearLinkedBase.md).[`includes`](LinearLinkedBase.md#includes)
|
|
1365
|
+
|
|
1366
|
+
***
|
|
1367
|
+
|
|
1310
1368
|
### indexOf()
|
|
1311
1369
|
|
|
1312
1370
|
```ts
|
|
1313
1371
|
indexOf(searchElement, fromIndex?): number;
|
|
1314
1372
|
```
|
|
1315
1373
|
|
|
1316
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1374
|
+
Defined in: [data-structures/base/linear-base.ts:433](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L433)
|
|
1317
1375
|
|
|
1318
1376
|
Linked-list optimized `indexOf` (forwards scan).
|
|
1319
1377
|
|
|
@@ -1353,7 +1411,7 @@ Time O(n), Space O(1)
|
|
|
1353
1411
|
isEmpty(): boolean;
|
|
1354
1412
|
```
|
|
1355
1413
|
|
|
1356
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1414
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1037](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1037)
|
|
1357
1415
|
|
|
1358
1416
|
Check whether the list is empty.
|
|
1359
1417
|
|
|
@@ -1388,7 +1446,7 @@ Time O(1), Space O(1)
|
|
|
1388
1446
|
isNode(elementNodeOrPredicate): elementNodeOrPredicate is SinglyLinkedListNode<E>;
|
|
1389
1447
|
```
|
|
1390
1448
|
|
|
1391
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1449
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:715](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L715)
|
|
1392
1450
|
|
|
1393
1451
|
Type guard: check whether the input is a SinglyLinkedListNode.
|
|
1394
1452
|
|
|
@@ -1448,13 +1506,37 @@ Time O(n), Space O(n)
|
|
|
1448
1506
|
|
|
1449
1507
|
***
|
|
1450
1508
|
|
|
1509
|
+
### keys()
|
|
1510
|
+
|
|
1511
|
+
```ts
|
|
1512
|
+
keys(): IterableIterator<number>;
|
|
1513
|
+
```
|
|
1514
|
+
|
|
1515
|
+
Defined in: [data-structures/base/iterable-element-base.ts:219](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L219)
|
|
1516
|
+
|
|
1517
|
+
Return an iterator of numeric indices (Array-compatible).
|
|
1518
|
+
|
|
1519
|
+
#### Returns
|
|
1520
|
+
|
|
1521
|
+
`IterableIterator`\<`number`\>
|
|
1522
|
+
|
|
1523
|
+
#### Remarks
|
|
1524
|
+
|
|
1525
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
1526
|
+
|
|
1527
|
+
#### Inherited from
|
|
1528
|
+
|
|
1529
|
+
[`LinearLinkedBase`](LinearLinkedBase.md).[`keys`](LinearLinkedBase.md#keys)
|
|
1530
|
+
|
|
1531
|
+
***
|
|
1532
|
+
|
|
1451
1533
|
### lastIndexOf()
|
|
1452
1534
|
|
|
1453
1535
|
```ts
|
|
1454
1536
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1455
1537
|
```
|
|
1456
1538
|
|
|
1457
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1539
|
+
Defined in: [data-structures/base/linear-base.ts:459](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L459)
|
|
1458
1540
|
|
|
1459
1541
|
Linked-list optimized `lastIndexOf` (reverse scan).
|
|
1460
1542
|
|
|
@@ -1497,7 +1579,7 @@ map<EM, RM>(
|
|
|
1497
1579
|
thisArg?): SinglyLinkedList<EM, RM>;
|
|
1498
1580
|
```
|
|
1499
1581
|
|
|
1500
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1582
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1560](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1560)
|
|
1501
1583
|
|
|
1502
1584
|
Map values into a new list (possibly different element type).
|
|
1503
1585
|
|
|
@@ -1564,7 +1646,7 @@ Time O(N), Space O(N)
|
|
|
1564
1646
|
mapSame(callback, thisArg?): this;
|
|
1565
1647
|
```
|
|
1566
1648
|
|
|
1567
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1649
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1492](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1492)
|
|
1568
1650
|
|
|
1569
1651
|
Map values into a new list of the same class.
|
|
1570
1652
|
|
|
@@ -1604,7 +1686,7 @@ Time O(N), Space O(N)
|
|
|
1604
1686
|
pop(): E | undefined;
|
|
1605
1687
|
```
|
|
1606
1688
|
|
|
1607
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1689
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:434](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L434)
|
|
1608
1690
|
|
|
1609
1691
|
Remove and return the tail element.
|
|
1610
1692
|
|
|
@@ -1647,7 +1729,7 @@ Time O(N), Space O(1)
|
|
|
1647
1729
|
print(): void;
|
|
1648
1730
|
```
|
|
1649
1731
|
|
|
1650
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1732
|
+
Defined in: [data-structures/base/iterable-element-base.ts:301](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L301)
|
|
1651
1733
|
|
|
1652
1734
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1653
1735
|
|
|
@@ -1673,7 +1755,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1673
1755
|
push(elementOrNode): boolean;
|
|
1674
1756
|
```
|
|
1675
1757
|
|
|
1676
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1758
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:358](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L358)
|
|
1677
1759
|
|
|
1678
1760
|
Append an element/node to the tail.
|
|
1679
1761
|
|
|
@@ -1728,7 +1810,7 @@ Time O(1), Space O(1)
|
|
|
1728
1810
|
pushMany(elements): boolean[];
|
|
1729
1811
|
```
|
|
1730
1812
|
|
|
1731
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1813
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:602](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L602)
|
|
1732
1814
|
|
|
1733
1815
|
Append a sequence of elements/nodes.
|
|
1734
1816
|
|
|
@@ -1796,7 +1878,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1796
1878
|
reduce(callbackfn): E;
|
|
1797
1879
|
```
|
|
1798
1880
|
|
|
1799
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1881
|
+
Defined in: [data-structures/base/iterable-element-base.ts:226](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L226)
|
|
1800
1882
|
|
|
1801
1883
|
##### Parameters
|
|
1802
1884
|
|
|
@@ -1818,7 +1900,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1818
1900
|
reduce(callbackfn, initialValue): E;
|
|
1819
1901
|
```
|
|
1820
1902
|
|
|
1821
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1903
|
+
Defined in: [data-structures/base/iterable-element-base.ts:227](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L227)
|
|
1822
1904
|
|
|
1823
1905
|
##### Parameters
|
|
1824
1906
|
|
|
@@ -1844,7 +1926,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1844
1926
|
reduce<U>(callbackfn, initialValue): U;
|
|
1845
1927
|
```
|
|
1846
1928
|
|
|
1847
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1929
|
+
Defined in: [data-structures/base/iterable-element-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L228)
|
|
1848
1930
|
|
|
1849
1931
|
##### Type Parameters
|
|
1850
1932
|
|
|
@@ -1878,7 +1960,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1878
1960
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1879
1961
|
```
|
|
1880
1962
|
|
|
1881
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1963
|
+
Defined in: [data-structures/base/linear-base.ts:585](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L585)
|
|
1882
1964
|
|
|
1883
1965
|
Right-to-left reduction using reverse iterator.
|
|
1884
1966
|
|
|
@@ -1924,7 +2006,7 @@ Time O(n), Space O(1)
|
|
|
1924
2006
|
reverse(): this;
|
|
1925
2007
|
```
|
|
1926
2008
|
|
|
1927
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2009
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1151)
|
|
1928
2010
|
|
|
1929
2011
|
Reverse the list in place.
|
|
1930
2012
|
|
|
@@ -1961,7 +2043,7 @@ Time O(N), Space O(1)
|
|
|
1961
2043
|
search(elementNodeOrPredicate): E | undefined;
|
|
1962
2044
|
```
|
|
1963
2045
|
|
|
1964
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2046
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:634](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L634)
|
|
1965
2047
|
|
|
1966
2048
|
Find the first value matching a predicate (by node).
|
|
1967
2049
|
|
|
@@ -1993,7 +2075,7 @@ Time O(N), Space O(1)
|
|
|
1993
2075
|
setAt(index, value): boolean;
|
|
1994
2076
|
```
|
|
1995
2077
|
|
|
1996
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2078
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:981](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L981)
|
|
1997
2079
|
|
|
1998
2080
|
Set the element value at an index.
|
|
1999
2081
|
|
|
@@ -2033,7 +2115,7 @@ Time O(N), Space O(1)
|
|
|
2033
2115
|
setEquality(equals): this;
|
|
2034
2116
|
```
|
|
2035
2117
|
|
|
2036
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2118
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1319](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1319)
|
|
2037
2119
|
|
|
2038
2120
|
Set the equality comparator used to compare values.
|
|
2039
2121
|
|
|
@@ -2063,7 +2145,7 @@ Time O(1), Space O(1)
|
|
|
2063
2145
|
shift(): E | undefined;
|
|
2064
2146
|
```
|
|
2065
2147
|
|
|
2066
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2148
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:505](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L505)
|
|
2067
2149
|
|
|
2068
2150
|
Remove and return the head element.
|
|
2069
2151
|
|
|
@@ -2096,7 +2178,7 @@ Time O(1), Space O(1)
|
|
|
2096
2178
|
slice(start?, end?): this;
|
|
2097
2179
|
```
|
|
2098
2180
|
|
|
2099
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
2181
|
+
Defined in: [data-structures/base/linear-base.ts:505](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L505)
|
|
2100
2182
|
|
|
2101
2183
|
Slice via forward iteration (no random access required).
|
|
2102
2184
|
|
|
@@ -2213,7 +2295,7 @@ splice(
|
|
|
2213
2295
|
items?): this;
|
|
2214
2296
|
```
|
|
2215
2297
|
|
|
2216
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2298
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1245)
|
|
2217
2299
|
|
|
2218
2300
|
Remove and/or insert elements at a position (array-like behavior).
|
|
2219
2301
|
|
|
@@ -2259,7 +2341,7 @@ Time O(N + M), Space O(M)
|
|
|
2259
2341
|
toArray(): E[];
|
|
2260
2342
|
```
|
|
2261
2343
|
|
|
2262
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2344
|
+
Defined in: [data-structures/base/iterable-element-base.ts:278](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L278)
|
|
2263
2345
|
|
|
2264
2346
|
Materializes the elements into a new array.
|
|
2265
2347
|
|
|
@@ -2279,6 +2361,32 @@ Time O(n), Space O(n).
|
|
|
2279
2361
|
|
|
2280
2362
|
***
|
|
2281
2363
|
|
|
2364
|
+
### toReversed()
|
|
2365
|
+
|
|
2366
|
+
```ts
|
|
2367
|
+
toReversed(): this;
|
|
2368
|
+
```
|
|
2369
|
+
|
|
2370
|
+
Defined in: [data-structures/base/linear-base.ts:335](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L335)
|
|
2371
|
+
|
|
2372
|
+
Return a new instance of the same type with elements in reverse order (non-mutating).
|
|
2373
|
+
|
|
2374
|
+
#### Returns
|
|
2375
|
+
|
|
2376
|
+
`this`
|
|
2377
|
+
|
|
2378
|
+
A new reversed instance.
|
|
2379
|
+
|
|
2380
|
+
#### Remarks
|
|
2381
|
+
|
|
2382
|
+
Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
|
|
2383
|
+
|
|
2384
|
+
#### Inherited from
|
|
2385
|
+
|
|
2386
|
+
[`LinearLinkedBase`](LinearLinkedBase.md).[`toReversed`](LinearLinkedBase.md#toreversed)
|
|
2387
|
+
|
|
2388
|
+
***
|
|
2389
|
+
|
|
2282
2390
|
### toReversedArray()
|
|
2283
2391
|
|
|
2284
2392
|
```ts
|
|
@@ -2311,7 +2419,7 @@ Time O(n), Space O(n)
|
|
|
2311
2419
|
toVisual(): E[];
|
|
2312
2420
|
```
|
|
2313
2421
|
|
|
2314
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2422
|
+
Defined in: [data-structures/base/iterable-element-base.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L290)
|
|
2315
2423
|
|
|
2316
2424
|
Returns a representation of the structure suitable for quick visualization.
|
|
2317
2425
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -2338,7 +2446,7 @@ Time O(n), Space O(n).
|
|
|
2338
2446
|
unshift(elementOrNode): boolean;
|
|
2339
2447
|
```
|
|
2340
2448
|
|
|
2341
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2449
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:583](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L583)
|
|
2342
2450
|
|
|
2343
2451
|
Prepend an element/node to the head.
|
|
2344
2452
|
|
|
@@ -2394,7 +2502,7 @@ Time O(1), Space O(1)
|
|
|
2394
2502
|
unshiftMany(elements): boolean[];
|
|
2395
2503
|
```
|
|
2396
2504
|
|
|
2397
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2505
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:618](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L618)
|
|
2398
2506
|
|
|
2399
2507
|
Prepend a sequence of elements/nodes.
|
|
2400
2508
|
|
|
@@ -2544,7 +2652,7 @@ Time O(1), Space O(1).
|
|
|
2544
2652
|
protected _createInstance(options?): this;
|
|
2545
2653
|
```
|
|
2546
2654
|
|
|
2547
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2655
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1683](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1683)
|
|
2548
2656
|
|
|
2549
2657
|
(Protected) Create an empty instance of the same concrete class.
|
|
2550
2658
|
|
|
@@ -2578,7 +2686,7 @@ Time O(1), Space O(1)
|
|
|
2578
2686
|
protected _createLike<EM, RM>(elements?, options?): SinglyLinkedList<EM, RM>;
|
|
2579
2687
|
```
|
|
2580
2688
|
|
|
2581
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2689
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1701](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1701)
|
|
2582
2690
|
|
|
2583
2691
|
(Protected) Create a like-kind instance and seed it from an iterable.
|
|
2584
2692
|
|
|
@@ -2626,7 +2734,7 @@ Time O(N), Space O(N)
|
|
|
2626
2734
|
protected _ensureNode(elementOrNode): SinglyLinkedListNode<E>;
|
|
2627
2735
|
```
|
|
2628
2736
|
|
|
2629
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2737
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1602](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1602)
|
|
2630
2738
|
|
|
2631
2739
|
(Protected) Normalize input into a node instance.
|
|
2632
2740
|
|
|
@@ -2656,7 +2764,7 @@ Time O(1), Space O(1)
|
|
|
2656
2764
|
protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
|
|
2657
2765
|
```
|
|
2658
2766
|
|
|
2659
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2767
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1614](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1614)
|
|
2660
2768
|
|
|
2661
2769
|
(Protected) Normalize input into a node predicate.
|
|
2662
2770
|
|
|
@@ -2688,7 +2796,7 @@ Time O(1), Space O(1)
|
|
|
2688
2796
|
protected _getIterator(): IterableIterator<E>;
|
|
2689
2797
|
```
|
|
2690
2798
|
|
|
2691
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2799
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1643](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1643)
|
|
2692
2800
|
|
|
2693
2801
|
(Protected) Iterate values from head to tail.
|
|
2694
2802
|
|
|
@@ -2714,7 +2822,7 @@ Time O(N), Space O(1)
|
|
|
2714
2822
|
protected _getNodeIterator(): IterableIterator<SinglyLinkedListNode<E>>;
|
|
2715
2823
|
```
|
|
2716
2824
|
|
|
2717
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2825
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1668](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1668)
|
|
2718
2826
|
|
|
2719
2827
|
(Protected) Iterate nodes from head to tail.
|
|
2720
2828
|
|
|
@@ -2740,7 +2848,7 @@ Time O(N), Space O(1)
|
|
|
2740
2848
|
protected _getPrevNode(node): SinglyLinkedListNode<E> | undefined;
|
|
2741
2849
|
```
|
|
2742
2850
|
|
|
2743
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2851
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1630](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1630)
|
|
2744
2852
|
|
|
2745
2853
|
(Protected) Get the previous node of a given node.
|
|
2746
2854
|
|
|
@@ -2774,7 +2882,7 @@ Time O(N), Space O(1)
|
|
|
2774
2882
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2775
2883
|
```
|
|
2776
2884
|
|
|
2777
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2885
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1657](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1657)
|
|
2778
2886
|
|
|
2779
2887
|
(Protected) Iterate values from tail to head.
|
|
2780
2888
|
|
|
@@ -2800,7 +2908,7 @@ Time O(N), Space O(N)
|
|
|
2800
2908
|
protected _isPredicate(elementNodeOrPredicate): elementNodeOrPredicate is (node: SinglyLinkedListNode<E>) => boolean;
|
|
2801
2909
|
```
|
|
2802
2910
|
|
|
2803
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2911
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1589](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1589)
|
|
2804
2912
|
|
|
2805
2913
|
(Protected) Check if input is a node predicate function.
|
|
2806
2914
|
|
|
@@ -2832,7 +2940,7 @@ Time O(1), Space O(1)
|
|
|
2832
2940
|
protected _spawnLike<EM, RM>(options?): SinglyLinkedList<EM, RM>;
|
|
2833
2941
|
```
|
|
2834
2942
|
|
|
2835
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2943
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1721](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1721)
|
|
2836
2944
|
|
|
2837
2945
|
(Protected) Spawn an empty like-kind list instance.
|
|
2838
2946
|
|
|
@@ -2872,7 +2980,7 @@ Time O(1), Space O(1)
|
|
|
2872
2980
|
protected createNode(value): SinglyLinkedListNode<E>;
|
|
2873
2981
|
```
|
|
2874
2982
|
|
|
2875
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2983
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1578](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1578)
|
|
2876
2984
|
|
|
2877
2985
|
(Protected) Create a node from a value.
|
|
2878
2986
|
|