data-structure-typed 2.5.1 → 2.5.2
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/README.md +75 -17
- package/dist/cjs/binary-tree.cjs +2723 -139
- package/dist/cjs/graph.cjs +192 -6
- package/dist/cjs/hash.cjs +63 -15
- package/dist/cjs/heap.cjs +93 -31
- package/dist/cjs/index.cjs +3514 -379
- package/dist/cjs/linked-list.cjs +237 -31
- package/dist/cjs/matrix.cjs +47 -9
- package/dist/cjs/priority-queue.cjs +92 -30
- package/dist/cjs/queue.cjs +176 -2
- package/dist/cjs/stack.cjs +48 -2
- package/dist/cjs/trie.cjs +78 -28
- package/dist/cjs-legacy/binary-tree.cjs +2725 -136
- package/dist/cjs-legacy/graph.cjs +192 -6
- package/dist/cjs-legacy/hash.cjs +63 -15
- package/dist/cjs-legacy/heap.cjs +93 -31
- package/dist/cjs-legacy/index.cjs +3389 -249
- package/dist/cjs-legacy/linked-list.cjs +237 -31
- package/dist/cjs-legacy/matrix.cjs +47 -9
- package/dist/cjs-legacy/priority-queue.cjs +92 -30
- package/dist/cjs-legacy/queue.cjs +176 -2
- package/dist/cjs-legacy/stack.cjs +48 -2
- package/dist/cjs-legacy/trie.cjs +78 -28
- package/dist/esm/binary-tree.mjs +2723 -139
- package/dist/esm/graph.mjs +192 -6
- package/dist/esm/hash.mjs +63 -15
- package/dist/esm/heap.mjs +93 -31
- package/dist/esm/index.mjs +3514 -380
- package/dist/esm/linked-list.mjs +237 -31
- package/dist/esm/matrix.mjs +47 -9
- package/dist/esm/priority-queue.mjs +92 -30
- package/dist/esm/queue.mjs +176 -2
- package/dist/esm/stack.mjs +48 -2
- package/dist/esm/trie.mjs +78 -28
- package/dist/esm-legacy/binary-tree.mjs +2725 -136
- package/dist/esm-legacy/graph.mjs +192 -6
- package/dist/esm-legacy/hash.mjs +63 -15
- package/dist/esm-legacy/heap.mjs +93 -31
- package/dist/esm-legacy/index.mjs +3389 -250
- package/dist/esm-legacy/linked-list.mjs +237 -31
- package/dist/esm-legacy/matrix.mjs +47 -9
- package/dist/esm-legacy/priority-queue.mjs +92 -30
- package/dist/esm-legacy/queue.mjs +176 -2
- package/dist/esm-legacy/stack.mjs +48 -2
- package/dist/esm-legacy/trie.mjs +78 -28
- package/dist/types/common/error.d.ts +9 -0
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +48 -0
- 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 +102 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +195 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +76 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +528 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +531 -6
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +435 -6
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +505 -0
- 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 +44 -0
- package/dist/types/data-structures/heap/heap.d.ts +56 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +68 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +60 -0
- 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 +60 -0
- package/dist/types/data-structures/queue/queue.d.ts +48 -0
- package/dist/types/data-structures/stack/stack.d.ts +40 -0
- package/dist/types/data-structures/trie/trie.d.ts +48 -0
- package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
- package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
- package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
- package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
- package/dist/umd/data-structure-typed.js +3404 -265
- package/dist/umd/data-structure-typed.min.js +5 -5
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +650 -136
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
- package/docs-site-docusaurus/docs/api/classes/BST.md +591 -129
- 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 +107 -107
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- 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 +47 -47
- package/docs-site-docusaurus/docs/api/classes/Heap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +49 -49
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +44 -44
- package/docs-site-docusaurus/docs/api/classes/Queue.md +60 -60
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +660 -146
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +78 -78
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
- package/docs-site-docusaurus/docs/api/classes/Stack.md +39 -39
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +165 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +161 -32
- package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
- package/docs-site-docusaurus/docs/guide/architecture.md +2 -0
- package/docs-site-docusaurus/docs/guide/concepts.md +32 -1
- package/docs-site-docusaurus/docs/guide/faq.md +180 -0
- package/docs-site-docusaurus/docs/guide/guides.md +40 -54
- package/docs-site-docusaurus/docs/guide/installation.md +2 -0
- package/docs-site-docusaurus/docs/guide/integrations.md +2 -0
- package/docs-site-docusaurus/docs/guide/overview.md +7 -0
- package/docs-site-docusaurus/docs/guide/performance.md +2 -0
- package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
- package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
- package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
- package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
- package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
- package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
- package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
- package/docs-site-docusaurus/docusaurus.config.ts +1 -1
- package/docs-site-docusaurus/src/pages/index.tsx +51 -2
- package/docs-site-docusaurus/static/llms.txt +37 -0
- package/llms.txt +37 -0
- package/package.json +64 -56
- package/src/common/error.ts +19 -1
- package/src/common/index.ts +1 -1
- package/src/data-structures/base/iterable-element-base.ts +3 -2
- package/src/data-structures/binary-tree/avl-tree.ts +47 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +46 -4
- package/src/data-structures/binary-tree/binary-tree.ts +79 -4
- package/src/data-structures/binary-tree/bst.ts +441 -6
- package/src/data-structures/binary-tree/red-black-tree.ts +73 -0
- package/src/data-structures/binary-tree/segment-tree.ts +18 -0
- package/src/data-structures/binary-tree/tree-map.ts +434 -9
- package/src/data-structures/binary-tree/tree-multi-map.ts +426 -5
- package/src/data-structures/binary-tree/tree-multi-set.ts +350 -6
- package/src/data-structures/binary-tree/tree-set.ts +410 -8
- package/src/data-structures/graph/abstract-graph.ts +2 -2
- package/src/data-structures/graph/directed-graph.ts +30 -0
- package/src/data-structures/graph/undirected-graph.ts +27 -0
- package/src/data-structures/hash/hash-map.ts +35 -4
- package/src/data-structures/heap/heap.ts +46 -4
- package/src/data-structures/heap/max-heap.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +51 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +59 -5
- package/src/data-structures/matrix/matrix.ts +33 -9
- package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
- package/src/data-structures/queue/deque.ts +45 -0
- package/src/data-structures/queue/queue.ts +36 -0
- package/src/data-structures/stack/stack.ts +30 -0
- package/src/data-structures/trie/trie.ts +38 -2
- package/src/types/data-structures/binary-tree/bst.ts +1 -0
- package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
- package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
- package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DoublyLinkedList\<E, R\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:150](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:150](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L150)
|
|
10
10
|
|
|
11
11
|
Doubly linked list with O(1) push/pop/unshift/shift and linear scans.
|
|
12
12
|
|
|
@@ -112,7 +112,7 @@ Caution: Although our linked list classes provide methods such as at, setAt, add
|
|
|
112
112
|
new DoublyLinkedList<E, R>(elements?, options?): DoublyLinkedList<E, R>;
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:161](https://github.com/zrwusa/data-structure-typed/blob/
|
|
115
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:161](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L161)
|
|
116
116
|
|
|
117
117
|
Create a DoublyLinkedList and optionally bulk-insert elements.
|
|
118
118
|
|
|
@@ -158,7 +158,7 @@ LinearLinkedBase<E, R, DoublyLinkedListNode<E>>.constructor
|
|
|
158
158
|
get first(): E | undefined;
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:219](https://github.com/zrwusa/data-structure-typed/blob/
|
|
161
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:219](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L219)
|
|
162
162
|
|
|
163
163
|
Get the first element value.
|
|
164
164
|
|
|
@@ -182,7 +182,7 @@ First element or undefined.
|
|
|
182
182
|
get head(): DoublyLinkedListNode<E> | undefined;
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
185
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:185](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L185)
|
|
186
186
|
|
|
187
187
|
Get the head node.
|
|
188
188
|
|
|
@@ -206,7 +206,7 @@ Head node or undefined.
|
|
|
206
206
|
get last(): E | undefined;
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:229](https://github.com/zrwusa/data-structure-typed/blob/
|
|
209
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:229](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L229)
|
|
210
210
|
|
|
211
211
|
Get the last element value.
|
|
212
212
|
|
|
@@ -230,7 +230,7 @@ Last element or undefined.
|
|
|
230
230
|
get length(): number;
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:209](https://github.com/zrwusa/data-structure-typed/blob/
|
|
233
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:209](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L209)
|
|
234
234
|
|
|
235
235
|
Get the number of elements.
|
|
236
236
|
|
|
@@ -258,7 +258,7 @@ Current length.
|
|
|
258
258
|
get maxLen(): number;
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
Defined in: [data-structures/base/linear-base.ts:100](https://github.com/zrwusa/data-structure-typed/blob/
|
|
261
|
+
Defined in: [data-structures/base/linear-base.ts:100](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L100)
|
|
262
262
|
|
|
263
263
|
Upper bound for length (if positive), or `-1` when unbounded.
|
|
264
264
|
|
|
@@ -286,7 +286,7 @@ Maximum allowed length.
|
|
|
286
286
|
get tail(): DoublyLinkedListNode<E> | undefined;
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:197](https://github.com/zrwusa/data-structure-typed/blob/
|
|
289
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:197](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L197)
|
|
290
290
|
|
|
291
291
|
Get the tail node.
|
|
292
292
|
|
|
@@ -310,7 +310,7 @@ Tail node or undefined.
|
|
|
310
310
|
get toElementFn(): ((rawElement) => E) | undefined;
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
313
|
+
Defined in: [data-structures/base/iterable-element-base.ts:48](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L48)
|
|
314
314
|
|
|
315
315
|
Exposes the current `toElementFn`, if configured.
|
|
316
316
|
|
|
@@ -336,7 +336,7 @@ The converter function or `undefined` when not set.
|
|
|
336
336
|
iterator: IterableIterator<E>;
|
|
337
337
|
```
|
|
338
338
|
|
|
339
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
339
|
+
Defined in: [data-structures/base/iterable-element-base.ts:61](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L61)
|
|
340
340
|
|
|
341
341
|
Returns an iterator over the structure's elements.
|
|
342
342
|
|
|
@@ -370,7 +370,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
370
370
|
addAfter(existingElementOrNode, newElementOrNode): boolean;
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
373
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:801](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L801)
|
|
374
374
|
|
|
375
375
|
Insert a new element/node after an existing one.
|
|
376
376
|
|
|
@@ -410,7 +410,7 @@ Time O(N), Space O(1)
|
|
|
410
410
|
addAt(index, newElementOrNode): boolean;
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
413
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:750](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L750)
|
|
414
414
|
|
|
415
415
|
Insert a new element/node at an index, shifting following nodes.
|
|
416
416
|
|
|
@@ -461,7 +461,7 @@ Time O(N), Space O(1)
|
|
|
461
461
|
addBefore(existingElementOrNode, newElementOrNode): boolean;
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
464
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:774](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L774)
|
|
465
465
|
|
|
466
466
|
Insert a new element/node before an existing one.
|
|
467
467
|
|
|
@@ -501,7 +501,7 @@ Time O(N), Space O(1)
|
|
|
501
501
|
at(index): E | undefined;
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
504
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:609](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L609)
|
|
505
505
|
|
|
506
506
|
Get the element at a given index.
|
|
507
507
|
|
|
@@ -546,7 +546,7 @@ Time O(N), Space O(1)
|
|
|
546
546
|
clear(): void;
|
|
547
547
|
```
|
|
548
548
|
|
|
549
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
549
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1040](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1040)
|
|
550
550
|
|
|
551
551
|
Remove all nodes and reset length.
|
|
552
552
|
|
|
@@ -583,7 +583,7 @@ Time O(N), Space O(1)
|
|
|
583
583
|
clone(): this;
|
|
584
584
|
```
|
|
585
585
|
|
|
586
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
586
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1273](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1273)
|
|
587
587
|
|
|
588
588
|
Deep clone this list (values are copied by reference).
|
|
589
589
|
|
|
@@ -621,7 +621,7 @@ Time O(N), Space O(N)
|
|
|
621
621
|
concat(...items): this;
|
|
622
622
|
```
|
|
623
623
|
|
|
624
|
-
Defined in: [data-structures/base/linear-base.ts:473](https://github.com/zrwusa/data-structure-typed/blob/
|
|
624
|
+
Defined in: [data-structures/base/linear-base.ts:473](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L473)
|
|
625
625
|
|
|
626
626
|
Concatenate lists/elements preserving order.
|
|
627
627
|
|
|
@@ -657,7 +657,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
657
657
|
delete(elementOrNode?): boolean;
|
|
658
658
|
```
|
|
659
659
|
|
|
660
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
660
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:934](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L934)
|
|
661
661
|
|
|
662
662
|
Delete the first match by value/node.
|
|
663
663
|
|
|
@@ -702,7 +702,7 @@ Time O(N), Space O(1)
|
|
|
702
702
|
deleteAt(index): E | undefined;
|
|
703
703
|
```
|
|
704
704
|
|
|
705
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
705
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:876](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L876)
|
|
706
706
|
|
|
707
707
|
Delete the element at an index.
|
|
708
708
|
|
|
@@ -747,7 +747,7 @@ Time O(N), Space O(1)
|
|
|
747
747
|
every(predicate, thisArg?): boolean;
|
|
748
748
|
```
|
|
749
749
|
|
|
750
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
750
|
+
Defined in: [data-structures/base/iterable-element-base.ts:87](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L87)
|
|
751
751
|
|
|
752
752
|
Tests whether all elements satisfy the predicate.
|
|
753
753
|
|
|
@@ -790,7 +790,7 @@ fill(
|
|
|
790
790
|
end?): this;
|
|
791
791
|
```
|
|
792
792
|
|
|
793
|
-
Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/
|
|
793
|
+
Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L292)
|
|
794
794
|
|
|
795
795
|
Fill a range with a value.
|
|
796
796
|
|
|
@@ -836,7 +836,7 @@ Time O(n), Space O(1)
|
|
|
836
836
|
filter(callback, thisArg?): this;
|
|
837
837
|
```
|
|
838
838
|
|
|
839
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
839
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1327](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1327)
|
|
840
840
|
|
|
841
841
|
Filter values into a new list of the same class.
|
|
842
842
|
|
|
@@ -850,7 +850,7 @@ Predicate (value, index, list) → boolean to keep value.
|
|
|
850
850
|
|
|
851
851
|
##### thisArg?
|
|
852
852
|
|
|
853
|
-
`
|
|
853
|
+
`unknown`
|
|
854
854
|
|
|
855
855
|
Value for `this` inside the callback.
|
|
856
856
|
|
|
@@ -889,7 +889,7 @@ Time O(N), Space O(N)
|
|
|
889
889
|
find<S>(predicate, thisArg?): S | undefined;
|
|
890
890
|
```
|
|
891
891
|
|
|
892
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
892
|
+
Defined in: [data-structures/base/iterable-element-base.ts:163](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L163)
|
|
893
893
|
|
|
894
894
|
Finds the first element that satisfies the predicate and returns it.
|
|
895
895
|
|
|
@@ -935,7 +935,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
935
935
|
find(predicate, thisArg?): E | undefined;
|
|
936
936
|
```
|
|
937
937
|
|
|
938
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
938
|
+
Defined in: [data-structures/base/iterable-element-base.ts:164](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L164)
|
|
939
939
|
|
|
940
940
|
Finds the first element that satisfies the predicate and returns it.
|
|
941
941
|
|
|
@@ -977,7 +977,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
977
977
|
findIndex(predicate, thisArg?): number;
|
|
978
978
|
```
|
|
979
979
|
|
|
980
|
-
Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/
|
|
980
|
+
Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L151)
|
|
981
981
|
|
|
982
982
|
Find the first index matching a predicate.
|
|
983
983
|
|
|
@@ -991,7 +991,7 @@ Find the first index matching a predicate.
|
|
|
991
991
|
|
|
992
992
|
##### thisArg?
|
|
993
993
|
|
|
994
|
-
`
|
|
994
|
+
`unknown`
|
|
995
995
|
|
|
996
996
|
Optional `this` for callback.
|
|
997
997
|
|
|
@@ -1017,7 +1017,7 @@ Time O(n), Space O(1)
|
|
|
1017
1017
|
forEach(callbackfn, thisArg?): void;
|
|
1018
1018
|
```
|
|
1019
1019
|
|
|
1020
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1020
|
+
Defined in: [data-structures/base/iterable-element-base.ts:133](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L133)
|
|
1021
1021
|
|
|
1022
1022
|
Invokes a callback for each element in iteration order.
|
|
1023
1023
|
|
|
@@ -1057,7 +1057,7 @@ Time O(n), Space O(1).
|
|
|
1057
1057
|
getBackward(elementNodeOrPredicate): E | undefined;
|
|
1058
1058
|
```
|
|
1059
1059
|
|
|
1060
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1060
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1147](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1147)
|
|
1061
1061
|
|
|
1062
1062
|
Find the first value matching a predicate scanning backward.
|
|
1063
1063
|
|
|
@@ -1101,7 +1101,7 @@ Time O(N), Space O(1)
|
|
|
1101
1101
|
getNode(elementNodeOrPredicate?): DoublyLinkedListNode<E> | undefined;
|
|
1102
1102
|
```
|
|
1103
1103
|
|
|
1104
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1104
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:673](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L673)
|
|
1105
1105
|
|
|
1106
1106
|
Find a node by value, reference, or predicate.
|
|
1107
1107
|
|
|
@@ -1133,7 +1133,7 @@ Time O(N), Space O(1)
|
|
|
1133
1133
|
getNodeAt(index): DoublyLinkedListNode<E> | undefined;
|
|
1134
1134
|
```
|
|
1135
1135
|
|
|
1136
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1136
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:659](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L659)
|
|
1137
1137
|
|
|
1138
1138
|
Get the node reference at a given index.
|
|
1139
1139
|
|
|
@@ -1177,7 +1177,7 @@ Time O(N), Space O(1)
|
|
|
1177
1177
|
has(element): boolean;
|
|
1178
1178
|
```
|
|
1179
1179
|
|
|
1180
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1180
|
+
Defined in: [data-structures/base/iterable-element-base.ts:189](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L189)
|
|
1181
1181
|
|
|
1182
1182
|
Checks whether a strictly-equal element exists in the structure.
|
|
1183
1183
|
|
|
@@ -1211,7 +1211,7 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1211
1211
|
indexOf(searchElement, fromIndex?): number;
|
|
1212
1212
|
```
|
|
1213
1213
|
|
|
1214
|
-
Defined in: [data-structures/base/linear-base.ts:422](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1214
|
+
Defined in: [data-structures/base/linear-base.ts:422](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L422)
|
|
1215
1215
|
|
|
1216
1216
|
Linked-list optimized `indexOf` (forwards scan).
|
|
1217
1217
|
|
|
@@ -1251,7 +1251,7 @@ Time O(n), Space O(1)
|
|
|
1251
1251
|
isEmpty(): boolean;
|
|
1252
1252
|
```
|
|
1253
1253
|
|
|
1254
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1254
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:992](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L992)
|
|
1255
1255
|
|
|
1256
1256
|
Check whether the list is empty.
|
|
1257
1257
|
|
|
@@ -1286,7 +1286,7 @@ Time O(1), Space O(1)
|
|
|
1286
1286
|
isNode(elementNodeOrPredicate): elementNodeOrPredicate is DoublyLinkedListNode<E>;
|
|
1287
1287
|
```
|
|
1288
1288
|
|
|
1289
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:260](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1289
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:260](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L260)
|
|
1290
1290
|
|
|
1291
1291
|
Type guard: check whether the input is a DoublyLinkedListNode.
|
|
1292
1292
|
|
|
@@ -1318,7 +1318,7 @@ Time O(1), Space O(1)
|
|
|
1318
1318
|
join(separator?): string;
|
|
1319
1319
|
```
|
|
1320
1320
|
|
|
1321
|
-
Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1321
|
+
Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L228)
|
|
1322
1322
|
|
|
1323
1323
|
Join all elements into a string.
|
|
1324
1324
|
|
|
@@ -1352,7 +1352,7 @@ Time O(n), Space O(n)
|
|
|
1352
1352
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1353
1353
|
```
|
|
1354
1354
|
|
|
1355
|
-
Defined in: [data-structures/base/linear-base.ts:448](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1355
|
+
Defined in: [data-structures/base/linear-base.ts:448](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L448)
|
|
1356
1356
|
|
|
1357
1357
|
Linked-list optimized `lastIndexOf` (reverse scan).
|
|
1358
1358
|
|
|
@@ -1395,7 +1395,7 @@ map<EM, RM>(
|
|
|
1395
1395
|
thisArg?): DoublyLinkedList<EM, RM>;
|
|
1396
1396
|
```
|
|
1397
1397
|
|
|
1398
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1398
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1412](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1412)
|
|
1399
1399
|
|
|
1400
1400
|
Map values into a new list (possibly different element type).
|
|
1401
1401
|
|
|
@@ -1425,7 +1425,7 @@ Options for the output list (e.g., maxLen, toElementFn).
|
|
|
1425
1425
|
|
|
1426
1426
|
##### thisArg?
|
|
1427
1427
|
|
|
1428
|
-
`
|
|
1428
|
+
`unknown`
|
|
1429
1429
|
|
|
1430
1430
|
Value for `this` inside the callback.
|
|
1431
1431
|
|
|
@@ -1471,7 +1471,7 @@ Time O(N), Space O(N)
|
|
|
1471
1471
|
mapSame(callback, thisArg?): this;
|
|
1472
1472
|
```
|
|
1473
1473
|
|
|
1474
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1474
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1342](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1342)
|
|
1475
1475
|
|
|
1476
1476
|
Map values into a new list of the same class.
|
|
1477
1477
|
|
|
@@ -1485,7 +1485,7 @@ Mapping function (value, index, list) → newValue.
|
|
|
1485
1485
|
|
|
1486
1486
|
##### thisArg?
|
|
1487
1487
|
|
|
1488
|
-
`
|
|
1488
|
+
`unknown`
|
|
1489
1489
|
|
|
1490
1490
|
Value for `this` inside the callback.
|
|
1491
1491
|
|
|
@@ -1511,7 +1511,7 @@ Time O(N), Space O(N)
|
|
|
1511
1511
|
pop(): E | undefined;
|
|
1512
1512
|
```
|
|
1513
1513
|
|
|
1514
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1514
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:394](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L394)
|
|
1515
1515
|
|
|
1516
1516
|
Remove and return the tail element.
|
|
1517
1517
|
|
|
@@ -1554,7 +1554,7 @@ Time O(1), Space O(1)
|
|
|
1554
1554
|
print(): void;
|
|
1555
1555
|
```
|
|
1556
1556
|
|
|
1557
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1557
|
+
Defined in: [data-structures/base/iterable-element-base.ts:269](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L269)
|
|
1558
1558
|
|
|
1559
1559
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1560
1560
|
|
|
@@ -1580,7 +1580,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1580
1580
|
push(elementOrNode): boolean;
|
|
1581
1581
|
```
|
|
1582
1582
|
|
|
1583
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1583
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:323](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L323)
|
|
1584
1584
|
|
|
1585
1585
|
Append an element/node to the tail.
|
|
1586
1586
|
|
|
@@ -1635,7 +1635,7 @@ Time O(1), Space O(1)
|
|
|
1635
1635
|
pushMany(elements): boolean[];
|
|
1636
1636
|
```
|
|
1637
1637
|
|
|
1638
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1638
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:537](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L537)
|
|
1639
1639
|
|
|
1640
1640
|
Append a sequence of elements/nodes.
|
|
1641
1641
|
|
|
@@ -1703,7 +1703,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1703
1703
|
reduce(callbackfn): E;
|
|
1704
1704
|
```
|
|
1705
1705
|
|
|
1706
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1706
|
+
Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L194)
|
|
1707
1707
|
|
|
1708
1708
|
##### Parameters
|
|
1709
1709
|
|
|
@@ -1725,7 +1725,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:193](https://github.c
|
|
|
1725
1725
|
reduce(callbackfn, initialValue): E;
|
|
1726
1726
|
```
|
|
1727
1727
|
|
|
1728
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1728
|
+
Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L195)
|
|
1729
1729
|
|
|
1730
1730
|
##### Parameters
|
|
1731
1731
|
|
|
@@ -1751,7 +1751,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1751
1751
|
reduce<U>(callbackfn, initialValue): U;
|
|
1752
1752
|
```
|
|
1753
1753
|
|
|
1754
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1754
|
+
Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L196)
|
|
1755
1755
|
|
|
1756
1756
|
##### Type Parameters
|
|
1757
1757
|
|
|
@@ -1785,7 +1785,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1785
1785
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1786
1786
|
```
|
|
1787
1787
|
|
|
1788
|
-
Defined in: [data-structures/base/linear-base.ts:574](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1788
|
+
Defined in: [data-structures/base/linear-base.ts:574](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L574)
|
|
1789
1789
|
|
|
1790
1790
|
Right-to-left reduction using reverse iterator.
|
|
1791
1791
|
|
|
@@ -1831,7 +1831,7 @@ Time O(n), Space O(1)
|
|
|
1831
1831
|
reverse(): this;
|
|
1832
1832
|
```
|
|
1833
1833
|
|
|
1834
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1834
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1205](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1205)
|
|
1835
1835
|
|
|
1836
1836
|
Reverse the list in place.
|
|
1837
1837
|
|
|
@@ -1868,7 +1868,7 @@ Time O(N), Space O(1)
|
|
|
1868
1868
|
search(elementNodeOrPredicate): E | undefined;
|
|
1869
1869
|
```
|
|
1870
1870
|
|
|
1871
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1871
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1090](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1090)
|
|
1872
1872
|
|
|
1873
1873
|
Find the first value matching a predicate scanning forward.
|
|
1874
1874
|
|
|
@@ -1911,7 +1911,7 @@ Time O(N), Space O(1)
|
|
|
1911
1911
|
setAt(index, value): boolean;
|
|
1912
1912
|
```
|
|
1913
1913
|
|
|
1914
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1914
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:825](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L825)
|
|
1915
1915
|
|
|
1916
1916
|
Set the element value at an index.
|
|
1917
1917
|
|
|
@@ -1951,7 +1951,7 @@ Time O(N), Space O(1)
|
|
|
1951
1951
|
setEquality(equals): this;
|
|
1952
1952
|
```
|
|
1953
1953
|
|
|
1954
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1954
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1223](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1223)
|
|
1955
1955
|
|
|
1956
1956
|
Set the equality comparator used to compare values.
|
|
1957
1957
|
|
|
@@ -1981,7 +1981,7 @@ Time O(1), Space O(1)
|
|
|
1981
1981
|
shift(): E | undefined;
|
|
1982
1982
|
```
|
|
1983
1983
|
|
|
1984
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
1984
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:454](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L454)
|
|
1985
1985
|
|
|
1986
1986
|
Remove and return the head element.
|
|
1987
1987
|
|
|
@@ -2014,7 +2014,7 @@ Time O(1), Space O(1)
|
|
|
2014
2014
|
slice(start?, end?): this;
|
|
2015
2015
|
```
|
|
2016
2016
|
|
|
2017
|
-
Defined in: [data-structures/base/linear-base.ts:494](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2017
|
+
Defined in: [data-structures/base/linear-base.ts:494](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L494)
|
|
2018
2018
|
|
|
2019
2019
|
Slice via forward iteration (no random access required).
|
|
2020
2020
|
|
|
@@ -2054,7 +2054,7 @@ Time O(n), Space O(n)
|
|
|
2054
2054
|
some(predicate, thisArg?): boolean;
|
|
2055
2055
|
```
|
|
2056
2056
|
|
|
2057
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2057
|
+
Defined in: [data-structures/base/iterable-element-base.ts:110](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L110)
|
|
2058
2058
|
|
|
2059
2059
|
Tests whether at least one element satisfies the predicate.
|
|
2060
2060
|
|
|
@@ -2094,7 +2094,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
2094
2094
|
sort(compareFn?): this;
|
|
2095
2095
|
```
|
|
2096
2096
|
|
|
2097
|
-
Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2097
|
+
Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L185)
|
|
2098
2098
|
|
|
2099
2099
|
In-place stable order via array sort semantics.
|
|
2100
2100
|
|
|
@@ -2131,7 +2131,7 @@ splice(
|
|
|
2131
2131
|
items): this;
|
|
2132
2132
|
```
|
|
2133
2133
|
|
|
2134
|
-
Defined in: [data-structures/base/linear-base.ts:522](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2134
|
+
Defined in: [data-structures/base/linear-base.ts:522](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L522)
|
|
2135
2135
|
|
|
2136
2136
|
Splice by walking node iterators from the start index.
|
|
2137
2137
|
|
|
@@ -2177,7 +2177,7 @@ Time O(n + m), Space O(min(n, m)) where `m = items.length`
|
|
|
2177
2177
|
toArray(): E[];
|
|
2178
2178
|
```
|
|
2179
2179
|
|
|
2180
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2180
|
+
Defined in: [data-structures/base/iterable-element-base.ts:246](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L246)
|
|
2181
2181
|
|
|
2182
2182
|
Materializes the elements into a new array.
|
|
2183
2183
|
|
|
@@ -2203,7 +2203,7 @@ Time O(n), Space O(n).
|
|
|
2203
2203
|
toReversedArray(): E[];
|
|
2204
2204
|
```
|
|
2205
2205
|
|
|
2206
|
-
Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2206
|
+
Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/linear-base.ts#L237)
|
|
2207
2207
|
|
|
2208
2208
|
Snapshot elements into a reversed array.
|
|
2209
2209
|
|
|
@@ -2229,7 +2229,7 @@ Time O(n), Space O(n)
|
|
|
2229
2229
|
toVisual(): E[];
|
|
2230
2230
|
```
|
|
2231
2231
|
|
|
2232
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2232
|
+
Defined in: [data-structures/base/iterable-element-base.ts:258](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L258)
|
|
2233
2233
|
|
|
2234
2234
|
Returns a representation of the structure suitable for quick visualization.
|
|
2235
2235
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -2256,7 +2256,7 @@ Time O(n), Space O(n).
|
|
|
2256
2256
|
unshift(elementOrNode): boolean;
|
|
2257
2257
|
```
|
|
2258
2258
|
|
|
2259
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2259
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:515](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L515)
|
|
2260
2260
|
|
|
2261
2261
|
Prepend an element/node to the head.
|
|
2262
2262
|
|
|
@@ -2297,7 +2297,7 @@ Time O(1), Space O(1)
|
|
|
2297
2297
|
unshiftMany(elements): boolean[];
|
|
2298
2298
|
```
|
|
2299
2299
|
|
|
2300
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2300
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:553](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L553)
|
|
2301
2301
|
|
|
2302
2302
|
Prepend a sequence of elements/nodes.
|
|
2303
2303
|
|
|
@@ -2329,7 +2329,7 @@ Time O(N), Space O(1)
|
|
|
2329
2329
|
values(): IterableIterator<E>;
|
|
2330
2330
|
```
|
|
2331
2331
|
|
|
2332
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2332
|
+
Defined in: [data-structures/base/iterable-element-base.ts:72](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L72)
|
|
2333
2333
|
|
|
2334
2334
|
Returns an iterator over the values (alias of the default iterator).
|
|
2335
2335
|
|
|
@@ -2355,7 +2355,7 @@ Creating the iterator is O(1); full iteration is Time O(n), Space O(1).
|
|
|
2355
2355
|
static fromArray<E, R>(this, data): any;
|
|
2356
2356
|
```
|
|
2357
2357
|
|
|
2358
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:243](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2358
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:243](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L243)
|
|
2359
2359
|
|
|
2360
2360
|
Create a new list from an array of elements.
|
|
2361
2361
|
|
|
@@ -2404,7 +2404,7 @@ Time O(N), Space O(N)
|
|
|
2404
2404
|
protected optional _toElementFn?: (rawElement) => E;
|
|
2405
2405
|
```
|
|
2406
2406
|
|
|
2407
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2407
|
+
Defined in: [data-structures/base/iterable-element-base.ts:39](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/base/iterable-element-base.ts#L39)
|
|
2408
2408
|
|
|
2409
2409
|
The converter used to transform a raw element (`R`) into a public element (`E`).
|
|
2410
2410
|
|
|
@@ -2434,7 +2434,7 @@ Time O(1), Space O(1).
|
|
|
2434
2434
|
protected _createInstance(options?): this;
|
|
2435
2435
|
```
|
|
2436
2436
|
|
|
2437
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2437
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1474](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1474)
|
|
2438
2438
|
|
|
2439
2439
|
(Protected) Create an empty instance of the same concrete class.
|
|
2440
2440
|
|
|
@@ -2468,7 +2468,7 @@ Time O(1), Space O(1)
|
|
|
2468
2468
|
protected _createLike<EM, RM>(elements?, options?): DoublyLinkedList<EM, RM>;
|
|
2469
2469
|
```
|
|
2470
2470
|
|
|
2471
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2471
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1492](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1492)
|
|
2472
2472
|
|
|
2473
2473
|
(Protected) Create a like-kind instance and seed it from an iterable.
|
|
2474
2474
|
|
|
@@ -2516,7 +2516,7 @@ Time O(N), Space O(N)
|
|
|
2516
2516
|
protected _ensureNode(elementOrNode): DoublyLinkedListNode<E>;
|
|
2517
2517
|
```
|
|
2518
2518
|
|
|
2519
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2519
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1430](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1430)
|
|
2520
2520
|
|
|
2521
2521
|
(Protected) Create or return a node for the given input (node or raw element).
|
|
2522
2522
|
|
|
@@ -2546,7 +2546,7 @@ Time O(1), Space O(1)
|
|
|
2546
2546
|
protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
|
|
2547
2547
|
```
|
|
2548
2548
|
|
|
2549
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2549
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1442](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1442)
|
|
2550
2550
|
|
|
2551
2551
|
(Protected) Normalize input into a predicate over nodes.
|
|
2552
2552
|
|
|
@@ -2578,7 +2578,7 @@ Time O(1), Space O(1)
|
|
|
2578
2578
|
protected _getIterator(): IterableIterator<E>;
|
|
2579
2579
|
```
|
|
2580
2580
|
|
|
2581
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2581
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1503](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1503)
|
|
2582
2582
|
|
|
2583
2583
|
Internal iterator factory used by the default iterator.
|
|
2584
2584
|
|
|
@@ -2604,7 +2604,7 @@ Implementations should yield in O(1) per element with O(1) extra space when poss
|
|
|
2604
2604
|
protected _getNodeIterator(): IterableIterator<DoublyLinkedListNode<E>>;
|
|
2605
2605
|
```
|
|
2606
2606
|
|
|
2607
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2607
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1519](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1519)
|
|
2608
2608
|
|
|
2609
2609
|
Iterate linked nodes from head to tail.
|
|
2610
2610
|
|
|
@@ -2630,7 +2630,7 @@ Time O(n), Space O(1)
|
|
|
2630
2630
|
protected _getPrevNode(node): DoublyLinkedListNode<E> | undefined;
|
|
2631
2631
|
```
|
|
2632
2632
|
|
|
2633
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2633
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1463](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1463)
|
|
2634
2634
|
|
|
2635
2635
|
(Protected) Get the previous node of a given node.
|
|
2636
2636
|
|
|
@@ -2664,7 +2664,7 @@ Time O(1), Space O(1)
|
|
|
2664
2664
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2665
2665
|
```
|
|
2666
2666
|
|
|
2667
|
-
Defined in: [data-structures/linked-list/doubly-linked-list.ts:
|
|
2667
|
+
Defined in: [data-structures/linked-list/doubly-linked-list.ts:1511](https://github.com/zrwusa/data-structure-typed/blob/8292cb978daf85ebe846186c7c7572aece04fb7b/src/data-structures/linked-list/doubly-linked-list.ts#L1511)
|
|
2668
2668
|
|
|
2669
2669
|
Reverse-direction iterator over elements.
|
|
2670
2670
|
|