data-structure-typed 2.5.2 → 2.5.3
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/CHANGELOG.md +3 -1
- package/MIGRATION.md +169 -0
- package/README.md +60 -6
- package/README_CN.md +551 -143
- package/SPECIFICATION.md +20 -14
- package/SPECIFICATION.zh-CN.md +20 -14
- package/dist/cjs/binary-tree.cjs +2417 -132
- package/dist/cjs/graph.cjs +248 -14
- package/dist/cjs/hash.cjs +62 -7
- package/dist/cjs/heap.cjs +103 -16
- package/dist/cjs/index.cjs +3046 -124
- package/dist/cjs/linked-list.cjs +219 -0
- package/dist/cjs/matrix.cjs +32 -0
- package/dist/cjs/priority-queue.cjs +101 -14
- package/dist/cjs/queue.cjs +215 -0
- package/dist/cjs/stack.cjs +44 -4
- package/dist/cjs/trie.cjs +44 -0
- package/dist/cjs-legacy/binary-tree.cjs +2406 -123
- package/dist/cjs-legacy/graph.cjs +248 -14
- package/dist/cjs-legacy/hash.cjs +62 -7
- package/dist/cjs-legacy/heap.cjs +103 -16
- package/dist/cjs-legacy/index.cjs +3105 -185
- package/dist/cjs-legacy/linked-list.cjs +219 -0
- package/dist/cjs-legacy/matrix.cjs +32 -0
- package/dist/cjs-legacy/priority-queue.cjs +101 -14
- package/dist/cjs-legacy/queue.cjs +215 -0
- package/dist/cjs-legacy/stack.cjs +44 -4
- package/dist/cjs-legacy/trie.cjs +44 -0
- package/dist/esm/binary-tree.mjs +2417 -132
- package/dist/esm/graph.mjs +248 -14
- package/dist/esm/hash.mjs +62 -7
- package/dist/esm/heap.mjs +103 -16
- package/dist/esm/index.mjs +3046 -124
- package/dist/esm/linked-list.mjs +219 -0
- package/dist/esm/matrix.mjs +32 -0
- package/dist/esm/priority-queue.mjs +101 -14
- package/dist/esm/queue.mjs +215 -0
- package/dist/esm/stack.mjs +44 -4
- package/dist/esm/trie.mjs +44 -0
- package/dist/esm-legacy/binary-tree.mjs +2406 -123
- package/dist/esm-legacy/graph.mjs +248 -14
- package/dist/esm-legacy/hash.mjs +62 -7
- package/dist/esm-legacy/heap.mjs +103 -16
- package/dist/esm-legacy/index.mjs +3105 -185
- package/dist/esm-legacy/linked-list.mjs +219 -0
- package/dist/esm-legacy/matrix.mjs +32 -0
- package/dist/esm-legacy/priority-queue.mjs +101 -14
- package/dist/esm-legacy/queue.mjs +215 -0
- package/dist/esm-legacy/stack.mjs +44 -4
- package/dist/esm-legacy/trie.mjs +44 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +50 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +116 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +99 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +79 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +520 -1
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +489 -1
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +393 -1
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +500 -1
- package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +51 -6
- package/dist/types/data-structures/heap/heap.d.ts +98 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +61 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
- package/dist/types/data-structures/queue/deque.d.ts +82 -0
- package/dist/types/data-structures/queue/queue.d.ts +61 -0
- package/dist/types/data-structures/stack/stack.d.ts +42 -2
- package/dist/types/data-structures/trie/trie.d.ts +48 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/data-structure-typed.js +3105 -185
- package/dist/umd/data-structure-typed.min.js +4 -4
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +188 -200
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +62 -62
- package/docs-site-docusaurus/docs/api/classes/BST.md +183 -195
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +143 -155
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +99 -85
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +100 -70
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +38 -38
- package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +48 -48
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +52 -52
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
- package/docs-site-docusaurus/docs/api/classes/Queue.md +111 -59
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +200 -212
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +75 -75
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +37 -37
- package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +107 -36
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +106 -35
- package/docs-site-docusaurus/docs/api/classes/Trie.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +72 -72
- package/docs-site-docusaurus/docs/guide/architecture.md +75 -7
- package/docs-site-docusaurus/docs/guide/concepts.md +53 -34
- package/docs-site-docusaurus/docs/guide/faq.md +53 -0
- package/docs-site-docusaurus/docs/guide/guides.md +8 -9
- package/docs-site-docusaurus/docs/guide/integrations.md +74 -177
- package/docs-site-docusaurus/docs/guide/overview.md +131 -17
- package/docs-site-docusaurus/src/pages/index.tsx +4 -0
- package/docs-site-docusaurus/typedoc.json +1 -0
- package/package.json +7 -6
- package/src/data-structures/binary-tree/avl-tree.ts +52 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +56 -0
- package/src/data-structures/binary-tree/binary-tree.ts +167 -81
- package/src/data-structures/binary-tree/bst.ts +101 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +82 -15
- package/src/data-structures/binary-tree/segment-tree.ts +24 -0
- package/src/data-structures/binary-tree/tree-map.ts +540 -3
- package/src/data-structures/binary-tree/tree-multi-map.ts +490 -2
- package/src/data-structures/binary-tree/tree-multi-set.ts +393 -1
- package/src/data-structures/binary-tree/tree-set.ts +520 -3
- package/src/data-structures/graph/directed-graph.ts +41 -1
- package/src/data-structures/graph/undirected-graph.ts +37 -1
- package/src/data-structures/hash/hash-map.ts +67 -12
- package/src/data-structures/heap/heap.ts +107 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +88 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +61 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +72 -0
- package/src/data-structures/matrix/matrix.ts +32 -0
- package/src/data-structures/queue/deque.ts +85 -0
- package/src/data-structures/queue/queue.ts +73 -0
- package/src/data-structures/stack/stack.ts +45 -5
- package/src/data-structures/trie/trie.ts +48 -0
- package/src/interfaces/binary-tree.ts +1 -9
- package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
- package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
- package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
|
@@ -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:1110](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1110)
|
|
10
10
|
|
|
11
11
|
Queue implemented over a singly linked list; preserves head/tail operations with linear scans for queries.
|
|
12
12
|
|
|
@@ -42,7 +42,7 @@ examples will be generated by unit test
|
|
|
42
42
|
new LinkedListQueue<E, R>(elements?, options?): LinkedListQueue<E, R>;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:205](https://github.com/zrwusa/data-structure-typed/blob/
|
|
45
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:205](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L205)
|
|
46
46
|
|
|
47
47
|
Create a SinglyLinkedList and optionally bulk-insert elements.
|
|
48
48
|
|
|
@@ -86,7 +86,7 @@ Time O(N), Space O(N)
|
|
|
86
86
|
get first(): E | undefined;
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:255](https://github.com/zrwusa/data-structure-typed/blob/
|
|
89
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:255](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L255)
|
|
90
90
|
|
|
91
91
|
Get the first element value.
|
|
92
92
|
|
|
@@ -114,7 +114,7 @@ First element or undefined.
|
|
|
114
114
|
get head(): SinglyLinkedListNode<E> | undefined;
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:221](https://github.com/zrwusa/data-structure-typed/blob/
|
|
117
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:221](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L221)
|
|
118
118
|
|
|
119
119
|
Get the head node.
|
|
120
120
|
|
|
@@ -142,7 +142,7 @@ Head node or undefined.
|
|
|
142
142
|
get last(): E | undefined;
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:265](https://github.com/zrwusa/data-structure-typed/blob/
|
|
145
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L265)
|
|
146
146
|
|
|
147
147
|
Get the last element value.
|
|
148
148
|
|
|
@@ -170,7 +170,7 @@ Last element or undefined.
|
|
|
170
170
|
get length(): number;
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:245](https://github.com/zrwusa/data-structure-typed/blob/
|
|
173
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L245)
|
|
174
174
|
|
|
175
175
|
Get the number of elements.
|
|
176
176
|
|
|
@@ -198,7 +198,7 @@ Current length.
|
|
|
198
198
|
get maxLen(): number;
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
Defined in: [data-structures/base/linear-base.ts:100](https://github.com/zrwusa/data-structure-typed/blob/
|
|
201
|
+
Defined in: [data-structures/base/linear-base.ts:100](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L100)
|
|
202
202
|
|
|
203
203
|
Upper bound for length (if positive), or `-1` when unbounded.
|
|
204
204
|
|
|
@@ -226,7 +226,7 @@ Maximum allowed length.
|
|
|
226
226
|
get tail(): SinglyLinkedListNode<E> | undefined;
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:233](https://github.com/zrwusa/data-structure-typed/blob/
|
|
229
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:233](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L233)
|
|
230
230
|
|
|
231
231
|
Get the tail node.
|
|
232
232
|
|
|
@@ -254,7 +254,7 @@ Tail node or undefined.
|
|
|
254
254
|
get toElementFn(): ((rawElement) => E) | undefined;
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
Defined in: [data-structures/base/iterable-element-base.ts:48](https://github.com/zrwusa/data-structure-typed/blob/
|
|
257
|
+
Defined in: [data-structures/base/iterable-element-base.ts:48](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L48)
|
|
258
258
|
|
|
259
259
|
Exposes the current `toElementFn`, if configured.
|
|
260
260
|
|
|
@@ -280,7 +280,7 @@ The converter function or `undefined` when not set.
|
|
|
280
280
|
iterator: IterableIterator<E>;
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
-
Defined in: [data-structures/base/iterable-element-base.ts:61](https://github.com/zrwusa/data-structure-typed/blob/
|
|
283
|
+
Defined in: [data-structures/base/iterable-element-base.ts:61](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L61)
|
|
284
284
|
|
|
285
285
|
Returns an iterator over the structure's elements.
|
|
286
286
|
|
|
@@ -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:1189](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1189)
|
|
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:934](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L934)
|
|
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:1159](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1159)
|
|
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:686](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L686)
|
|
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:1059](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1059)
|
|
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:1117](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1117)
|
|
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:473](https://github.com/zrwusa/data-structure-typed/blob/
|
|
557
|
+
Defined in: [data-structures/base/linear-base.ts:473](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L473)
|
|
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:1265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1265)
|
|
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:868](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L868)
|
|
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:808](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L808)
|
|
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:1295](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1295)
|
|
720
720
|
|
|
721
721
|
Delete the first node whose value matches a predicate.
|
|
722
722
|
|
|
@@ -750,7 +750,7 @@ Time O(N), Space O(1)
|
|
|
750
750
|
every(predicate, thisArg?): boolean;
|
|
751
751
|
```
|
|
752
752
|
|
|
753
|
-
Defined in: [data-structures/base/iterable-element-base.ts:87](https://github.com/zrwusa/data-structure-typed/blob/
|
|
753
|
+
Defined in: [data-structures/base/iterable-element-base.ts:87](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L87)
|
|
754
754
|
|
|
755
755
|
Tests whether all elements satisfy the predicate.
|
|
756
756
|
|
|
@@ -793,7 +793,7 @@ fill(
|
|
|
793
793
|
end?): this;
|
|
794
794
|
```
|
|
795
795
|
|
|
796
|
-
Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/
|
|
796
|
+
Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L292)
|
|
797
797
|
|
|
798
798
|
Fill a range with a value.
|
|
799
799
|
|
|
@@ -839,7 +839,7 @@ Time O(n), Space O(1)
|
|
|
839
839
|
filter(callback, thisArg?): this;
|
|
840
840
|
```
|
|
841
841
|
|
|
842
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
842
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1435](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1435)
|
|
843
843
|
|
|
844
844
|
Filter values into a new list of the same class.
|
|
845
845
|
|
|
@@ -902,7 +902,7 @@ Time O(N), Space O(N)
|
|
|
902
902
|
find<S>(predicate, thisArg?): S | undefined;
|
|
903
903
|
```
|
|
904
904
|
|
|
905
|
-
Defined in: [data-structures/base/iterable-element-base.ts:163](https://github.com/zrwusa/data-structure-typed/blob/
|
|
905
|
+
Defined in: [data-structures/base/iterable-element-base.ts:163](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L163)
|
|
906
906
|
|
|
907
907
|
Finds the first element that satisfies the predicate and returns it.
|
|
908
908
|
|
|
@@ -948,7 +948,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
948
948
|
find(predicate, thisArg?): E | undefined;
|
|
949
949
|
```
|
|
950
950
|
|
|
951
|
-
Defined in: [data-structures/base/iterable-element-base.ts:164](https://github.com/zrwusa/data-structure-typed/blob/
|
|
951
|
+
Defined in: [data-structures/base/iterable-element-base.ts:164](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L164)
|
|
952
952
|
|
|
953
953
|
Finds the first element that satisfies the predicate and returns it.
|
|
954
954
|
|
|
@@ -990,7 +990,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
990
990
|
findIndex(predicate, thisArg?): number;
|
|
991
991
|
```
|
|
992
992
|
|
|
993
|
-
Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/
|
|
993
|
+
Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L151)
|
|
994
994
|
|
|
995
995
|
Find the first index matching a predicate.
|
|
996
996
|
|
|
@@ -1030,7 +1030,7 @@ Time O(n), Space O(1)
|
|
|
1030
1030
|
forEach(callbackfn, thisArg?): void;
|
|
1031
1031
|
```
|
|
1032
1032
|
|
|
1033
|
-
Defined in: [data-structures/base/iterable-element-base.ts:133](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1033
|
+
Defined in: [data-structures/base/iterable-element-base.ts:133](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L133)
|
|
1034
1034
|
|
|
1035
1035
|
Invokes a callback for each element in iteration order.
|
|
1036
1036
|
|
|
@@ -1070,7 +1070,7 @@ Time O(n), Space O(1).
|
|
|
1070
1070
|
getNode(elementNodeOrPredicate?): SinglyLinkedListNode<E> | undefined;
|
|
1071
1071
|
```
|
|
1072
1072
|
|
|
1073
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1073
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1137](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1137)
|
|
1074
1074
|
|
|
1075
1075
|
Find a node by value, reference, or predicate.
|
|
1076
1076
|
|
|
@@ -1106,7 +1106,7 @@ Time O(N), Space O(1)
|
|
|
1106
1106
|
getNodeAt(index): SinglyLinkedListNode<E> | undefined;
|
|
1107
1107
|
```
|
|
1108
1108
|
|
|
1109
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1109
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:753](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L753)
|
|
1110
1110
|
|
|
1111
1111
|
Get the node reference at a given index.
|
|
1112
1112
|
|
|
@@ -1150,7 +1150,7 @@ Time O(N), Space O(1)
|
|
|
1150
1150
|
has(element): boolean;
|
|
1151
1151
|
```
|
|
1152
1152
|
|
|
1153
|
-
Defined in: [data-structures/base/iterable-element-base.ts:189](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1153
|
+
Defined in: [data-structures/base/iterable-element-base.ts:189](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L189)
|
|
1154
1154
|
|
|
1155
1155
|
Checks whether a strictly-equal element exists in the structure.
|
|
1156
1156
|
|
|
@@ -1184,7 +1184,7 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1184
1184
|
indexOf(searchElement, fromIndex?): number;
|
|
1185
1185
|
```
|
|
1186
1186
|
|
|
1187
|
-
Defined in: [data-structures/base/linear-base.ts:422](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1187
|
+
Defined in: [data-structures/base/linear-base.ts:422](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L422)
|
|
1188
1188
|
|
|
1189
1189
|
Linked-list optimized `indexOf` (forwards scan).
|
|
1190
1190
|
|
|
@@ -1224,7 +1224,7 @@ Time O(n), Space O(1)
|
|
|
1224
1224
|
isEmpty(): boolean;
|
|
1225
1225
|
```
|
|
1226
1226
|
|
|
1227
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1227
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1007](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1007)
|
|
1228
1228
|
|
|
1229
1229
|
Check whether the list is empty.
|
|
1230
1230
|
|
|
@@ -1259,7 +1259,7 @@ Time O(1), Space O(1)
|
|
|
1259
1259
|
isNode(elementNodeOrPredicate): elementNodeOrPredicate is SinglyLinkedListNode<E>;
|
|
1260
1260
|
```
|
|
1261
1261
|
|
|
1262
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1262
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:700](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L700)
|
|
1263
1263
|
|
|
1264
1264
|
Type guard: check whether the input is a SinglyLinkedListNode.
|
|
1265
1265
|
|
|
@@ -1295,7 +1295,7 @@ Time O(1), Space O(1)
|
|
|
1295
1295
|
join(separator?): string;
|
|
1296
1296
|
```
|
|
1297
1297
|
|
|
1298
|
-
Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1298
|
+
Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L228)
|
|
1299
1299
|
|
|
1300
1300
|
Join all elements into a string.
|
|
1301
1301
|
|
|
@@ -1329,7 +1329,7 @@ Time O(n), Space O(n)
|
|
|
1329
1329
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1330
1330
|
```
|
|
1331
1331
|
|
|
1332
|
-
Defined in: [data-structures/base/linear-base.ts:448](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1332
|
+
Defined in: [data-structures/base/linear-base.ts:448](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L448)
|
|
1333
1333
|
|
|
1334
1334
|
Linked-list optimized `lastIndexOf` (reverse scan).
|
|
1335
1335
|
|
|
@@ -1372,7 +1372,7 @@ map<EM, RM>(
|
|
|
1372
1372
|
thisArg?): SinglyLinkedList<EM, RM>;
|
|
1373
1373
|
```
|
|
1374
1374
|
|
|
1375
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1375
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1515](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1515)
|
|
1376
1376
|
|
|
1377
1377
|
Map values into a new list (possibly different element type).
|
|
1378
1378
|
|
|
@@ -1439,7 +1439,7 @@ Time O(N), Space O(N)
|
|
|
1439
1439
|
mapSame(callback, thisArg?): this;
|
|
1440
1440
|
```
|
|
1441
1441
|
|
|
1442
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1442
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1450](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1450)
|
|
1443
1443
|
|
|
1444
1444
|
Map values into a new list of the same class.
|
|
1445
1445
|
|
|
@@ -1479,7 +1479,7 @@ Time O(N), Space O(N)
|
|
|
1479
1479
|
pop(): E | undefined;
|
|
1480
1480
|
```
|
|
1481
1481
|
|
|
1482
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1482
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:428](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L428)
|
|
1483
1483
|
|
|
1484
1484
|
Remove and return the tail element.
|
|
1485
1485
|
|
|
@@ -1526,7 +1526,7 @@ Time O(N), Space O(1)
|
|
|
1526
1526
|
print(): void;
|
|
1527
1527
|
```
|
|
1528
1528
|
|
|
1529
|
-
Defined in: [data-structures/base/iterable-element-base.ts:269](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1529
|
+
Defined in: [data-structures/base/iterable-element-base.ts:269](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L269)
|
|
1530
1530
|
|
|
1531
1531
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1532
1532
|
|
|
@@ -1552,7 +1552,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1552
1552
|
push(elementOrNode): boolean;
|
|
1553
1553
|
```
|
|
1554
1554
|
|
|
1555
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1555
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:355](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L355)
|
|
1556
1556
|
|
|
1557
1557
|
Append an element/node to the tail.
|
|
1558
1558
|
|
|
@@ -1607,7 +1607,7 @@ Time O(1), Space O(1)
|
|
|
1607
1607
|
pushMany(elements): boolean[];
|
|
1608
1608
|
```
|
|
1609
1609
|
|
|
1610
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1610
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:590](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L590)
|
|
1611
1611
|
|
|
1612
1612
|
Append a sequence of elements/nodes.
|
|
1613
1613
|
|
|
@@ -1675,7 +1675,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1675
1675
|
reduce(callbackfn): E;
|
|
1676
1676
|
```
|
|
1677
1677
|
|
|
1678
|
-
Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1678
|
+
Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L194)
|
|
1679
1679
|
|
|
1680
1680
|
##### Parameters
|
|
1681
1681
|
|
|
@@ -1697,7 +1697,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1697
1697
|
reduce(callbackfn, initialValue): E;
|
|
1698
1698
|
```
|
|
1699
1699
|
|
|
1700
|
-
Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1700
|
+
Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L195)
|
|
1701
1701
|
|
|
1702
1702
|
##### Parameters
|
|
1703
1703
|
|
|
@@ -1723,7 +1723,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1723
1723
|
reduce<U>(callbackfn, initialValue): U;
|
|
1724
1724
|
```
|
|
1725
1725
|
|
|
1726
|
-
Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1726
|
+
Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L196)
|
|
1727
1727
|
|
|
1728
1728
|
##### Type Parameters
|
|
1729
1729
|
|
|
@@ -1757,7 +1757,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1757
1757
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1758
1758
|
```
|
|
1759
1759
|
|
|
1760
|
-
Defined in: [data-structures/base/linear-base.ts:574](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1760
|
+
Defined in: [data-structures/base/linear-base.ts:574](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L574)
|
|
1761
1761
|
|
|
1762
1762
|
Right-to-left reduction using reverse iterator.
|
|
1763
1763
|
|
|
@@ -1803,7 +1803,7 @@ Time O(n), Space O(1)
|
|
|
1803
1803
|
reverse(): this;
|
|
1804
1804
|
```
|
|
1805
1805
|
|
|
1806
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1806
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1115](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1115)
|
|
1807
1807
|
|
|
1808
1808
|
Reverse the list in place.
|
|
1809
1809
|
|
|
@@ -1840,7 +1840,7 @@ Time O(N), Space O(1)
|
|
|
1840
1840
|
search(elementNodeOrPredicate): E | undefined;
|
|
1841
1841
|
```
|
|
1842
1842
|
|
|
1843
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1843
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:622](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L622)
|
|
1844
1844
|
|
|
1845
1845
|
Find the first value matching a predicate (by node).
|
|
1846
1846
|
|
|
@@ -1876,7 +1876,7 @@ Time O(N), Space O(1)
|
|
|
1876
1876
|
setAt(index, value): boolean;
|
|
1877
1877
|
```
|
|
1878
1878
|
|
|
1879
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1879
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:954](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L954)
|
|
1880
1880
|
|
|
1881
1881
|
Set the element value at an index.
|
|
1882
1882
|
|
|
@@ -1916,7 +1916,7 @@ Time O(N), Space O(1)
|
|
|
1916
1916
|
setEquality(equals): this;
|
|
1917
1917
|
```
|
|
1918
1918
|
|
|
1919
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1919
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1283](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1283)
|
|
1920
1920
|
|
|
1921
1921
|
Set the equality comparator used to compare values.
|
|
1922
1922
|
|
|
@@ -1950,7 +1950,7 @@ Time O(1), Space O(1)
|
|
|
1950
1950
|
shift(): E | undefined;
|
|
1951
1951
|
```
|
|
1952
1952
|
|
|
1953
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
1953
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:496](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L496)
|
|
1954
1954
|
|
|
1955
1955
|
Remove and return the head element.
|
|
1956
1956
|
|
|
@@ -1987,7 +1987,7 @@ Time O(1), Space O(1)
|
|
|
1987
1987
|
slice(start?, end?): this;
|
|
1988
1988
|
```
|
|
1989
1989
|
|
|
1990
|
-
Defined in: [data-structures/base/linear-base.ts:494](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1990
|
+
Defined in: [data-structures/base/linear-base.ts:494](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L494)
|
|
1991
1991
|
|
|
1992
1992
|
Slice via forward iteration (no random access required).
|
|
1993
1993
|
|
|
@@ -2027,7 +2027,7 @@ Time O(n), Space O(n)
|
|
|
2027
2027
|
some(predicate, thisArg?): boolean;
|
|
2028
2028
|
```
|
|
2029
2029
|
|
|
2030
|
-
Defined in: [data-structures/base/iterable-element-base.ts:110](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2030
|
+
Defined in: [data-structures/base/iterable-element-base.ts:110](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L110)
|
|
2031
2031
|
|
|
2032
2032
|
Tests whether at least one element satisfies the predicate.
|
|
2033
2033
|
|
|
@@ -2067,7 +2067,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
2067
2067
|
sort(compareFn?): this;
|
|
2068
2068
|
```
|
|
2069
2069
|
|
|
2070
|
-
Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2070
|
+
Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L185)
|
|
2071
2071
|
|
|
2072
2072
|
In-place stable order via array sort semantics.
|
|
2073
2073
|
|
|
@@ -2104,7 +2104,7 @@ splice(
|
|
|
2104
2104
|
items?): this;
|
|
2105
2105
|
```
|
|
2106
2106
|
|
|
2107
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2107
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1209](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1209)
|
|
2108
2108
|
|
|
2109
2109
|
Remove and/or insert elements at a position (array-like behavior).
|
|
2110
2110
|
|
|
@@ -2150,7 +2150,7 @@ Time O(N + M), Space O(M)
|
|
|
2150
2150
|
toArray(): E[];
|
|
2151
2151
|
```
|
|
2152
2152
|
|
|
2153
|
-
Defined in: [data-structures/base/iterable-element-base.ts:246](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2153
|
+
Defined in: [data-structures/base/iterable-element-base.ts:246](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L246)
|
|
2154
2154
|
|
|
2155
2155
|
Materializes the elements into a new array.
|
|
2156
2156
|
|
|
@@ -2176,7 +2176,7 @@ Time O(n), Space O(n).
|
|
|
2176
2176
|
toReversedArray(): E[];
|
|
2177
2177
|
```
|
|
2178
2178
|
|
|
2179
|
-
Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2179
|
+
Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L237)
|
|
2180
2180
|
|
|
2181
2181
|
Snapshot elements into a reversed array.
|
|
2182
2182
|
|
|
@@ -2202,7 +2202,7 @@ Time O(n), Space O(n)
|
|
|
2202
2202
|
toVisual(): E[];
|
|
2203
2203
|
```
|
|
2204
2204
|
|
|
2205
|
-
Defined in: [data-structures/base/iterable-element-base.ts:258](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2205
|
+
Defined in: [data-structures/base/iterable-element-base.ts:258](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L258)
|
|
2206
2206
|
|
|
2207
2207
|
Returns a representation of the structure suitable for quick visualization.
|
|
2208
2208
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -2229,7 +2229,7 @@ Time O(n), Space O(n).
|
|
|
2229
2229
|
unshift(elementOrNode): boolean;
|
|
2230
2230
|
```
|
|
2231
2231
|
|
|
2232
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2232
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:571](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L571)
|
|
2233
2233
|
|
|
2234
2234
|
Prepend an element/node to the head.
|
|
2235
2235
|
|
|
@@ -2289,7 +2289,7 @@ Time O(1), Space O(1)
|
|
|
2289
2289
|
unshiftMany(elements): boolean[];
|
|
2290
2290
|
```
|
|
2291
2291
|
|
|
2292
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2292
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:606](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L606)
|
|
2293
2293
|
|
|
2294
2294
|
Prepend a sequence of elements/nodes.
|
|
2295
2295
|
|
|
@@ -2325,7 +2325,7 @@ Time O(N), Space O(1)
|
|
|
2325
2325
|
values(): IterableIterator<E>;
|
|
2326
2326
|
```
|
|
2327
2327
|
|
|
2328
|
-
Defined in: [data-structures/base/iterable-element-base.ts:72](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2328
|
+
Defined in: [data-structures/base/iterable-element-base.ts:72](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L72)
|
|
2329
2329
|
|
|
2330
2330
|
Returns an iterator over the values (alias of the default iterator).
|
|
2331
2331
|
|
|
@@ -2354,7 +2354,7 @@ static from<E, R, S>(
|
|
|
2354
2354
|
options?): S;
|
|
2355
2355
|
```
|
|
2356
2356
|
|
|
2357
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:281](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2357
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:281](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L281)
|
|
2358
2358
|
|
|
2359
2359
|
Create a new list from an iterable of elements.
|
|
2360
2360
|
|
|
@@ -2417,7 +2417,7 @@ Time O(N), Space O(N)
|
|
|
2417
2417
|
protected optional _toElementFn?: (rawElement) => E;
|
|
2418
2418
|
```
|
|
2419
2419
|
|
|
2420
|
-
Defined in: [data-structures/base/iterable-element-base.ts:39](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2420
|
+
Defined in: [data-structures/base/iterable-element-base.ts:39](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L39)
|
|
2421
2421
|
|
|
2422
2422
|
The converter used to transform a raw element (`R`) into a public element (`E`).
|
|
2423
2423
|
|
|
@@ -2447,7 +2447,7 @@ Time O(1), Space O(1).
|
|
|
2447
2447
|
protected _createInstance(options?): this;
|
|
2448
2448
|
```
|
|
2449
2449
|
|
|
2450
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2450
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1638](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1638)
|
|
2451
2451
|
|
|
2452
2452
|
(Protected) Create an empty instance of the same concrete class.
|
|
2453
2453
|
|
|
@@ -2481,7 +2481,7 @@ Time O(1), Space O(1)
|
|
|
2481
2481
|
protected _createLike<EM, RM>(elements?, options?): SinglyLinkedList<EM, RM>;
|
|
2482
2482
|
```
|
|
2483
2483
|
|
|
2484
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2484
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1656)
|
|
2485
2485
|
|
|
2486
2486
|
(Protected) Create a like-kind instance and seed it from an iterable.
|
|
2487
2487
|
|
|
@@ -2533,7 +2533,7 @@ Time O(N), Space O(N)
|
|
|
2533
2533
|
protected _ensureNode(elementOrNode): SinglyLinkedListNode<E>;
|
|
2534
2534
|
```
|
|
2535
2535
|
|
|
2536
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2536
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1557](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1557)
|
|
2537
2537
|
|
|
2538
2538
|
(Protected) Normalize input into a node instance.
|
|
2539
2539
|
|
|
@@ -2567,7 +2567,7 @@ Time O(1), Space O(1)
|
|
|
2567
2567
|
protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
|
|
2568
2568
|
```
|
|
2569
2569
|
|
|
2570
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2570
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1569](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1569)
|
|
2571
2571
|
|
|
2572
2572
|
(Protected) Normalize input into a node predicate.
|
|
2573
2573
|
|
|
@@ -2603,7 +2603,7 @@ Time O(1), Space O(1)
|
|
|
2603
2603
|
protected _getIterator(): IterableIterator<E>;
|
|
2604
2604
|
```
|
|
2605
2605
|
|
|
2606
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2606
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1598](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1598)
|
|
2607
2607
|
|
|
2608
2608
|
(Protected) Iterate values from head to tail.
|
|
2609
2609
|
|
|
@@ -2629,7 +2629,7 @@ Time O(N), Space O(1)
|
|
|
2629
2629
|
protected _getNodeIterator(): IterableIterator<SinglyLinkedListNode<E>>;
|
|
2630
2630
|
```
|
|
2631
2631
|
|
|
2632
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2632
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1623](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1623)
|
|
2633
2633
|
|
|
2634
2634
|
(Protected) Iterate nodes from head to tail.
|
|
2635
2635
|
|
|
@@ -2655,7 +2655,7 @@ Time O(N), Space O(1)
|
|
|
2655
2655
|
protected _getPrevNode(node): SinglyLinkedListNode<E> | undefined;
|
|
2656
2656
|
```
|
|
2657
2657
|
|
|
2658
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2658
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1585](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1585)
|
|
2659
2659
|
|
|
2660
2660
|
(Protected) Get the previous node of a given node.
|
|
2661
2661
|
|
|
@@ -2689,7 +2689,7 @@ Time O(N), Space O(1)
|
|
|
2689
2689
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2690
2690
|
```
|
|
2691
2691
|
|
|
2692
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2692
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1612](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1612)
|
|
2693
2693
|
|
|
2694
2694
|
(Protected) Iterate values from tail to head.
|
|
2695
2695
|
|
|
@@ -2715,7 +2715,7 @@ Time O(N), Space O(N)
|
|
|
2715
2715
|
protected _isPredicate(elementNodeOrPredicate): elementNodeOrPredicate is (node: SinglyLinkedListNode<E>) => boolean;
|
|
2716
2716
|
```
|
|
2717
2717
|
|
|
2718
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2718
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1544](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1544)
|
|
2719
2719
|
|
|
2720
2720
|
(Protected) Check if input is a node predicate function.
|
|
2721
2721
|
|
|
@@ -2751,7 +2751,7 @@ Time O(1), Space O(1)
|
|
|
2751
2751
|
protected _spawnLike<EM, RM>(options?): SinglyLinkedList<EM, RM>;
|
|
2752
2752
|
```
|
|
2753
2753
|
|
|
2754
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2754
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1676](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1676)
|
|
2755
2755
|
|
|
2756
2756
|
(Protected) Spawn an empty like-kind list instance.
|
|
2757
2757
|
|
|
@@ -2795,7 +2795,7 @@ Time O(1), Space O(1)
|
|
|
2795
2795
|
protected createNode(value): SinglyLinkedListNode<E>;
|
|
2796
2796
|
```
|
|
2797
2797
|
|
|
2798
|
-
Defined in: [data-structures/linked-list/singly-linked-list.ts:
|
|
2798
|
+
Defined in: [data-structures/linked-list/singly-linked-list.ts:1533](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1533)
|
|
2799
2799
|
|
|
2800
2800
|
(Protected) Create a node from a value.
|
|
2801
2801
|
|