data-structure-typed 2.5.3 → 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/.husky/pre-commit +3 -0
- package/CHANGELOG.md +1 -1
- package/MIGRATION.md +48 -0
- package/README.md +20 -2
- package/README_CN.md +20 -2
- package/SPECIFICATION.md +24 -0
- package/SPECIFICATION.zh-CN.md +24 -0
- package/dist/cjs/binary-tree.cjs +1897 -19
- package/dist/cjs/graph.cjs +174 -0
- package/dist/cjs/hash.cjs +33 -0
- package/dist/cjs/heap.cjs +71 -0
- package/dist/cjs/index.cjs +2383 -3
- package/dist/cjs/linked-list.cjs +224 -2
- package/dist/cjs/matrix.cjs +24 -0
- package/dist/cjs/priority-queue.cjs +71 -0
- package/dist/cjs/queue.cjs +221 -1
- package/dist/cjs/stack.cjs +59 -0
- package/dist/cjs/trie.cjs +62 -0
- package/dist/cjs-legacy/binary-tree.cjs +1897 -19
- package/dist/cjs-legacy/graph.cjs +174 -0
- package/dist/cjs-legacy/hash.cjs +33 -0
- package/dist/cjs-legacy/heap.cjs +71 -0
- package/dist/cjs-legacy/index.cjs +2383 -3
- package/dist/cjs-legacy/linked-list.cjs +224 -2
- package/dist/cjs-legacy/matrix.cjs +24 -0
- package/dist/cjs-legacy/priority-queue.cjs +71 -0
- package/dist/cjs-legacy/queue.cjs +221 -1
- package/dist/cjs-legacy/stack.cjs +59 -0
- package/dist/cjs-legacy/trie.cjs +62 -0
- package/dist/esm/binary-tree.mjs +1897 -19
- package/dist/esm/graph.mjs +174 -0
- package/dist/esm/hash.mjs +33 -0
- package/dist/esm/heap.mjs +71 -0
- package/dist/esm/index.mjs +2383 -3
- package/dist/esm/linked-list.mjs +224 -2
- package/dist/esm/matrix.mjs +24 -0
- package/dist/esm/priority-queue.mjs +71 -0
- package/dist/esm/queue.mjs +221 -1
- package/dist/esm/stack.mjs +59 -0
- package/dist/esm/trie.mjs +62 -0
- package/dist/esm-legacy/binary-tree.mjs +1897 -19
- package/dist/esm-legacy/graph.mjs +174 -0
- package/dist/esm-legacy/hash.mjs +33 -0
- package/dist/esm-legacy/heap.mjs +71 -0
- package/dist/esm-legacy/index.mjs +2383 -3
- package/dist/esm-legacy/linked-list.mjs +224 -2
- package/dist/esm-legacy/matrix.mjs +24 -0
- package/dist/esm-legacy/priority-queue.mjs +71 -0
- package/dist/esm-legacy/queue.mjs +221 -1
- package/dist/esm-legacy/stack.mjs +59 -0
- package/dist/esm-legacy/trie.mjs +62 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +36 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +75 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +72 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +375 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
- package/dist/types/data-structures/heap/heap.d.ts +42 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
- package/dist/types/data-structures/queue/deque.d.ts +90 -1
- package/dist/types/data-structures/queue/queue.d.ts +36 -0
- package/dist/types/data-structures/stack/stack.d.ts +30 -0
- package/dist/types/data-structures/trie/trie.d.ts +36 -0
- package/dist/umd/data-structure-typed.js +2383 -3
- package/dist/umd/data-structure-typed.min.js +3 -3
- 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 +30 -26
- 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/jest.integration.config.js +1 -2
- package/package.json +51 -50
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +32 -3
- package/src/data-structures/base/linear-base.ts +13 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -493
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -530
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1236
- package/src/data-structures/binary-tree/bst.ts +158 -1010
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1233
- package/src/data-structures/binary-tree/segment-tree.ts +73 -333
- package/src/data-structures/binary-tree/tree-map.ts +462 -4749
- package/src/data-structures/binary-tree/tree-multi-map.ts +310 -4530
- package/src/data-structures/binary-tree/tree-multi-set.ts +300 -3652
- package/src/data-structures/binary-tree/tree-set.ts +437 -4443
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -532
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -484
- package/src/data-structures/hash/hash-map.ts +154 -549
- package/src/data-structures/heap/heap.ts +200 -753
- package/src/data-structures/linked-list/doubly-linked-list.ts +153 -809
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -749
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -864
- package/src/data-structures/matrix/matrix.ts +179 -494
- 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 +241 -807
- package/src/data-structures/queue/queue.ts +102 -589
- package/src/data-structures/stack/stack.ts +76 -475
- package/src/data-structures/trie/trie.ts +98 -592
- 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: LinkedListQueue\<E, R\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
9
|
+
Defined in: [data-structures/queue/queue.ts:1146](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1146)
|
|
10
10
|
|
|
11
11
|
Queue implemented over a singly linked list; preserves head/tail operations with linear scans for queries.
|
|
12
12
|
|
|
@@ -314,7 +314,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
314
314
|
addAfter(existingElementOrNode, newElementOrNode): boolean;
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
317
|
+
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)
|
|
318
318
|
|
|
319
319
|
Insert a new element/node after an existing one.
|
|
320
320
|
|
|
@@ -354,7 +354,7 @@ Time O(N), Space O(1)
|
|
|
354
354
|
addAt(index, newElementOrNode): boolean;
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
357
|
+
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)
|
|
358
358
|
|
|
359
359
|
Insert a new element/node at an index, shifting following nodes.
|
|
360
360
|
|
|
@@ -405,7 +405,7 @@ Time O(N), Space O(1)
|
|
|
405
405
|
addBefore(existingElementOrNode, newElementOrNode): boolean;
|
|
406
406
|
```
|
|
407
407
|
|
|
408
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
408
|
+
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)
|
|
409
409
|
|
|
410
410
|
Insert a new element/node before an existing one.
|
|
411
411
|
|
|
@@ -445,7 +445,7 @@ Time O(N), Space O(1)
|
|
|
445
445
|
at(index): E | undefined;
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
448
|
+
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)
|
|
449
449
|
|
|
450
450
|
Get the element at a given index.
|
|
451
451
|
|
|
@@ -491,7 +491,7 @@ Time O(N), Space O(1)
|
|
|
491
491
|
clear(): void;
|
|
492
492
|
```
|
|
493
493
|
|
|
494
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
494
|
+
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)
|
|
495
495
|
|
|
496
496
|
Remove all nodes and reset length.
|
|
497
497
|
|
|
@@ -528,7 +528,7 @@ Time O(N), Space O(1)
|
|
|
528
528
|
clone(): this;
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
531
|
+
Defined in: [data-structures/queue/queue.ts:1153](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1153)
|
|
532
532
|
|
|
533
533
|
Deep clone this linked-list-based queue.
|
|
534
534
|
|
|
@@ -554,7 +554,7 @@ Time O(N), Space O(N)
|
|
|
554
554
|
concat(...items): this;
|
|
555
555
|
```
|
|
556
556
|
|
|
557
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
557
|
+
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)
|
|
558
558
|
|
|
559
559
|
Concatenate lists/elements preserving order.
|
|
560
560
|
|
|
@@ -590,7 +590,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
590
590
|
countOccurrences(elementOrNode): number;
|
|
591
591
|
```
|
|
592
592
|
|
|
593
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
593
|
+
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)
|
|
594
594
|
|
|
595
595
|
Count how many nodes match a value/node/predicate.
|
|
596
596
|
|
|
@@ -626,7 +626,7 @@ Time O(N), Space O(1)
|
|
|
626
626
|
delete(elementOrNode?): boolean;
|
|
627
627
|
```
|
|
628
628
|
|
|
629
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
629
|
+
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)
|
|
630
630
|
|
|
631
631
|
Delete the first match by value/node.
|
|
632
632
|
|
|
@@ -671,7 +671,7 @@ Time O(N), Space O(1)
|
|
|
671
671
|
deleteAt(index): E | undefined;
|
|
672
672
|
```
|
|
673
673
|
|
|
674
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
674
|
+
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)
|
|
675
675
|
|
|
676
676
|
Delete the element at an index.
|
|
677
677
|
|
|
@@ -716,7 +716,7 @@ Time O(N), Space O(1)
|
|
|
716
716
|
deleteWhere(predicate): boolean;
|
|
717
717
|
```
|
|
718
718
|
|
|
719
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
719
|
+
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)
|
|
720
720
|
|
|
721
721
|
Delete the first node whose value matches a predicate.
|
|
722
722
|
|
|
@@ -744,6 +744,30 @@ Time O(N), Space O(1)
|
|
|
744
744
|
|
|
745
745
|
***
|
|
746
746
|
|
|
747
|
+
### entries()
|
|
748
|
+
|
|
749
|
+
```ts
|
|
750
|
+
entries(): IterableIterator<[number, E]>;
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
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)
|
|
754
|
+
|
|
755
|
+
Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
756
|
+
|
|
757
|
+
#### Returns
|
|
758
|
+
|
|
759
|
+
`IterableIterator`\<\[`number`, `E`\]\>
|
|
760
|
+
|
|
761
|
+
#### Remarks
|
|
762
|
+
|
|
763
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
764
|
+
|
|
765
|
+
#### Inherited from
|
|
766
|
+
|
|
767
|
+
[`SinglyLinkedList`](SinglyLinkedList.md).[`entries`](SinglyLinkedList.md#entries)
|
|
768
|
+
|
|
769
|
+
***
|
|
770
|
+
|
|
747
771
|
### every()
|
|
748
772
|
|
|
749
773
|
```ts
|
|
@@ -839,7 +863,7 @@ Time O(n), Space O(1)
|
|
|
839
863
|
filter(callback, thisArg?): this;
|
|
840
864
|
```
|
|
841
865
|
|
|
842
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
866
|
+
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)
|
|
843
867
|
|
|
844
868
|
Filter values into a new list of the same class.
|
|
845
869
|
|
|
@@ -1070,7 +1094,7 @@ Time O(n), Space O(1).
|
|
|
1070
1094
|
getNode(elementNodeOrPredicate?): SinglyLinkedListNode<E> | undefined;
|
|
1071
1095
|
```
|
|
1072
1096
|
|
|
1073
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1097
|
+
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)
|
|
1074
1098
|
|
|
1075
1099
|
Find a node by value, reference, or predicate.
|
|
1076
1100
|
|
|
@@ -1106,7 +1130,7 @@ Time O(N), Space O(1)
|
|
|
1106
1130
|
getNodeAt(index): SinglyLinkedListNode<E> | undefined;
|
|
1107
1131
|
```
|
|
1108
1132
|
|
|
1109
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1133
|
+
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)
|
|
1110
1134
|
|
|
1111
1135
|
Get the node reference at a given index.
|
|
1112
1136
|
|
|
@@ -1178,13 +1202,47 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1178
1202
|
|
|
1179
1203
|
***
|
|
1180
1204
|
|
|
1205
|
+
### includes()
|
|
1206
|
+
|
|
1207
|
+
```ts
|
|
1208
|
+
includes(element): boolean;
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
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)
|
|
1212
|
+
|
|
1213
|
+
Check whether a value exists (Array-compatible alias for `has`).
|
|
1214
|
+
|
|
1215
|
+
#### Parameters
|
|
1216
|
+
|
|
1217
|
+
##### element
|
|
1218
|
+
|
|
1219
|
+
`E`
|
|
1220
|
+
|
|
1221
|
+
Element to search for (uses `===`).
|
|
1222
|
+
|
|
1223
|
+
#### Returns
|
|
1224
|
+
|
|
1225
|
+
`boolean`
|
|
1226
|
+
|
|
1227
|
+
`true` if found.
|
|
1228
|
+
|
|
1229
|
+
#### Remarks
|
|
1230
|
+
|
|
1231
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1).
|
|
1232
|
+
|
|
1233
|
+
#### Inherited from
|
|
1234
|
+
|
|
1235
|
+
[`SinglyLinkedList`](SinglyLinkedList.md).[`includes`](SinglyLinkedList.md#includes)
|
|
1236
|
+
|
|
1237
|
+
***
|
|
1238
|
+
|
|
1181
1239
|
### indexOf()
|
|
1182
1240
|
|
|
1183
1241
|
```ts
|
|
1184
1242
|
indexOf(searchElement, fromIndex?): number;
|
|
1185
1243
|
```
|
|
1186
1244
|
|
|
1187
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1245
|
+
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)
|
|
1188
1246
|
|
|
1189
1247
|
Linked-list optimized `indexOf` (forwards scan).
|
|
1190
1248
|
|
|
@@ -1224,7 +1282,7 @@ Time O(n), Space O(1)
|
|
|
1224
1282
|
isEmpty(): boolean;
|
|
1225
1283
|
```
|
|
1226
1284
|
|
|
1227
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1285
|
+
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)
|
|
1228
1286
|
|
|
1229
1287
|
Check whether the list is empty.
|
|
1230
1288
|
|
|
@@ -1259,7 +1317,7 @@ Time O(1), Space O(1)
|
|
|
1259
1317
|
isNode(elementNodeOrPredicate): elementNodeOrPredicate is SinglyLinkedListNode<E>;
|
|
1260
1318
|
```
|
|
1261
1319
|
|
|
1262
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1320
|
+
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)
|
|
1263
1321
|
|
|
1264
1322
|
Type guard: check whether the input is a SinglyLinkedListNode.
|
|
1265
1323
|
|
|
@@ -1323,13 +1381,37 @@ Time O(n), Space O(n)
|
|
|
1323
1381
|
|
|
1324
1382
|
***
|
|
1325
1383
|
|
|
1384
|
+
### keys()
|
|
1385
|
+
|
|
1386
|
+
```ts
|
|
1387
|
+
keys(): IterableIterator<number>;
|
|
1388
|
+
```
|
|
1389
|
+
|
|
1390
|
+
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)
|
|
1391
|
+
|
|
1392
|
+
Return an iterator of numeric indices (Array-compatible).
|
|
1393
|
+
|
|
1394
|
+
#### Returns
|
|
1395
|
+
|
|
1396
|
+
`IterableIterator`\<`number`\>
|
|
1397
|
+
|
|
1398
|
+
#### Remarks
|
|
1399
|
+
|
|
1400
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
1401
|
+
|
|
1402
|
+
#### Inherited from
|
|
1403
|
+
|
|
1404
|
+
[`SinglyLinkedList`](SinglyLinkedList.md).[`keys`](SinglyLinkedList.md#keys)
|
|
1405
|
+
|
|
1406
|
+
***
|
|
1407
|
+
|
|
1326
1408
|
### lastIndexOf()
|
|
1327
1409
|
|
|
1328
1410
|
```ts
|
|
1329
1411
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1330
1412
|
```
|
|
1331
1413
|
|
|
1332
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1414
|
+
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)
|
|
1333
1415
|
|
|
1334
1416
|
Linked-list optimized `lastIndexOf` (reverse scan).
|
|
1335
1417
|
|
|
@@ -1372,7 +1454,7 @@ map<EM, RM>(
|
|
|
1372
1454
|
thisArg?): SinglyLinkedList<EM, RM>;
|
|
1373
1455
|
```
|
|
1374
1456
|
|
|
1375
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1457
|
+
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)
|
|
1376
1458
|
|
|
1377
1459
|
Map values into a new list (possibly different element type).
|
|
1378
1460
|
|
|
@@ -1439,7 +1521,7 @@ Time O(N), Space O(N)
|
|
|
1439
1521
|
mapSame(callback, thisArg?): this;
|
|
1440
1522
|
```
|
|
1441
1523
|
|
|
1442
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1524
|
+
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)
|
|
1443
1525
|
|
|
1444
1526
|
Map values into a new list of the same class.
|
|
1445
1527
|
|
|
@@ -1479,7 +1561,7 @@ Time O(N), Space O(N)
|
|
|
1479
1561
|
pop(): E | undefined;
|
|
1480
1562
|
```
|
|
1481
1563
|
|
|
1482
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1564
|
+
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)
|
|
1483
1565
|
|
|
1484
1566
|
Remove and return the tail element.
|
|
1485
1567
|
|
|
@@ -1526,7 +1608,7 @@ Time O(N), Space O(1)
|
|
|
1526
1608
|
print(): void;
|
|
1527
1609
|
```
|
|
1528
1610
|
|
|
1529
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1611
|
+
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)
|
|
1530
1612
|
|
|
1531
1613
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1532
1614
|
|
|
@@ -1552,7 +1634,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1552
1634
|
push(elementOrNode): boolean;
|
|
1553
1635
|
```
|
|
1554
1636
|
|
|
1555
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1637
|
+
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)
|
|
1556
1638
|
|
|
1557
1639
|
Append an element/node to the tail.
|
|
1558
1640
|
|
|
@@ -1607,7 +1689,7 @@ Time O(1), Space O(1)
|
|
|
1607
1689
|
pushMany(elements): boolean[];
|
|
1608
1690
|
```
|
|
1609
1691
|
|
|
1610
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1692
|
+
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)
|
|
1611
1693
|
|
|
1612
1694
|
Append a sequence of elements/nodes.
|
|
1613
1695
|
|
|
@@ -1675,7 +1757,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1675
1757
|
reduce(callbackfn): E;
|
|
1676
1758
|
```
|
|
1677
1759
|
|
|
1678
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1760
|
+
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)
|
|
1679
1761
|
|
|
1680
1762
|
##### Parameters
|
|
1681
1763
|
|
|
@@ -1697,7 +1779,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1697
1779
|
reduce(callbackfn, initialValue): E;
|
|
1698
1780
|
```
|
|
1699
1781
|
|
|
1700
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1782
|
+
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)
|
|
1701
1783
|
|
|
1702
1784
|
##### Parameters
|
|
1703
1785
|
|
|
@@ -1723,7 +1805,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1723
1805
|
reduce<U>(callbackfn, initialValue): U;
|
|
1724
1806
|
```
|
|
1725
1807
|
|
|
1726
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1808
|
+
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)
|
|
1727
1809
|
|
|
1728
1810
|
##### Type Parameters
|
|
1729
1811
|
|
|
@@ -1757,7 +1839,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1757
1839
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1758
1840
|
```
|
|
1759
1841
|
|
|
1760
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1842
|
+
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)
|
|
1761
1843
|
|
|
1762
1844
|
Right-to-left reduction using reverse iterator.
|
|
1763
1845
|
|
|
@@ -1803,7 +1885,7 @@ Time O(n), Space O(1)
|
|
|
1803
1885
|
reverse(): this;
|
|
1804
1886
|
```
|
|
1805
1887
|
|
|
1806
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1888
|
+
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)
|
|
1807
1889
|
|
|
1808
1890
|
Reverse the list in place.
|
|
1809
1891
|
|
|
@@ -1840,7 +1922,7 @@ Time O(N), Space O(1)
|
|
|
1840
1922
|
search(elementNodeOrPredicate): E | undefined;
|
|
1841
1923
|
```
|
|
1842
1924
|
|
|
1843
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1925
|
+
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)
|
|
1844
1926
|
|
|
1845
1927
|
Find the first value matching a predicate (by node).
|
|
1846
1928
|
|
|
@@ -1876,7 +1958,7 @@ Time O(N), Space O(1)
|
|
|
1876
1958
|
setAt(index, value): boolean;
|
|
1877
1959
|
```
|
|
1878
1960
|
|
|
1879
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1961
|
+
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)
|
|
1880
1962
|
|
|
1881
1963
|
Set the element value at an index.
|
|
1882
1964
|
|
|
@@ -1916,7 +1998,7 @@ Time O(N), Space O(1)
|
|
|
1916
1998
|
setEquality(equals): this;
|
|
1917
1999
|
```
|
|
1918
2000
|
|
|
1919
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2001
|
+
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)
|
|
1920
2002
|
|
|
1921
2003
|
Set the equality comparator used to compare values.
|
|
1922
2004
|
|
|
@@ -1950,7 +2032,7 @@ Time O(1), Space O(1)
|
|
|
1950
2032
|
shift(): E | undefined;
|
|
1951
2033
|
```
|
|
1952
2034
|
|
|
1953
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2035
|
+
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)
|
|
1954
2036
|
|
|
1955
2037
|
Remove and return the head element.
|
|
1956
2038
|
|
|
@@ -1987,7 +2069,7 @@ Time O(1), Space O(1)
|
|
|
1987
2069
|
slice(start?, end?): this;
|
|
1988
2070
|
```
|
|
1989
2071
|
|
|
1990
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
2072
|
+
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)
|
|
1991
2073
|
|
|
1992
2074
|
Slice via forward iteration (no random access required).
|
|
1993
2075
|
|
|
@@ -2104,7 +2186,7 @@ splice(
|
|
|
2104
2186
|
items?): this;
|
|
2105
2187
|
```
|
|
2106
2188
|
|
|
2107
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2189
|
+
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)
|
|
2108
2190
|
|
|
2109
2191
|
Remove and/or insert elements at a position (array-like behavior).
|
|
2110
2192
|
|
|
@@ -2150,7 +2232,7 @@ Time O(N + M), Space O(M)
|
|
|
2150
2232
|
toArray(): E[];
|
|
2151
2233
|
```
|
|
2152
2234
|
|
|
2153
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2235
|
+
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)
|
|
2154
2236
|
|
|
2155
2237
|
Materializes the elements into a new array.
|
|
2156
2238
|
|
|
@@ -2170,6 +2252,32 @@ Time O(n), Space O(n).
|
|
|
2170
2252
|
|
|
2171
2253
|
***
|
|
2172
2254
|
|
|
2255
|
+
### toReversed()
|
|
2256
|
+
|
|
2257
|
+
```ts
|
|
2258
|
+
toReversed(): this;
|
|
2259
|
+
```
|
|
2260
|
+
|
|
2261
|
+
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)
|
|
2262
|
+
|
|
2263
|
+
Return a new instance of the same type with elements in reverse order (non-mutating).
|
|
2264
|
+
|
|
2265
|
+
#### Returns
|
|
2266
|
+
|
|
2267
|
+
`this`
|
|
2268
|
+
|
|
2269
|
+
A new reversed instance.
|
|
2270
|
+
|
|
2271
|
+
#### Remarks
|
|
2272
|
+
|
|
2273
|
+
Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
|
|
2274
|
+
|
|
2275
|
+
#### Inherited from
|
|
2276
|
+
|
|
2277
|
+
[`SinglyLinkedList`](SinglyLinkedList.md).[`toReversed`](SinglyLinkedList.md#toreversed)
|
|
2278
|
+
|
|
2279
|
+
***
|
|
2280
|
+
|
|
2173
2281
|
### toReversedArray()
|
|
2174
2282
|
|
|
2175
2283
|
```ts
|
|
@@ -2202,7 +2310,7 @@ Time O(n), Space O(n)
|
|
|
2202
2310
|
toVisual(): E[];
|
|
2203
2311
|
```
|
|
2204
2312
|
|
|
2205
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2313
|
+
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)
|
|
2206
2314
|
|
|
2207
2315
|
Returns a representation of the structure suitable for quick visualization.
|
|
2208
2316
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -2229,7 +2337,7 @@ Time O(n), Space O(n).
|
|
|
2229
2337
|
unshift(elementOrNode): boolean;
|
|
2230
2338
|
```
|
|
2231
2339
|
|
|
2232
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2340
|
+
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)
|
|
2233
2341
|
|
|
2234
2342
|
Prepend an element/node to the head.
|
|
2235
2343
|
|
|
@@ -2289,7 +2397,7 @@ Time O(1), Space O(1)
|
|
|
2289
2397
|
unshiftMany(elements): boolean[];
|
|
2290
2398
|
```
|
|
2291
2399
|
|
|
2292
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2400
|
+
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)
|
|
2293
2401
|
|
|
2294
2402
|
Prepend a sequence of elements/nodes.
|
|
2295
2403
|
|
|
@@ -2447,7 +2555,7 @@ Time O(1), Space O(1).
|
|
|
2447
2555
|
protected _createInstance(options?): this;
|
|
2448
2556
|
```
|
|
2449
2557
|
|
|
2450
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2558
|
+
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)
|
|
2451
2559
|
|
|
2452
2560
|
(Protected) Create an empty instance of the same concrete class.
|
|
2453
2561
|
|
|
@@ -2481,7 +2589,7 @@ Time O(1), Space O(1)
|
|
|
2481
2589
|
protected _createLike<EM, RM>(elements?, options?): SinglyLinkedList<EM, RM>;
|
|
2482
2590
|
```
|
|
2483
2591
|
|
|
2484
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2592
|
+
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)
|
|
2485
2593
|
|
|
2486
2594
|
(Protected) Create a like-kind instance and seed it from an iterable.
|
|
2487
2595
|
|
|
@@ -2533,7 +2641,7 @@ Time O(N), Space O(N)
|
|
|
2533
2641
|
protected _ensureNode(elementOrNode): SinglyLinkedListNode<E>;
|
|
2534
2642
|
```
|
|
2535
2643
|
|
|
2536
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2644
|
+
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)
|
|
2537
2645
|
|
|
2538
2646
|
(Protected) Normalize input into a node instance.
|
|
2539
2647
|
|
|
@@ -2567,7 +2675,7 @@ Time O(1), Space O(1)
|
|
|
2567
2675
|
protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
|
|
2568
2676
|
```
|
|
2569
2677
|
|
|
2570
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2678
|
+
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)
|
|
2571
2679
|
|
|
2572
2680
|
(Protected) Normalize input into a node predicate.
|
|
2573
2681
|
|
|
@@ -2603,7 +2711,7 @@ Time O(1), Space O(1)
|
|
|
2603
2711
|
protected _getIterator(): IterableIterator<E>;
|
|
2604
2712
|
```
|
|
2605
2713
|
|
|
2606
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2714
|
+
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)
|
|
2607
2715
|
|
|
2608
2716
|
(Protected) Iterate values from head to tail.
|
|
2609
2717
|
|
|
@@ -2629,7 +2737,7 @@ Time O(N), Space O(1)
|
|
|
2629
2737
|
protected _getNodeIterator(): IterableIterator<SinglyLinkedListNode<E>>;
|
|
2630
2738
|
```
|
|
2631
2739
|
|
|
2632
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2740
|
+
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)
|
|
2633
2741
|
|
|
2634
2742
|
(Protected) Iterate nodes from head to tail.
|
|
2635
2743
|
|
|
@@ -2655,7 +2763,7 @@ Time O(N), Space O(1)
|
|
|
2655
2763
|
protected _getPrevNode(node): SinglyLinkedListNode<E> | undefined;
|
|
2656
2764
|
```
|
|
2657
2765
|
|
|
2658
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2766
|
+
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)
|
|
2659
2767
|
|
|
2660
2768
|
(Protected) Get the previous node of a given node.
|
|
2661
2769
|
|
|
@@ -2689,7 +2797,7 @@ Time O(N), Space O(1)
|
|
|
2689
2797
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2690
2798
|
```
|
|
2691
2799
|
|
|
2692
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2800
|
+
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)
|
|
2693
2801
|
|
|
2694
2802
|
(Protected) Iterate values from tail to head.
|
|
2695
2803
|
|
|
@@ -2715,7 +2823,7 @@ Time O(N), Space O(N)
|
|
|
2715
2823
|
protected _isPredicate(elementNodeOrPredicate): elementNodeOrPredicate is (node: SinglyLinkedListNode<E>) => boolean;
|
|
2716
2824
|
```
|
|
2717
2825
|
|
|
2718
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2826
|
+
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)
|
|
2719
2827
|
|
|
2720
2828
|
(Protected) Check if input is a node predicate function.
|
|
2721
2829
|
|
|
@@ -2751,7 +2859,7 @@ Time O(1), Space O(1)
|
|
|
2751
2859
|
protected _spawnLike<EM, RM>(options?): SinglyLinkedList<EM, RM>;
|
|
2752
2860
|
```
|
|
2753
2861
|
|
|
2754
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2862
|
+
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)
|
|
2755
2863
|
|
|
2756
2864
|
(Protected) Spawn an empty like-kind list instance.
|
|
2757
2865
|
|
|
@@ -2795,7 +2903,7 @@ Time O(1), Space O(1)
|
|
|
2795
2903
|
protected createNode(value): SinglyLinkedListNode<E>;
|
|
2796
2904
|
```
|
|
2797
2905
|
|
|
2798
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2906
|
+
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)
|
|
2799
2907
|
|
|
2800
2908
|
(Protected) Create a node from a value.
|
|
2801
2909
|
|