data-structure-typed 2.6.0 → 2.6.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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/CHANGELOG.md +9 -1
- package/dist/cjs/binary-tree.cjs +2927 -23688
- package/dist/cjs/graph.cjs +845 -2634
- package/dist/cjs/hash.cjs +185 -616
- package/dist/cjs/heap.cjs +266 -818
- package/dist/cjs/index.cjs +5116 -31358
- package/dist/cjs/linked-list.cjs +644 -2615
- package/dist/cjs/matrix.cjs +220 -535
- package/dist/cjs/priority-queue.cjs +266 -818
- package/dist/cjs/queue.cjs +637 -2343
- package/dist/cjs/stack.cjs +124 -530
- package/dist/cjs/trie.cjs +145 -592
- package/dist/cjs-legacy/binary-tree.cjs +4352 -25113
- package/dist/cjs-legacy/graph.cjs +847 -2636
- package/dist/cjs-legacy/hash.cjs +181 -612
- package/dist/cjs-legacy/heap.cjs +266 -818
- package/dist/cjs-legacy/index.cjs +6657 -32899
- package/dist/cjs-legacy/linked-list.cjs +640 -2611
- package/dist/cjs-legacy/matrix.cjs +220 -535
- package/dist/cjs-legacy/priority-queue.cjs +266 -818
- package/dist/cjs-legacy/queue.cjs +634 -2340
- package/dist/cjs-legacy/stack.cjs +124 -530
- package/dist/cjs-legacy/trie.cjs +145 -592
- package/dist/esm/binary-tree.mjs +2927 -23688
- package/dist/esm/graph.mjs +845 -2634
- package/dist/esm/hash.mjs +185 -616
- package/dist/esm/heap.mjs +266 -818
- package/dist/esm/index.mjs +5116 -31358
- package/dist/esm/linked-list.mjs +644 -2615
- package/dist/esm/matrix.mjs +220 -535
- package/dist/esm/priority-queue.mjs +266 -818
- package/dist/esm/queue.mjs +637 -2343
- package/dist/esm/stack.mjs +124 -530
- package/dist/esm/trie.mjs +145 -592
- package/dist/esm-legacy/binary-tree.mjs +4352 -25113
- package/dist/esm-legacy/graph.mjs +847 -2636
- package/dist/esm-legacy/hash.mjs +181 -612
- package/dist/esm-legacy/heap.mjs +266 -818
- package/dist/esm-legacy/index.mjs +6657 -32899
- package/dist/esm-legacy/linked-list.mjs +640 -2611
- package/dist/esm-legacy/matrix.mjs +220 -535
- package/dist/esm-legacy/priority-queue.mjs +266 -818
- package/dist/esm-legacy/queue.mjs +634 -2340
- package/dist/esm-legacy/stack.mjs +124 -530
- package/dist/esm-legacy/trie.mjs +145 -592
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +29 -500
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +38 -563
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +230 -1212
- package/dist/types/data-structures/binary-tree/bst.d.ts +124 -1063
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +99 -854
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +62 -314
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +366 -5057
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +277 -4885
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +253 -3929
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +261 -4782
- package/dist/types/data-structures/graph/abstract-graph.d.ts +44 -44
- package/dist/types/data-structures/graph/directed-graph.d.ts +130 -527
- package/dist/types/data-structures/graph/undirected-graph.d.ts +125 -482
- package/dist/types/data-structures/hash/hash-map.d.ts +132 -562
- package/dist/types/data-structures/heap/heap.d.ts +194 -746
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +120 -809
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -733
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +193 -863
- package/dist/types/data-structures/matrix/matrix.d.ts +159 -474
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -6
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +6 -11
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/types/data-structures/queue/deque.d.ts +196 -804
- package/dist/types/data-structures/queue/queue.d.ts +99 -585
- package/dist/types/data-structures/stack/stack.d.ts +75 -481
- package/dist/types/data-structures/trie/trie.d.ts +98 -584
- package/dist/umd/data-structure-typed.js +6580 -32822
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +162 -215
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +47 -47
- package/docs-site-docusaurus/docs/api/classes/BST.md +155 -208
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +7 -7
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -29
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +104 -158
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +253 -101
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +244 -114
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +6 -6
- 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 +52 -48
- package/docs-site-docusaurus/docs/api/classes/Heap.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +84 -14
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +138 -34
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +149 -41
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +172 -92
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +57 -52
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +120 -70
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +125 -75
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/Queue.md +158 -74
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +171 -225
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -22
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +172 -94
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +4 -4
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +98 -75
- package/docs-site-docusaurus/docs/api/classes/Stack.md +112 -50
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +104 -129
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +90 -121
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +298 -107
- package/docs-site-docusaurus/docs/api/classes/Trie.md +116 -58
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +59 -77
- package/package.json +45 -46
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +0 -3
- package/src/data-structures/base/linear-base.ts +2 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -529
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
- package/src/data-structures/binary-tree/bst.ts +158 -1082
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
- package/src/data-structures/binary-tree/segment-tree.ts +73 -351
- package/src/data-structures/binary-tree/tree-map.ts +462 -5124
- package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
- package/src/data-structures/binary-tree/tree-multi-set.ts +299 -3983
- package/src/data-structures/binary-tree/tree-set.ts +338 -4836
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -562
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -511
- package/src/data-structures/hash/hash-map.ts +154 -582
- package/src/data-structures/heap/heap.ts +200 -795
- package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
- package/src/data-structures/matrix/matrix.ts +179 -518
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +214 -882
- package/src/data-structures/queue/queue.ts +102 -625
- package/src/data-structures/stack/stack.ts +76 -505
- package/src/data-structures/trie/trie.ts +98 -628
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Queue\<E, R\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
9
|
+
Defined in: [data-structures/queue/queue.ts:90](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L90)
|
|
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:
|
|
118
|
+
Defined in: [data-structures/queue/queue.ts:98](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L98)
|
|
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:
|
|
160
|
+
Defined in: [data-structures/queue/queue.ts:136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L136)
|
|
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:
|
|
180
|
+
Defined in: [data-structures/queue/queue.ts:146](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L146)
|
|
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:
|
|
212
|
+
Defined in: [data-structures/queue/queue.ts:114](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L114)
|
|
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:176](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L176)
|
|
237
237
|
|
|
238
238
|
Get the first element (front) without removing it.
|
|
239
239
|
|
|
@@ -256,8 +256,6 @@ Time O(1), Space O(1)
|
|
|
256
256
|
|
|
257
257
|
Front element or undefined.
|
|
258
258
|
|
|
259
|
-
*
|
|
260
|
-
|
|
261
259
|
***
|
|
262
260
|
|
|
263
261
|
### last
|
|
@@ -268,7 +266,7 @@ Front element or undefined.
|
|
|
268
266
|
get last(): E | undefined;
|
|
269
267
|
```
|
|
270
268
|
|
|
271
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
269
|
+
Defined in: [data-structures/queue/queue.ts:185](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L185)
|
|
272
270
|
|
|
273
271
|
Get the last element (back) without removing it.
|
|
274
272
|
|
|
@@ -292,7 +290,7 @@ Back element or undefined.
|
|
|
292
290
|
get length(): number;
|
|
293
291
|
```
|
|
294
292
|
|
|
295
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
293
|
+
Defined in: [data-structures/queue/queue.ts:162](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L162)
|
|
296
294
|
|
|
297
295
|
Get the number of elements currently in the queue.
|
|
298
296
|
|
|
@@ -317,8 +315,6 @@ Time O(1), Space O(1)
|
|
|
317
315
|
|
|
318
316
|
Current length.
|
|
319
317
|
|
|
320
|
-
*
|
|
321
|
-
|
|
322
318
|
#### Overrides
|
|
323
319
|
|
|
324
320
|
[`LinearBase`](LinearBase.md).[`length`](LinearBase.md#length)
|
|
@@ -361,7 +357,7 @@ Maximum allowed length.
|
|
|
361
357
|
get offset(): number;
|
|
362
358
|
```
|
|
363
359
|
|
|
364
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
360
|
+
Defined in: [data-structures/queue/queue.ts:125](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L125)
|
|
365
361
|
|
|
366
362
|
Get the current start offset into the array.
|
|
367
363
|
|
|
@@ -445,7 +441,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
445
441
|
addAt(index, newElement): boolean;
|
|
446
442
|
```
|
|
447
443
|
|
|
448
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
444
|
+
Defined in: [data-structures/queue/queue.ts:357](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L357)
|
|
449
445
|
|
|
450
446
|
Insert a new element at a given index.
|
|
451
447
|
|
|
@@ -485,7 +481,7 @@ Time O(N), Space O(1)
|
|
|
485
481
|
at(index): E | undefined;
|
|
486
482
|
```
|
|
487
483
|
|
|
488
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
484
|
+
Defined in: [data-structures/queue/queue.ts:332](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L332)
|
|
489
485
|
|
|
490
486
|
Get the element at a given logical index.
|
|
491
487
|
|
|
@@ -503,8 +499,6 @@ Zero-based index from the front.
|
|
|
503
499
|
|
|
504
500
|
Element or undefined.
|
|
505
501
|
|
|
506
|
-
*
|
|
507
|
-
|
|
508
502
|
#### Remarks
|
|
509
503
|
|
|
510
504
|
Time O(1), Space O(1)
|
|
@@ -530,7 +524,7 @@ Time O(1), Space O(1)
|
|
|
530
524
|
clear(): void;
|
|
531
525
|
```
|
|
532
526
|
|
|
533
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
527
|
+
Defined in: [data-structures/queue/queue.ts:413](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L413)
|
|
534
528
|
|
|
535
529
|
Remove all elements and reset offset.
|
|
536
530
|
|
|
@@ -540,8 +534,6 @@ Remove all elements and reset offset.
|
|
|
540
534
|
|
|
541
535
|
void
|
|
542
536
|
|
|
543
|
-
*
|
|
544
|
-
|
|
545
537
|
#### Remarks
|
|
546
538
|
|
|
547
539
|
Time O(1), Space O(1)
|
|
@@ -567,7 +559,7 @@ Time O(1), Space O(1)
|
|
|
567
559
|
clone(): this;
|
|
568
560
|
```
|
|
569
561
|
|
|
570
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
562
|
+
Defined in: [data-structures/queue/queue.ts:468](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L468)
|
|
571
563
|
|
|
572
564
|
Deep clone this queue and its parameters.
|
|
573
565
|
|
|
@@ -577,8 +569,6 @@ Deep clone this queue and its parameters.
|
|
|
577
569
|
|
|
578
570
|
A new queue with the same content and options.
|
|
579
571
|
|
|
580
|
-
*
|
|
581
|
-
|
|
582
572
|
#### Remarks
|
|
583
573
|
|
|
584
574
|
Time O(N), Space O(N)
|
|
@@ -606,7 +596,7 @@ Time O(N), Space O(N)
|
|
|
606
596
|
compact(): boolean;
|
|
607
597
|
```
|
|
608
598
|
|
|
609
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
599
|
+
Defined in: [data-structures/queue/queue.ts:430](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L430)
|
|
610
600
|
|
|
611
601
|
Compact storage by discarding consumed head elements.
|
|
612
602
|
|
|
@@ -616,8 +606,6 @@ Compact storage by discarding consumed head elements.
|
|
|
616
606
|
|
|
617
607
|
True when compaction performed.
|
|
618
608
|
|
|
619
|
-
*
|
|
620
|
-
|
|
621
609
|
#### Remarks
|
|
622
610
|
|
|
623
611
|
Time O(N), Space O(N)
|
|
@@ -641,7 +629,7 @@ Time O(N), Space O(N)
|
|
|
641
629
|
concat(...items): this;
|
|
642
630
|
```
|
|
643
631
|
|
|
644
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
632
|
+
Defined in: [data-structures/base/linear-base.ts:161](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L161)
|
|
645
633
|
|
|
646
634
|
Concatenate elements and/or containers.
|
|
647
635
|
|
|
@@ -675,7 +663,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
675
663
|
delete(element): boolean;
|
|
676
664
|
```
|
|
677
665
|
|
|
678
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
666
|
+
Defined in: [data-structures/queue/queue.ts:311](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L311)
|
|
679
667
|
|
|
680
668
|
Delete the first occurrence of a specific element.
|
|
681
669
|
|
|
@@ -693,8 +681,6 @@ Element to remove (strict equality via Object.is).
|
|
|
693
681
|
|
|
694
682
|
True if an element was removed.
|
|
695
683
|
|
|
696
|
-
*
|
|
697
|
-
|
|
698
684
|
#### Remarks
|
|
699
685
|
|
|
700
686
|
Time O(N), Space O(1)
|
|
@@ -720,7 +706,7 @@ Time O(N), Space O(1)
|
|
|
720
706
|
deleteAt(index): E | undefined;
|
|
721
707
|
```
|
|
722
708
|
|
|
723
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
709
|
+
Defined in: [data-structures/queue/queue.ts:343](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L343)
|
|
724
710
|
|
|
725
711
|
Delete the element at a given index.
|
|
726
712
|
|
|
@@ -754,7 +740,7 @@ Time O(N), Space O(1)
|
|
|
754
740
|
deleteWhere(predicate): boolean;
|
|
755
741
|
```
|
|
756
742
|
|
|
757
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
743
|
+
Defined in: [data-structures/queue/queue.ts:382](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L382)
|
|
758
744
|
|
|
759
745
|
Delete the first element that satisfies a predicate.
|
|
760
746
|
|
|
@@ -778,6 +764,30 @@ Time O(N), Space O(N)
|
|
|
778
764
|
|
|
779
765
|
***
|
|
780
766
|
|
|
767
|
+
### entries()
|
|
768
|
+
|
|
769
|
+
```ts
|
|
770
|
+
entries(): IterableIterator<[number, E]>;
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
Defined in: [data-structures/base/iterable-element-base.ts:207](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L207)
|
|
774
|
+
|
|
775
|
+
Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
776
|
+
|
|
777
|
+
#### Returns
|
|
778
|
+
|
|
779
|
+
`IterableIterator`\<\[`number`, `E`\]\>
|
|
780
|
+
|
|
781
|
+
#### Remarks
|
|
782
|
+
|
|
783
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
784
|
+
|
|
785
|
+
#### Inherited from
|
|
786
|
+
|
|
787
|
+
[`LinearBase`](LinearBase.md).[`entries`](LinearBase.md#entries)
|
|
788
|
+
|
|
789
|
+
***
|
|
790
|
+
|
|
781
791
|
### every()
|
|
782
792
|
|
|
783
793
|
```ts
|
|
@@ -827,7 +837,7 @@ fill(
|
|
|
827
837
|
end?): this;
|
|
828
838
|
```
|
|
829
839
|
|
|
830
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
840
|
+
Defined in: [data-structures/base/linear-base.ts:279](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L279)
|
|
831
841
|
|
|
832
842
|
Fill a range with a value.
|
|
833
843
|
|
|
@@ -873,7 +883,7 @@ Time O(n), Space O(1)
|
|
|
873
883
|
filter(predicate, thisArg?): this;
|
|
874
884
|
```
|
|
875
885
|
|
|
876
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
886
|
+
Defined in: [data-structures/queue/queue.ts:487](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L487)
|
|
877
887
|
|
|
878
888
|
Filter elements into a new queue of the same class.
|
|
879
889
|
|
|
@@ -897,8 +907,6 @@ Value for `this` inside the predicate.
|
|
|
897
907
|
|
|
898
908
|
A new queue with kept elements.
|
|
899
909
|
|
|
900
|
-
*
|
|
901
|
-
|
|
902
910
|
#### Remarks
|
|
903
911
|
|
|
904
912
|
Time O(N), Space O(N)
|
|
@@ -1014,7 +1022,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
1014
1022
|
findIndex(predicate, thisArg?): number;
|
|
1015
1023
|
```
|
|
1016
1024
|
|
|
1017
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1025
|
+
Defined in: [data-structures/base/linear-base.ts:147](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L147)
|
|
1018
1026
|
|
|
1019
1027
|
Find the first index matching a predicate.
|
|
1020
1028
|
|
|
@@ -1094,7 +1102,7 @@ Time O(n), Space O(1).
|
|
|
1094
1102
|
has(element): boolean;
|
|
1095
1103
|
```
|
|
1096
1104
|
|
|
1097
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1105
|
+
Defined in: [data-structures/base/iterable-element-base.ts:188](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L188)
|
|
1098
1106
|
|
|
1099
1107
|
Checks whether a strictly-equal element exists in the structure.
|
|
1100
1108
|
|
|
@@ -1122,6 +1130,40 @@ Time O(n) in the worst case. Space O(1).
|
|
|
1122
1130
|
|
|
1123
1131
|
***
|
|
1124
1132
|
|
|
1133
|
+
### includes()
|
|
1134
|
+
|
|
1135
|
+
```ts
|
|
1136
|
+
includes(element): boolean;
|
|
1137
|
+
```
|
|
1138
|
+
|
|
1139
|
+
Defined in: [data-structures/base/iterable-element-base.ts:199](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L199)
|
|
1140
|
+
|
|
1141
|
+
Check whether a value exists (Array-compatible alias for `has`).
|
|
1142
|
+
|
|
1143
|
+
#### Parameters
|
|
1144
|
+
|
|
1145
|
+
##### element
|
|
1146
|
+
|
|
1147
|
+
`E`
|
|
1148
|
+
|
|
1149
|
+
Element to search for (uses `===`).
|
|
1150
|
+
|
|
1151
|
+
#### Returns
|
|
1152
|
+
|
|
1153
|
+
`boolean`
|
|
1154
|
+
|
|
1155
|
+
`true` if found.
|
|
1156
|
+
|
|
1157
|
+
#### Remarks
|
|
1158
|
+
|
|
1159
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1).
|
|
1160
|
+
|
|
1161
|
+
#### Inherited from
|
|
1162
|
+
|
|
1163
|
+
[`LinearBase`](LinearBase.md).[`includes`](LinearBase.md#includes)
|
|
1164
|
+
|
|
1165
|
+
***
|
|
1166
|
+
|
|
1125
1167
|
### indexOf()
|
|
1126
1168
|
|
|
1127
1169
|
```ts
|
|
@@ -1168,7 +1210,7 @@ Time O(n), Space O(1)
|
|
|
1168
1210
|
isEmpty(): boolean;
|
|
1169
1211
|
```
|
|
1170
1212
|
|
|
1171
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1213
|
+
Defined in: [data-structures/queue/queue.ts:232](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L232)
|
|
1172
1214
|
|
|
1173
1215
|
Check whether the queue is empty.
|
|
1174
1216
|
|
|
@@ -1178,8 +1220,6 @@ Check whether the queue is empty.
|
|
|
1178
1220
|
|
|
1179
1221
|
True if length is 0.
|
|
1180
1222
|
|
|
1181
|
-
*
|
|
1182
|
-
|
|
1183
1223
|
#### Remarks
|
|
1184
1224
|
|
|
1185
1225
|
Time O(1), Space O(1)
|
|
@@ -1218,7 +1258,7 @@ Time O(1), Space O(1)
|
|
|
1218
1258
|
join(separator?): string;
|
|
1219
1259
|
```
|
|
1220
1260
|
|
|
1221
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1261
|
+
Defined in: [data-structures/base/linear-base.ts:218](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L218)
|
|
1222
1262
|
|
|
1223
1263
|
Join all elements into a string.
|
|
1224
1264
|
|
|
@@ -1246,13 +1286,37 @@ Time O(n), Space O(n)
|
|
|
1246
1286
|
|
|
1247
1287
|
***
|
|
1248
1288
|
|
|
1289
|
+
### keys()
|
|
1290
|
+
|
|
1291
|
+
```ts
|
|
1292
|
+
keys(): IterableIterator<number>;
|
|
1293
|
+
```
|
|
1294
|
+
|
|
1295
|
+
Defined in: [data-structures/base/iterable-element-base.ts:218](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L218)
|
|
1296
|
+
|
|
1297
|
+
Return an iterator of numeric indices (Array-compatible).
|
|
1298
|
+
|
|
1299
|
+
#### Returns
|
|
1300
|
+
|
|
1301
|
+
`IterableIterator`\<`number`\>
|
|
1302
|
+
|
|
1303
|
+
#### Remarks
|
|
1304
|
+
|
|
1305
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
1306
|
+
|
|
1307
|
+
#### Inherited from
|
|
1308
|
+
|
|
1309
|
+
[`LinearBase`](LinearBase.md).[`keys`](LinearBase.md#keys)
|
|
1310
|
+
|
|
1311
|
+
***
|
|
1312
|
+
|
|
1249
1313
|
### lastIndexOf()
|
|
1250
1314
|
|
|
1251
1315
|
```ts
|
|
1252
1316
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
1253
1317
|
```
|
|
1254
1318
|
|
|
1255
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1319
|
+
Defined in: [data-structures/base/linear-base.ts:129](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L129)
|
|
1256
1320
|
|
|
1257
1321
|
Last index of a value from the right.
|
|
1258
1322
|
|
|
@@ -1295,7 +1359,7 @@ map<EM, RM>(
|
|
|
1295
1359
|
thisArg?): Queue<EM, RM>;
|
|
1296
1360
|
```
|
|
1297
1361
|
|
|
1298
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1362
|
+
Defined in: [data-structures/queue/queue.ts:513](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L513)
|
|
1299
1363
|
|
|
1300
1364
|
Map each element to a new element in a possibly different-typed queue.
|
|
1301
1365
|
|
|
@@ -1335,8 +1399,6 @@ Value for `this` inside the callback.
|
|
|
1335
1399
|
|
|
1336
1400
|
A new Queue with mapped elements.
|
|
1337
1401
|
|
|
1338
|
-
*
|
|
1339
|
-
|
|
1340
1402
|
#### Remarks
|
|
1341
1403
|
|
|
1342
1404
|
Time O(N), Space O(N)
|
|
@@ -1362,7 +1424,7 @@ Time O(N), Space O(N)
|
|
|
1362
1424
|
mapSame(callback, thisArg?): this;
|
|
1363
1425
|
```
|
|
1364
1426
|
|
|
1365
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1427
|
+
Defined in: [data-structures/queue/queue.ts:535](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L535)
|
|
1366
1428
|
|
|
1367
1429
|
Map each element to a new value of the same type.
|
|
1368
1430
|
|
|
@@ -1402,7 +1464,7 @@ Time O(N), Space O(N)
|
|
|
1402
1464
|
peek(): E | undefined;
|
|
1403
1465
|
```
|
|
1404
1466
|
|
|
1405
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1467
|
+
Defined in: [data-structures/queue/queue.ts:205](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L205)
|
|
1406
1468
|
|
|
1407
1469
|
Peek at the front element without removing it (alias for `first`).
|
|
1408
1470
|
|
|
@@ -1424,7 +1486,7 @@ Time O(1), Space O(1)
|
|
|
1424
1486
|
print(): void;
|
|
1425
1487
|
```
|
|
1426
1488
|
|
|
1427
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1489
|
+
Defined in: [data-structures/base/iterable-element-base.ts:298](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L298)
|
|
1428
1490
|
|
|
1429
1491
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1430
1492
|
|
|
@@ -1450,7 +1512,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1450
1512
|
push(element): boolean;
|
|
1451
1513
|
```
|
|
1452
1514
|
|
|
1453
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1515
|
+
Defined in: [data-structures/queue/queue.ts:252](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L252)
|
|
1454
1516
|
|
|
1455
1517
|
Enqueue one element at the back.
|
|
1456
1518
|
|
|
@@ -1468,8 +1530,6 @@ Element to enqueue.
|
|
|
1468
1530
|
|
|
1469
1531
|
True on success.
|
|
1470
1532
|
|
|
1471
|
-
*
|
|
1472
|
-
|
|
1473
1533
|
#### Remarks
|
|
1474
1534
|
|
|
1475
1535
|
Time O(1), Space O(1)
|
|
@@ -1500,7 +1560,7 @@ Time O(1), Space O(1)
|
|
|
1500
1560
|
pushMany(elements): boolean[];
|
|
1501
1561
|
```
|
|
1502
1562
|
|
|
1503
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1563
|
+
Defined in: [data-structures/queue/queue.ts:264](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L264)
|
|
1504
1564
|
|
|
1505
1565
|
Enqueue many elements from an iterable.
|
|
1506
1566
|
|
|
@@ -1566,7 +1626,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1566
1626
|
reduce(callbackfn): E;
|
|
1567
1627
|
```
|
|
1568
1628
|
|
|
1569
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1629
|
+
Defined in: [data-structures/base/iterable-element-base.ts:225](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L225)
|
|
1570
1630
|
|
|
1571
1631
|
##### Parameters
|
|
1572
1632
|
|
|
@@ -1588,7 +1648,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1588
1648
|
reduce(callbackfn, initialValue): E;
|
|
1589
1649
|
```
|
|
1590
1650
|
|
|
1591
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1651
|
+
Defined in: [data-structures/base/iterable-element-base.ts:226](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L226)
|
|
1592
1652
|
|
|
1593
1653
|
##### Parameters
|
|
1594
1654
|
|
|
@@ -1614,7 +1674,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1614
1674
|
reduce<U>(callbackfn, initialValue): U;
|
|
1615
1675
|
```
|
|
1616
1676
|
|
|
1617
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1677
|
+
Defined in: [data-structures/base/iterable-element-base.ts:227](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L227)
|
|
1618
1678
|
|
|
1619
1679
|
##### Type Parameters
|
|
1620
1680
|
|
|
@@ -1648,7 +1708,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1648
1708
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1649
1709
|
```
|
|
1650
1710
|
|
|
1651
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1711
|
+
Defined in: [data-structures/base/linear-base.ts:245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L245)
|
|
1652
1712
|
|
|
1653
1713
|
Right-to-left reduction over elements.
|
|
1654
1714
|
|
|
@@ -1694,7 +1754,7 @@ Time O(n), Space O(1)
|
|
|
1694
1754
|
reverse(): this;
|
|
1695
1755
|
```
|
|
1696
1756
|
|
|
1697
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1757
|
+
Defined in: [data-structures/queue/queue.ts:397](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L397)
|
|
1698
1758
|
|
|
1699
1759
|
Reverse the queue in-place by compacting then reversing.
|
|
1700
1760
|
|
|
@@ -1720,7 +1780,7 @@ Time O(N), Space O(N)
|
|
|
1720
1780
|
setAt(index, newElement): boolean;
|
|
1721
1781
|
```
|
|
1722
1782
|
|
|
1723
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1783
|
+
Defined in: [data-structures/queue/queue.ts:370](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L370)
|
|
1724
1784
|
|
|
1725
1785
|
Replace the element at a given index.
|
|
1726
1786
|
|
|
@@ -1760,7 +1820,7 @@ Time O(1), Space O(1)
|
|
|
1760
1820
|
shift(): E | undefined;
|
|
1761
1821
|
```
|
|
1762
1822
|
|
|
1763
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1823
|
+
Defined in: [data-structures/queue/queue.ts:292](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L292)
|
|
1764
1824
|
|
|
1765
1825
|
Dequeue one element from the front (amortized via offset).
|
|
1766
1826
|
|
|
@@ -1770,8 +1830,6 @@ Dequeue one element from the front (amortized via offset).
|
|
|
1770
1830
|
|
|
1771
1831
|
Removed element or undefined.
|
|
1772
1832
|
|
|
1773
|
-
*
|
|
1774
|
-
|
|
1775
1833
|
#### Remarks
|
|
1776
1834
|
|
|
1777
1835
|
Time O(1) amortized, Space O(1)
|
|
@@ -1802,7 +1860,7 @@ Time O(1) amortized, Space O(1)
|
|
|
1802
1860
|
slice(start?, end?): this;
|
|
1803
1861
|
```
|
|
1804
1862
|
|
|
1805
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1863
|
+
Defined in: [data-structures/base/linear-base.ts:261](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L261)
|
|
1806
1864
|
|
|
1807
1865
|
Create a shallow copy of a subrange.
|
|
1808
1866
|
|
|
@@ -1882,7 +1940,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
1882
1940
|
sort(compareFn?): this;
|
|
1883
1941
|
```
|
|
1884
1942
|
|
|
1885
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1943
|
+
Defined in: [data-structures/base/linear-base.ts:179](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L179)
|
|
1886
1944
|
|
|
1887
1945
|
In-place stable order via array sort semantics.
|
|
1888
1946
|
|
|
@@ -1919,7 +1977,7 @@ splice(
|
|
|
1919
1977
|
items?): this;
|
|
1920
1978
|
```
|
|
1921
1979
|
|
|
1922
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
1980
|
+
Defined in: [data-structures/queue/queue.ts:444](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L444)
|
|
1923
1981
|
|
|
1924
1982
|
Remove and/or insert elements at a position (array-like).
|
|
1925
1983
|
|
|
@@ -1965,7 +2023,7 @@ Time O(N + M), Space O(M)
|
|
|
1965
2023
|
toArray(): E[];
|
|
1966
2024
|
```
|
|
1967
2025
|
|
|
1968
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2026
|
+
Defined in: [data-structures/base/iterable-element-base.ts:275](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L275)
|
|
1969
2027
|
|
|
1970
2028
|
Materializes the elements into a new array.
|
|
1971
2029
|
|
|
@@ -1985,13 +2043,39 @@ Time O(n), Space O(n).
|
|
|
1985
2043
|
|
|
1986
2044
|
***
|
|
1987
2045
|
|
|
2046
|
+
### toReversed()
|
|
2047
|
+
|
|
2048
|
+
```ts
|
|
2049
|
+
toReversed(): this;
|
|
2050
|
+
```
|
|
2051
|
+
|
|
2052
|
+
Defined in: [data-structures/base/linear-base.ts:319](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L319)
|
|
2053
|
+
|
|
2054
|
+
Return a new instance of the same type with elements in reverse order (non-mutating).
|
|
2055
|
+
|
|
2056
|
+
#### Returns
|
|
2057
|
+
|
|
2058
|
+
`this`
|
|
2059
|
+
|
|
2060
|
+
A new reversed instance.
|
|
2061
|
+
|
|
2062
|
+
#### Remarks
|
|
2063
|
+
|
|
2064
|
+
Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
|
|
2065
|
+
|
|
2066
|
+
#### Inherited from
|
|
2067
|
+
|
|
2068
|
+
[`LinearBase`](LinearBase.md).[`toReversed`](LinearBase.md#toreversed)
|
|
2069
|
+
|
|
2070
|
+
***
|
|
2071
|
+
|
|
1988
2072
|
### toReversedArray()
|
|
1989
2073
|
|
|
1990
2074
|
```ts
|
|
1991
2075
|
toReversedArray(): E[];
|
|
1992
2076
|
```
|
|
1993
2077
|
|
|
1994
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
2078
|
+
Defined in: [data-structures/base/linear-base.ts:227](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L227)
|
|
1995
2079
|
|
|
1996
2080
|
Snapshot elements into a reversed array.
|
|
1997
2081
|
|
|
@@ -2017,7 +2101,7 @@ Time O(n), Space O(n)
|
|
|
2017
2101
|
toVisual(): E[];
|
|
2018
2102
|
```
|
|
2019
2103
|
|
|
2020
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
2104
|
+
Defined in: [data-structures/base/iterable-element-base.ts:287](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L287)
|
|
2021
2105
|
|
|
2022
2106
|
Returns a representation of the structure suitable for quick visualization.
|
|
2023
2107
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -2070,7 +2154,7 @@ Creating the iterator is O(1); full iteration is Time O(n), Space O(1).
|
|
|
2070
2154
|
static fromArray<E>(elements): Queue<E>;
|
|
2071
2155
|
```
|
|
2072
2156
|
|
|
2073
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2157
|
+
Defined in: [data-structures/queue/queue.ts:196](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L196)
|
|
2074
2158
|
|
|
2075
2159
|
Create a queue from an array of elements.
|
|
2076
2160
|
|
|
@@ -2139,7 +2223,7 @@ Time O(1), Space O(1).
|
|
|
2139
2223
|
protected _createInstance(options?): this;
|
|
2140
2224
|
```
|
|
2141
2225
|
|
|
2142
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2226
|
+
Defined in: [data-structures/queue/queue.ts:591](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L591)
|
|
2143
2227
|
|
|
2144
2228
|
(Protected) Create an empty instance of the same concrete class.
|
|
2145
2229
|
|
|
@@ -2173,7 +2257,7 @@ Time O(1), Space O(1)
|
|
|
2173
2257
|
protected _createLike<EM, RM>(elements?, options?): Queue<EM, RM>;
|
|
2174
2258
|
```
|
|
2175
2259
|
|
|
2176
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2260
|
+
Defined in: [data-structures/queue/queue.ts:605](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L605)
|
|
2177
2261
|
|
|
2178
2262
|
(Protected) Create a like-kind queue and seed it from an iterable.
|
|
2179
2263
|
|
|
@@ -2219,7 +2303,7 @@ Time O(N), Space O(N)
|
|
|
2219
2303
|
protected _getIterator(): IterableIterator<E>;
|
|
2220
2304
|
```
|
|
2221
2305
|
|
|
2222
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2306
|
+
Defined in: [data-structures/queue/queue.ts:569](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L569)
|
|
2223
2307
|
|
|
2224
2308
|
(Protected) Iterate elements from front to back.
|
|
2225
2309
|
|
|
@@ -2245,7 +2329,7 @@ Time O(N), Space O(1)
|
|
|
2245
2329
|
protected _getReverseIterator(): IterableIterator<E>;
|
|
2246
2330
|
```
|
|
2247
2331
|
|
|
2248
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2332
|
+
Defined in: [data-structures/queue/queue.ts:578](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L578)
|
|
2249
2333
|
|
|
2250
2334
|
(Protected) Iterate elements from back to front.
|
|
2251
2335
|
|
|
@@ -2271,7 +2355,7 @@ Time O(N), Space O(1)
|
|
|
2271
2355
|
protected _setAutoCompactRatio(value): void;
|
|
2272
2356
|
```
|
|
2273
2357
|
|
|
2274
|
-
Defined in: [data-structures/queue/queue.ts:
|
|
2358
|
+
Defined in: [data-structures/queue/queue.ts:560](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L560)
|
|
2275
2359
|
|
|
2276
2360
|
(Protected) Set the internal auto-compaction ratio.
|
|
2277
2361
|
|