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: Queue\<E, R\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/queue/queue.ts:91](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/queue/queue.ts:91](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L91)
|
|
10
10
|
|
|
11
11
|
Array-backed queue with amortized O(1) enqueue/dequeue via an offset pointer and optional auto-compaction.
|
|
12
12
|
|
|
@@ -115,7 +115,7 @@ Time O(1), Space O(1)
|
|
|
115
115
|
new Queue<E, R>(elements?, options?): Queue<E, R>;
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
Defined in: [data-structures/queue/queue.ts:100](https://github.com/zrwusa/data-structure-typed/blob/
|
|
118
|
+
Defined in: [data-structures/queue/queue.ts:100](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L100)
|
|
119
119
|
|
|
120
120
|
Create a Queue and optionally bulk-insert elements.
|
|
121
121
|
|
|
@@ -157,7 +157,7 @@ Time O(N), Space O(N)
|
|
|
157
157
|
get autoCompactRatio(): number;
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
Defined in: [data-structures/queue/queue.ts:141](https://github.com/zrwusa/data-structure-typed/blob/
|
|
160
|
+
Defined in: [data-structures/queue/queue.ts:141](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L141)
|
|
161
161
|
|
|
162
162
|
Get the compaction threshold (offset/size).
|
|
163
163
|
|
|
@@ -177,7 +177,7 @@ Auto-compaction ratio in (0,1].
|
|
|
177
177
|
set autoCompactRatio(value): void;
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
Defined in: [data-structures/queue/queue.ts:152](https://github.com/zrwusa/data-structure-typed/blob/
|
|
180
|
+
Defined in: [data-structures/queue/queue.ts:152](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L152)
|
|
181
181
|
|
|
182
182
|
Set the compaction threshold.
|
|
183
183
|
|
|
@@ -209,7 +209,7 @@ void
|
|
|
209
209
|
get elements(): E[];
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
-
Defined in: [data-structures/queue/queue.ts:117](https://github.com/zrwusa/data-structure-typed/blob/
|
|
212
|
+
Defined in: [data-structures/queue/queue.ts:117](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L117)
|
|
213
213
|
|
|
214
214
|
Get the underlying array buffer.
|
|
215
215
|
|
|
@@ -233,7 +233,7 @@ Backing array of elements.
|
|
|
233
233
|
get first(): E | undefined;
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
236
|
+
Defined in: [data-structures/queue/queue.ts:262](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L262)
|
|
237
237
|
|
|
238
238
|
Get the first element (front) without removing it.
|
|
239
239
|
|
|
@@ -268,7 +268,7 @@ Front element or undefined.
|
|
|
268
268
|
get last(): E | undefined;
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
271
|
+
Defined in: [data-structures/queue/queue.ts:281](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L281)
|
|
272
272
|
|
|
273
273
|
Get the last element (back) without removing it.
|
|
274
274
|
|
|
@@ -292,7 +292,7 @@ Back element or undefined.
|
|
|
292
292
|
get length(): number;
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
295
|
+
Defined in: [data-structures/queue/queue.ts:208](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L208)
|
|
296
296
|
|
|
297
297
|
Get the number of elements currently in the queue.
|
|
298
298
|
|
|
@@ -333,7 +333,7 @@ Current length.
|
|
|
333
333
|
get maxLen(): number;
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
Defined in: [data-structures/base/linear-base.ts:100](https://github.com/zrwusa/data-structure-typed/blob/
|
|
336
|
+
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)
|
|
337
337
|
|
|
338
338
|
Upper bound for length (if positive), or `-1` when unbounded.
|
|
339
339
|
|
|
@@ -361,7 +361,7 @@ Maximum allowed length.
|
|
|
361
361
|
get offset(): number;
|
|
362
362
|
```
|
|
363
363
|
|
|
364
|
-
Defined in: [data-structures/queue/queue.ts:129](https://github.com/zrwusa/data-structure-typed/blob/
|
|
364
|
+
Defined in: [data-structures/queue/queue.ts:129](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L129)
|
|
365
365
|
|
|
366
366
|
Get the current start offset into the array.
|
|
367
367
|
|
|
@@ -385,7 +385,7 @@ Zero-based offset.
|
|
|
385
385
|
get toElementFn(): ((rawElement) => E) | undefined;
|
|
386
386
|
```
|
|
387
387
|
|
|
388
|
-
Defined in: [data-structures/base/iterable-element-base.ts:48](https://github.com/zrwusa/data-structure-typed/blob/
|
|
388
|
+
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)
|
|
389
389
|
|
|
390
390
|
Exposes the current `toElementFn`, if configured.
|
|
391
391
|
|
|
@@ -411,7 +411,7 @@ The converter function or `undefined` when not set.
|
|
|
411
411
|
iterator: IterableIterator<E>;
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
-
Defined in: [data-structures/base/iterable-element-base.ts:61](https://github.com/zrwusa/data-structure-typed/blob/
|
|
414
|
+
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)
|
|
415
415
|
|
|
416
416
|
Returns an iterator over the structure's elements.
|
|
417
417
|
|
|
@@ -445,7 +445,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
445
445
|
addAt(index, newElement): boolean;
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
448
|
+
Defined in: [data-structures/queue/queue.ts:642](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L642)
|
|
449
449
|
|
|
450
450
|
Insert a new element at a given index.
|
|
451
451
|
|
|
@@ -485,7 +485,7 @@ Time O(N), Space O(1)
|
|
|
485
485
|
at(index): E | undefined;
|
|
486
486
|
```
|
|
487
487
|
|
|
488
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
488
|
+
Defined in: [data-structures/queue/queue.ts:615](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L615)
|
|
489
489
|
|
|
490
490
|
Get the element at a given logical index.
|
|
491
491
|
|
|
@@ -530,7 +530,7 @@ Time O(1), Space O(1)
|
|
|
530
530
|
clear(): void;
|
|
531
531
|
```
|
|
532
532
|
|
|
533
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
533
|
+
Defined in: [data-structures/queue/queue.ts:738](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L738)
|
|
534
534
|
|
|
535
535
|
Remove all elements and reset offset.
|
|
536
536
|
|
|
@@ -567,7 +567,7 @@ Time O(1), Space O(1)
|
|
|
567
567
|
clone(): this;
|
|
568
568
|
```
|
|
569
569
|
|
|
570
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
570
|
+
Defined in: [data-structures/queue/queue.ts:873](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L873)
|
|
571
571
|
|
|
572
572
|
Deep clone this queue and its parameters.
|
|
573
573
|
|
|
@@ -606,7 +606,7 @@ Time O(N), Space O(N)
|
|
|
606
606
|
compact(): boolean;
|
|
607
607
|
```
|
|
608
608
|
|
|
609
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
609
|
+
Defined in: [data-structures/queue/queue.ts:792](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L792)
|
|
610
610
|
|
|
611
611
|
Compact storage by discarding consumed head elements.
|
|
612
612
|
|
|
@@ -641,7 +641,7 @@ Time O(N), Space O(N)
|
|
|
641
641
|
concat(...items): this;
|
|
642
642
|
```
|
|
643
643
|
|
|
644
|
-
Defined in: [data-structures/base/linear-base.ts:165](https://github.com/zrwusa/data-structure-typed/blob/
|
|
644
|
+
Defined in: [data-structures/base/linear-base.ts:165](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L165)
|
|
645
645
|
|
|
646
646
|
Concatenate elements and/or containers.
|
|
647
647
|
|
|
@@ -675,7 +675,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
675
675
|
delete(element): boolean;
|
|
676
676
|
```
|
|
677
677
|
|
|
678
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
678
|
+
Defined in: [data-structures/queue/queue.ts:557](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L557)
|
|
679
679
|
|
|
680
680
|
Delete the first occurrence of a specific element.
|
|
681
681
|
|
|
@@ -720,7 +720,7 @@ Time O(N), Space O(1)
|
|
|
720
720
|
deleteAt(index): E | undefined;
|
|
721
721
|
```
|
|
722
722
|
|
|
723
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
723
|
+
Defined in: [data-structures/queue/queue.ts:627](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L627)
|
|
724
724
|
|
|
725
725
|
Delete the element at a given index.
|
|
726
726
|
|
|
@@ -748,13 +748,43 @@ Time O(N), Space O(1)
|
|
|
748
748
|
|
|
749
749
|
***
|
|
750
750
|
|
|
751
|
+
### deleteWhere()
|
|
752
|
+
|
|
753
|
+
```ts
|
|
754
|
+
deleteWhere(predicate): boolean;
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
Defined in: [data-structures/queue/queue.ts:668](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L668)
|
|
758
|
+
|
|
759
|
+
Delete the first element that satisfies a predicate.
|
|
760
|
+
|
|
761
|
+
#### Parameters
|
|
762
|
+
|
|
763
|
+
##### predicate
|
|
764
|
+
|
|
765
|
+
(`value`, `index`, `queue`) => `boolean`
|
|
766
|
+
|
|
767
|
+
Function (value, index, queue) → boolean to decide deletion.
|
|
768
|
+
|
|
769
|
+
#### Returns
|
|
770
|
+
|
|
771
|
+
`boolean`
|
|
772
|
+
|
|
773
|
+
True if a match was removed.
|
|
774
|
+
|
|
775
|
+
#### Remarks
|
|
776
|
+
|
|
777
|
+
Time O(N), Space O(N)
|
|
778
|
+
|
|
779
|
+
***
|
|
780
|
+
|
|
751
781
|
### every()
|
|
752
782
|
|
|
753
783
|
```ts
|
|
754
784
|
every(predicate, thisArg?): boolean;
|
|
755
785
|
```
|
|
756
786
|
|
|
757
|
-
Defined in: [data-structures/base/iterable-element-base.ts:87](https://github.com/zrwusa/data-structure-typed/blob/
|
|
787
|
+
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)
|
|
758
788
|
|
|
759
789
|
Tests whether all elements satisfy the predicate.
|
|
760
790
|
|
|
@@ -797,7 +827,7 @@ fill(
|
|
|
797
827
|
end?): this;
|
|
798
828
|
```
|
|
799
829
|
|
|
800
|
-
Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/
|
|
830
|
+
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)
|
|
801
831
|
|
|
802
832
|
Fill a range with a value.
|
|
803
833
|
|
|
@@ -843,7 +873,7 @@ Time O(n), Space O(1)
|
|
|
843
873
|
filter(predicate, thisArg?): this;
|
|
844
874
|
```
|
|
845
875
|
|
|
846
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
876
|
+
Defined in: [data-structures/queue/queue.ts:930](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L930)
|
|
847
877
|
|
|
848
878
|
Filter elements into a new queue of the same class.
|
|
849
879
|
|
|
@@ -896,7 +926,7 @@ Time O(N), Space O(N)
|
|
|
896
926
|
find<S>(predicate, thisArg?): S | undefined;
|
|
897
927
|
```
|
|
898
928
|
|
|
899
|
-
Defined in: [data-structures/base/iterable-element-base.ts:163](https://github.com/zrwusa/data-structure-typed/blob/
|
|
929
|
+
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)
|
|
900
930
|
|
|
901
931
|
Finds the first element that satisfies the predicate and returns it.
|
|
902
932
|
|
|
@@ -942,7 +972,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
942
972
|
find(predicate, thisArg?): E | undefined;
|
|
943
973
|
```
|
|
944
974
|
|
|
945
|
-
Defined in: [data-structures/base/iterable-element-base.ts:164](https://github.com/zrwusa/data-structure-typed/blob/
|
|
975
|
+
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)
|
|
946
976
|
|
|
947
977
|
Finds the first element that satisfies the predicate and returns it.
|
|
948
978
|
|
|
@@ -984,7 +1014,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
984
1014
|
findIndex(predicate, thisArg?): number;
|
|
985
1015
|
```
|
|
986
1016
|
|
|
987
|
-
Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1017
|
+
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)
|
|
988
1018
|
|
|
989
1019
|
Find the first index matching a predicate.
|
|
990
1020
|
|
|
@@ -1024,7 +1054,7 @@ Time O(n), Space O(1)
|
|
|
1024
1054
|
forEach(callbackfn, thisArg?): void;
|
|
1025
1055
|
```
|
|
1026
1056
|
|
|
1027
|
-
Defined in: [data-structures/base/iterable-element-base.ts:133](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1057
|
+
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)
|
|
1028
1058
|
|
|
1029
1059
|
Invokes a callback for each element in iteration order.
|
|
1030
1060
|
|
|
@@ -1064,7 +1094,7 @@ Time O(n), Space O(1).
|
|
|
1064
1094
|
has(element): boolean;
|
|
1065
1095
|
```
|
|
1066
1096
|
|
|
1067
|
-
Defined in: [data-structures/base/iterable-element-base.ts:189](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1097
|
+
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)
|
|
1068
1098
|
|
|
1069
1099
|
Checks whether a strictly-equal element exists in the structure.
|
|
1070
1100
|
|
|
@@ -1098,7 +1128,7 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1098
1128
|
indexOf(searchElement, fromIndex?): number;
|
|
1099
1129
|
```
|
|
1100
1130
|
|
|
1101
|
-
Defined in: [data-structures/base/linear-base.ts:111](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1131
|
+
Defined in: [data-structures/base/linear-base.ts:111](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L111)
|
|
1102
1132
|
|
|
1103
1133
|
First index of a value from the left.
|
|
1104
1134
|
|
|
@@ -1138,7 +1168,7 @@ Time O(n), Space O(1)
|
|
|
1138
1168
|
isEmpty(): boolean;
|
|
1139
1169
|
```
|
|
1140
1170
|
|
|
1141
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1171
|
+
Defined in: [data-structures/queue/queue.ts:360](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L360)
|
|
1142
1172
|
|
|
1143
1173
|
Check whether the queue is empty.
|
|
1144
1174
|
|
|
@@ -1188,7 +1218,7 @@ Time O(1), Space O(1)
|
|
|
1188
1218
|
join(separator?): string;
|
|
1189
1219
|
```
|
|
1190
1220
|
|
|
1191
|
-
Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1221
|
+
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)
|
|
1192
1222
|
|
|
1193
1223
|
Join all elements into a string.
|
|
1194
1224
|
|
|
@@ -1222,7 +1252,7 @@ Time O(n), Space O(n)
|
|
|
1222
1252
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1223
1253
|
```
|
|
1224
1254
|
|
|
1225
|
-
Defined in: [data-structures/base/linear-base.ts:131](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1255
|
+
Defined in: [data-structures/base/linear-base.ts:131](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L131)
|
|
1226
1256
|
|
|
1227
1257
|
Last index of a value from the right.
|
|
1228
1258
|
|
|
@@ -1265,7 +1295,7 @@ map<EM, RM>(
|
|
|
1265
1295
|
thisArg?): Queue<EM, RM>;
|
|
1266
1296
|
```
|
|
1267
1297
|
|
|
1268
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1298
|
+
Defined in: [data-structures/queue/queue.ts:993](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L993)
|
|
1269
1299
|
|
|
1270
1300
|
Map each element to a new element in a possibly different-typed queue.
|
|
1271
1301
|
|
|
@@ -1332,7 +1362,7 @@ Time O(N), Space O(N)
|
|
|
1332
1362
|
mapSame(callback, thisArg?): this;
|
|
1333
1363
|
```
|
|
1334
1364
|
|
|
1335
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1365
|
+
Defined in: [data-structures/queue/queue.ts:1016](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1016)
|
|
1336
1366
|
|
|
1337
1367
|
Map each element to a new value of the same type.
|
|
1338
1368
|
|
|
@@ -1366,13 +1396,35 @@ Time O(N), Space O(N)
|
|
|
1366
1396
|
|
|
1367
1397
|
***
|
|
1368
1398
|
|
|
1399
|
+
### peek()
|
|
1400
|
+
|
|
1401
|
+
```ts
|
|
1402
|
+
peek(): E | undefined;
|
|
1403
|
+
```
|
|
1404
|
+
|
|
1405
|
+
Defined in: [data-structures/queue/queue.ts:271](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L271)
|
|
1406
|
+
|
|
1407
|
+
Peek at the front element without removing it (alias for `first`).
|
|
1408
|
+
|
|
1409
|
+
#### Returns
|
|
1410
|
+
|
|
1411
|
+
`E` \| `undefined`
|
|
1412
|
+
|
|
1413
|
+
Front element or undefined.
|
|
1414
|
+
|
|
1415
|
+
#### Remarks
|
|
1416
|
+
|
|
1417
|
+
Time O(1), Space O(1)
|
|
1418
|
+
|
|
1419
|
+
***
|
|
1420
|
+
|
|
1369
1421
|
### print()
|
|
1370
1422
|
|
|
1371
1423
|
```ts
|
|
1372
1424
|
print(): void;
|
|
1373
1425
|
```
|
|
1374
1426
|
|
|
1375
|
-
Defined in: [data-structures/base/iterable-element-base.ts:269](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1427
|
+
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)
|
|
1376
1428
|
|
|
1377
1429
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1378
1430
|
|
|
@@ -1398,7 +1450,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1398
1450
|
push(element): boolean;
|
|
1399
1451
|
```
|
|
1400
1452
|
|
|
1401
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1453
|
+
Defined in: [data-structures/queue/queue.ts:420](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L420)
|
|
1402
1454
|
|
|
1403
1455
|
Enqueue one element at the back.
|
|
1404
1456
|
|
|
@@ -1448,7 +1500,7 @@ Time O(1), Space O(1)
|
|
|
1448
1500
|
pushMany(elements): boolean[];
|
|
1449
1501
|
```
|
|
1450
1502
|
|
|
1451
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1503
|
+
Defined in: [data-structures/queue/queue.ts:433](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L433)
|
|
1452
1504
|
|
|
1453
1505
|
Enqueue many elements from an iterable.
|
|
1454
1506
|
|
|
@@ -1514,7 +1566,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1514
1566
|
reduce(callbackfn): E;
|
|
1515
1567
|
```
|
|
1516
1568
|
|
|
1517
|
-
Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1569
|
+
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)
|
|
1518
1570
|
|
|
1519
1571
|
##### Parameters
|
|
1520
1572
|
|
|
@@ -1536,7 +1588,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1536
1588
|
reduce(callbackfn, initialValue): E;
|
|
1537
1589
|
```
|
|
1538
1590
|
|
|
1539
|
-
Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1591
|
+
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)
|
|
1540
1592
|
|
|
1541
1593
|
##### Parameters
|
|
1542
1594
|
|
|
@@ -1562,7 +1614,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1562
1614
|
reduce<U>(callbackfn, initialValue): U;
|
|
1563
1615
|
```
|
|
1564
1616
|
|
|
1565
|
-
Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1617
|
+
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)
|
|
1566
1618
|
|
|
1567
1619
|
##### Type Parameters
|
|
1568
1620
|
|
|
@@ -1596,7 +1648,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1596
1648
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1597
1649
|
```
|
|
1598
1650
|
|
|
1599
|
-
Defined in: [data-structures/base/linear-base.ts:256](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1651
|
+
Defined in: [data-structures/base/linear-base.ts:256](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L256)
|
|
1600
1652
|
|
|
1601
1653
|
Right-to-left reduction over elements.
|
|
1602
1654
|
|
|
@@ -1642,7 +1694,7 @@ Time O(n), Space O(1)
|
|
|
1642
1694
|
reverse(): this;
|
|
1643
1695
|
```
|
|
1644
1696
|
|
|
1645
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1697
|
+
Defined in: [data-structures/queue/queue.ts:684](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L684)
|
|
1646
1698
|
|
|
1647
1699
|
Reverse the queue in-place by compacting then reversing.
|
|
1648
1700
|
|
|
@@ -1668,7 +1720,7 @@ Time O(N), Space O(N)
|
|
|
1668
1720
|
setAt(index, newElement): boolean;
|
|
1669
1721
|
```
|
|
1670
1722
|
|
|
1671
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1723
|
+
Defined in: [data-structures/queue/queue.ts:656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L656)
|
|
1672
1724
|
|
|
1673
1725
|
Replace the element at a given index.
|
|
1674
1726
|
|
|
@@ -1708,7 +1760,7 @@ Time O(1), Space O(1)
|
|
|
1708
1760
|
shift(): E | undefined;
|
|
1709
1761
|
```
|
|
1710
1762
|
|
|
1711
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1763
|
+
Defined in: [data-structures/queue/queue.ts:501](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L501)
|
|
1712
1764
|
|
|
1713
1765
|
Dequeue one element from the front (amortized via offset).
|
|
1714
1766
|
|
|
@@ -1750,7 +1802,7 @@ Time O(1) amortized, Space O(1)
|
|
|
1750
1802
|
slice(start?, end?): this;
|
|
1751
1803
|
```
|
|
1752
1804
|
|
|
1753
|
-
Defined in: [data-structures/base/linear-base.ts:273](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1805
|
+
Defined in: [data-structures/base/linear-base.ts:273](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L273)
|
|
1754
1806
|
|
|
1755
1807
|
Create a shallow copy of a subrange.
|
|
1756
1808
|
|
|
@@ -1790,7 +1842,7 @@ Time O(n), Space O(n)
|
|
|
1790
1842
|
some(predicate, thisArg?): boolean;
|
|
1791
1843
|
```
|
|
1792
1844
|
|
|
1793
|
-
Defined in: [data-structures/base/iterable-element-base.ts:110](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1845
|
+
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)
|
|
1794
1846
|
|
|
1795
1847
|
Tests whether at least one element satisfies the predicate.
|
|
1796
1848
|
|
|
@@ -1830,7 +1882,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
1830
1882
|
sort(compareFn?): this;
|
|
1831
1883
|
```
|
|
1832
1884
|
|
|
1833
|
-
Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1885
|
+
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)
|
|
1834
1886
|
|
|
1835
1887
|
In-place stable order via array sort semantics.
|
|
1836
1888
|
|
|
@@ -1867,7 +1919,7 @@ splice(
|
|
|
1867
1919
|
items?): this;
|
|
1868
1920
|
```
|
|
1869
1921
|
|
|
1870
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1922
|
+
Defined in: [data-structures/queue/queue.ts:807](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L807)
|
|
1871
1923
|
|
|
1872
1924
|
Remove and/or insert elements at a position (array-like).
|
|
1873
1925
|
|
|
@@ -1913,7 +1965,7 @@ Time O(N + M), Space O(M)
|
|
|
1913
1965
|
toArray(): E[];
|
|
1914
1966
|
```
|
|
1915
1967
|
|
|
1916
|
-
Defined in: [data-structures/base/iterable-element-base.ts:246](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1968
|
+
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)
|
|
1917
1969
|
|
|
1918
1970
|
Materializes the elements into a new array.
|
|
1919
1971
|
|
|
@@ -1939,7 +1991,7 @@ Time O(n), Space O(n).
|
|
|
1939
1991
|
toReversedArray(): E[];
|
|
1940
1992
|
```
|
|
1941
1993
|
|
|
1942
|
-
Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1994
|
+
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)
|
|
1943
1995
|
|
|
1944
1996
|
Snapshot elements into a reversed array.
|
|
1945
1997
|
|
|
@@ -1965,7 +2017,7 @@ Time O(n), Space O(n)
|
|
|
1965
2017
|
toVisual(): E[];
|
|
1966
2018
|
```
|
|
1967
2019
|
|
|
1968
|
-
Defined in: [data-structures/base/iterable-element-base.ts:258](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2020
|
+
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)
|
|
1969
2021
|
|
|
1970
2022
|
Returns a representation of the structure suitable for quick visualization.
|
|
1971
2023
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -1992,7 +2044,7 @@ Time O(n), Space O(n).
|
|
|
1992
2044
|
values(): IterableIterator<E>;
|
|
1993
2045
|
```
|
|
1994
2046
|
|
|
1995
|
-
Defined in: [data-structures/base/iterable-element-base.ts:72](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2047
|
+
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)
|
|
1996
2048
|
|
|
1997
2049
|
Returns an iterator over the values (alias of the default iterator).
|
|
1998
2050
|
|
|
@@ -2018,7 +2070,7 @@ Creating the iterator is O(1); full iteration is Time O(n), Space O(1).
|
|
|
2018
2070
|
static fromArray<E>(elements): Queue<E>;
|
|
2019
2071
|
```
|
|
2020
2072
|
|
|
2021
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2073
|
+
Defined in: [data-structures/queue/queue.ts:293](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L293)
|
|
2022
2074
|
|
|
2023
2075
|
Create a queue from an array of elements.
|
|
2024
2076
|
|
|
@@ -2057,7 +2109,7 @@ Time O(N), Space O(N)
|
|
|
2057
2109
|
protected optional _toElementFn?: (rawElement) => E;
|
|
2058
2110
|
```
|
|
2059
2111
|
|
|
2060
|
-
Defined in: [data-structures/base/iterable-element-base.ts:39](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2112
|
+
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)
|
|
2061
2113
|
|
|
2062
2114
|
The converter used to transform a raw element (`R`) into a public element (`E`).
|
|
2063
2115
|
|
|
@@ -2087,7 +2139,7 @@ Time O(1), Space O(1).
|
|
|
2087
2139
|
protected _createInstance(options?): this;
|
|
2088
2140
|
```
|
|
2089
2141
|
|
|
2090
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2142
|
+
Defined in: [data-structures/queue/queue.ts:1076](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1076)
|
|
2091
2143
|
|
|
2092
2144
|
(Protected) Create an empty instance of the same concrete class.
|
|
2093
2145
|
|
|
@@ -2121,7 +2173,7 @@ Time O(1), Space O(1)
|
|
|
2121
2173
|
protected _createLike<EM, RM>(elements?, options?): Queue<EM, RM>;
|
|
2122
2174
|
```
|
|
2123
2175
|
|
|
2124
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2176
|
+
Defined in: [data-structures/queue/queue.ts:1091](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1091)
|
|
2125
2177
|
|
|
2126
2178
|
(Protected) Create a like-kind queue and seed it from an iterable.
|
|
2127
2179
|
|
|
@@ -2167,7 +2219,7 @@ Time O(N), Space O(N)
|
|
|
2167
2219
|
protected _getIterator(): IterableIterator<E>;
|
|
2168
2220
|
```
|
|
2169
2221
|
|
|
2170
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2222
|
+
Defined in: [data-structures/queue/queue.ts:1052](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1052)
|
|
2171
2223
|
|
|
2172
2224
|
(Protected) Iterate elements from front to back.
|
|
2173
2225
|
|
|
@@ -2193,7 +2245,7 @@ Time O(N), Space O(1)
|
|
|
2193
2245
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2194
2246
|
```
|
|
2195
2247
|
|
|
2196
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2248
|
+
Defined in: [data-structures/queue/queue.ts:1062](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1062)
|
|
2197
2249
|
|
|
2198
2250
|
(Protected) Iterate elements from back to front.
|
|
2199
2251
|
|
|
@@ -2219,7 +2271,7 @@ Time O(N), Space O(1)
|
|
|
2219
2271
|
protected _setAutoCompactRatio(value): void;
|
|
2220
2272
|
```
|
|
2221
2273
|
|
|
2222
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2274
|
+
Defined in: [data-structures/queue/queue.ts:1042](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1042)
|
|
2223
2275
|
|
|
2224
2276
|
(Protected) Set the internal auto-compaction ratio.
|
|
2225
2277
|
|