data-structure-typed 2.6.1 → 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/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 +72 -104
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +67 -101
- 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 +40 -68
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +17 -17
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +38 -38
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +45 -45
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +68 -96
- 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 +38 -66
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +41 -74
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +38 -66
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +46 -79
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +40 -68
- package/docs-site-docusaurus/docs/api/classes/Queue.md +54 -78
- 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 +68 -98
- 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 +33 -53
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +104 -129
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +57 -124
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +45 -116
- package/docs-site-docusaurus/docs/api/classes/Trie.md +37 -61
- 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 +1 -1
- package/src/data-structures/binary-tree/tree-multi-set.ts +15 -11
|
@@ -194,7 +194,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
194
194
|
abstract addAt(index, newElementOrNode): boolean;
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
197
|
+
Defined in: [data-structures/base/linear-base.ts:372](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L372)
|
|
198
198
|
|
|
199
199
|
Insert an element/node at a position.
|
|
200
200
|
|
|
@@ -230,7 +230,7 @@ Time O(1)~O(n) depending on implementation, Space O(1)
|
|
|
230
230
|
abstract at(index): E | undefined;
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
233
|
+
Defined in: [data-structures/base/linear-base.ts:355](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L355)
|
|
234
234
|
|
|
235
235
|
Get element at an index.
|
|
236
236
|
|
|
@@ -260,7 +260,7 @@ Time O(1)~O(n) depending on implementation, Space O(1)
|
|
|
260
260
|
abstract clear(): void;
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
263
|
+
Defined in: [data-structures/base/iterable-element-base.ts:318](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L318)
|
|
264
264
|
|
|
265
265
|
Removes all elements from the structure.
|
|
266
266
|
|
|
@@ -286,7 +286,7 @@ Expected Time O(1) or O(n) depending on the implementation; Space O(1).
|
|
|
286
286
|
abstract clone(): this;
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
289
|
+
Defined in: [data-structures/base/linear-base.ts:305](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L305)
|
|
290
290
|
|
|
291
291
|
Deep clone while preserving concrete subtype.
|
|
292
292
|
|
|
@@ -312,7 +312,7 @@ Time O(n), Space O(n)
|
|
|
312
312
|
concat(...items): this;
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
315
|
+
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)
|
|
316
316
|
|
|
317
317
|
Concatenate elements and/or containers.
|
|
318
318
|
|
|
@@ -342,7 +342,7 @@ Time O(sum(length)), Space O(sum(length))
|
|
|
342
342
|
abstract delete(elementOrNode): boolean;
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
345
|
+
Defined in: [data-structures/base/linear-base.ts:347](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L347)
|
|
346
346
|
|
|
347
347
|
Remove one element or node if present.
|
|
348
348
|
|
|
@@ -372,7 +372,7 @@ Time O(1)~O(n) depending on implementation, Space O(1)
|
|
|
372
372
|
abstract deleteAt(pos): E | undefined;
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
375
|
+
Defined in: [data-structures/base/linear-base.ts:363](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L363)
|
|
376
376
|
|
|
377
377
|
Remove element at a position.
|
|
378
378
|
|
|
@@ -402,7 +402,7 @@ Time O(1)~O(n) depending on implementation, Space O(1)
|
|
|
402
402
|
entries(): IterableIterator<[number, E]>;
|
|
403
403
|
```
|
|
404
404
|
|
|
405
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
405
|
+
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)
|
|
406
406
|
|
|
407
407
|
Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
408
408
|
|
|
@@ -469,7 +469,7 @@ fill(
|
|
|
469
469
|
end?): this;
|
|
470
470
|
```
|
|
471
471
|
|
|
472
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
472
|
+
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)
|
|
473
473
|
|
|
474
474
|
Fill a range with a value.
|
|
475
475
|
|
|
@@ -511,7 +511,7 @@ Time O(n), Space O(1)
|
|
|
511
511
|
abstract filter(predicate, thisArg?): this;
|
|
512
512
|
```
|
|
513
513
|
|
|
514
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
514
|
+
Defined in: [data-structures/base/iterable-element-base.ts:370](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L370)
|
|
515
515
|
|
|
516
516
|
Filters elements using the provided predicate and returns the same concrete structure type.
|
|
517
517
|
|
|
@@ -641,7 +641,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
641
641
|
findIndex(predicate, thisArg?): number;
|
|
642
642
|
```
|
|
643
643
|
|
|
644
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
644
|
+
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)
|
|
645
645
|
|
|
646
646
|
Find the first index matching a predicate.
|
|
647
647
|
|
|
@@ -717,7 +717,7 @@ Time O(n), Space O(1).
|
|
|
717
717
|
has(element): boolean;
|
|
718
718
|
```
|
|
719
719
|
|
|
720
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
720
|
+
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)
|
|
721
721
|
|
|
722
722
|
Checks whether a strictly-equal element exists in the structure.
|
|
723
723
|
|
|
@@ -751,7 +751,7 @@ Time O(n) in the worst case. Space O(1).
|
|
|
751
751
|
includes(element): boolean;
|
|
752
752
|
```
|
|
753
753
|
|
|
754
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
754
|
+
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)
|
|
755
755
|
|
|
756
756
|
Check whether a value exists (Array-compatible alias for `has`).
|
|
757
757
|
|
|
@@ -821,7 +821,7 @@ Time O(n), Space O(1)
|
|
|
821
821
|
abstract isEmpty(): boolean;
|
|
822
822
|
```
|
|
823
823
|
|
|
824
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
824
|
+
Defined in: [data-structures/base/iterable-element-base.ts:309](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L309)
|
|
825
825
|
|
|
826
826
|
Indicates whether the structure currently contains no elements.
|
|
827
827
|
|
|
@@ -847,7 +847,7 @@ Expected Time O(1), Space O(1) for most implementations.
|
|
|
847
847
|
join(separator?): string;
|
|
848
848
|
```
|
|
849
849
|
|
|
850
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
850
|
+
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)
|
|
851
851
|
|
|
852
852
|
Join all elements into a string.
|
|
853
853
|
|
|
@@ -877,7 +877,7 @@ Time O(n), Space O(n)
|
|
|
877
877
|
keys(): IterableIterator<number>;
|
|
878
878
|
```
|
|
879
879
|
|
|
880
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
880
|
+
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)
|
|
881
881
|
|
|
882
882
|
Return an iterator of numeric indices (Array-compatible).
|
|
883
883
|
|
|
@@ -901,7 +901,7 @@ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per st
|
|
|
901
901
|
lastIndexOf(searchElement, fromIndex?): number;
|
|
902
902
|
```
|
|
903
903
|
|
|
904
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
904
|
+
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)
|
|
905
905
|
|
|
906
906
|
Last index of a value from the right.
|
|
907
907
|
|
|
@@ -940,7 +940,7 @@ abstract map<EM, RM>(
|
|
|
940
940
|
thisArg?): IterableElementBase<EM, RM>;
|
|
941
941
|
```
|
|
942
942
|
|
|
943
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
943
|
+
Defined in: [data-structures/base/iterable-element-base.ts:342](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L342)
|
|
944
944
|
|
|
945
945
|
Maps each element to a new element and returns a new iterable structure.
|
|
946
946
|
|
|
@@ -1000,7 +1000,7 @@ Time O(n), Space O(n).
|
|
|
1000
1000
|
abstract mapSame(callback, thisArg?): this;
|
|
1001
1001
|
```
|
|
1002
1002
|
|
|
1003
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1003
|
+
Defined in: [data-structures/base/iterable-element-base.ts:358](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L358)
|
|
1004
1004
|
|
|
1005
1005
|
Maps each element to the same element type and returns the same concrete structure type.
|
|
1006
1006
|
|
|
@@ -1040,7 +1040,7 @@ Time O(n), Space O(n).
|
|
|
1040
1040
|
print(): void;
|
|
1041
1041
|
```
|
|
1042
1042
|
|
|
1043
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1043
|
+
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)
|
|
1044
1044
|
|
|
1045
1045
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1046
1046
|
|
|
@@ -1066,7 +1066,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
|
|
|
1066
1066
|
abstract push(elementOrNode): boolean;
|
|
1067
1067
|
```
|
|
1068
1068
|
|
|
1069
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1069
|
+
Defined in: [data-structures/base/linear-base.ts:331](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L331)
|
|
1070
1070
|
|
|
1071
1071
|
Append one element or node to the tail.
|
|
1072
1072
|
|
|
@@ -1096,7 +1096,7 @@ Time O(1) amortized typical, Space O(1)
|
|
|
1096
1096
|
abstract pushMany(elements): boolean[];
|
|
1097
1097
|
```
|
|
1098
1098
|
|
|
1099
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1099
|
+
Defined in: [data-structures/base/linear-base.ts:339](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L339)
|
|
1100
1100
|
|
|
1101
1101
|
Append many elements/nodes at once.
|
|
1102
1102
|
|
|
@@ -1160,7 +1160,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1160
1160
|
reduce(callbackfn): E;
|
|
1161
1161
|
```
|
|
1162
1162
|
|
|
1163
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1163
|
+
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)
|
|
1164
1164
|
|
|
1165
1165
|
##### Parameters
|
|
1166
1166
|
|
|
@@ -1182,7 +1182,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:226](https://github.c
|
|
|
1182
1182
|
reduce(callbackfn, initialValue): E;
|
|
1183
1183
|
```
|
|
1184
1184
|
|
|
1185
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1185
|
+
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)
|
|
1186
1186
|
|
|
1187
1187
|
##### Parameters
|
|
1188
1188
|
|
|
@@ -1208,7 +1208,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:227](https://github.c
|
|
|
1208
1208
|
reduce<U>(callbackfn, initialValue): U;
|
|
1209
1209
|
```
|
|
1210
1210
|
|
|
1211
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1211
|
+
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)
|
|
1212
1212
|
|
|
1213
1213
|
##### Type Parameters
|
|
1214
1214
|
|
|
@@ -1242,7 +1242,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:228](https://github.c
|
|
|
1242
1242
|
reduceRight<U>(callbackfn, initialValue): U;
|
|
1243
1243
|
```
|
|
1244
1244
|
|
|
1245
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1245
|
+
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)
|
|
1246
1246
|
|
|
1247
1247
|
Right-to-left reduction over elements.
|
|
1248
1248
|
|
|
@@ -1284,7 +1284,7 @@ Time O(n), Space O(1)
|
|
|
1284
1284
|
abstract reverse(): this;
|
|
1285
1285
|
```
|
|
1286
1286
|
|
|
1287
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1287
|
+
Defined in: [data-structures/base/linear-base.ts:312](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L312)
|
|
1288
1288
|
|
|
1289
1289
|
Reverse the order of elements in-place (or equivalent).
|
|
1290
1290
|
|
|
@@ -1306,7 +1306,7 @@ Time O(n), Space O(1)
|
|
|
1306
1306
|
abstract setAt(index, value): boolean;
|
|
1307
1307
|
```
|
|
1308
1308
|
|
|
1309
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1309
|
+
Defined in: [data-structures/base/linear-base.ts:298](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L298)
|
|
1310
1310
|
|
|
1311
1311
|
Set the value at an index.
|
|
1312
1312
|
|
|
@@ -1342,7 +1342,7 @@ Time O(1) typical, Space O(1)
|
|
|
1342
1342
|
slice(start?, end?): this;
|
|
1343
1343
|
```
|
|
1344
1344
|
|
|
1345
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1345
|
+
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)
|
|
1346
1346
|
|
|
1347
1347
|
Create a shallow copy of a subrange.
|
|
1348
1348
|
|
|
@@ -1418,7 +1418,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
1418
1418
|
sort(compareFn?): this;
|
|
1419
1419
|
```
|
|
1420
1420
|
|
|
1421
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1421
|
+
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)
|
|
1422
1422
|
|
|
1423
1423
|
In-place stable order via array sort semantics.
|
|
1424
1424
|
|
|
@@ -1451,7 +1451,7 @@ splice(
|
|
|
1451
1451
|
items): this;
|
|
1452
1452
|
```
|
|
1453
1453
|
|
|
1454
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1454
|
+
Defined in: [data-structures/base/linear-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L195)
|
|
1455
1455
|
|
|
1456
1456
|
Remove and/or insert elements at a position (array-compatible).
|
|
1457
1457
|
|
|
@@ -1493,7 +1493,7 @@ Time O(n + m), Space O(min(n, m)) where `m = items.length`
|
|
|
1493
1493
|
toArray(): E[];
|
|
1494
1494
|
```
|
|
1495
1495
|
|
|
1496
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1496
|
+
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)
|
|
1497
1497
|
|
|
1498
1498
|
Materializes the elements into a new array.
|
|
1499
1499
|
|
|
@@ -1519,7 +1519,7 @@ Time O(n), Space O(n).
|
|
|
1519
1519
|
toReversed(): this;
|
|
1520
1520
|
```
|
|
1521
1521
|
|
|
1522
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1522
|
+
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)
|
|
1523
1523
|
|
|
1524
1524
|
Return a new instance of the same type with elements in reverse order (non-mutating).
|
|
1525
1525
|
|
|
@@ -1541,7 +1541,7 @@ Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O
|
|
|
1541
1541
|
toReversedArray(): E[];
|
|
1542
1542
|
```
|
|
1543
1543
|
|
|
1544
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1544
|
+
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)
|
|
1545
1545
|
|
|
1546
1546
|
Snapshot elements into a reversed array.
|
|
1547
1547
|
|
|
@@ -1563,7 +1563,7 @@ Time O(n), Space O(n)
|
|
|
1563
1563
|
toVisual(): E[];
|
|
1564
1564
|
```
|
|
1565
1565
|
|
|
1566
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1566
|
+
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)
|
|
1567
1567
|
|
|
1568
1568
|
Returns a representation of the structure suitable for quick visualization.
|
|
1569
1569
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -1649,7 +1649,7 @@ Time O(1), Space O(1).
|
|
|
1649
1649
|
abstract protected _createInstance(options?): this;
|
|
1650
1650
|
```
|
|
1651
1651
|
|
|
1652
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1652
|
+
Defined in: [data-structures/base/linear-base.ts:380](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L380)
|
|
1653
1653
|
|
|
1654
1654
|
Create an empty list of the same species.
|
|
1655
1655
|
|
|
@@ -1679,7 +1679,7 @@ Time O(1), Space O(1)
|
|
|
1679
1679
|
abstract protected _getIterator(...args): IterableIterator<E>;
|
|
1680
1680
|
```
|
|
1681
1681
|
|
|
1682
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1682
|
+
Defined in: [data-structures/base/iterable-element-base.ts:381](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L381)
|
|
1683
1683
|
|
|
1684
1684
|
Internal iterator factory used by the default iterator.
|
|
1685
1685
|
|
|
@@ -1713,7 +1713,7 @@ Implementations should yield in O(1) per element with O(1) extra space when poss
|
|
|
1713
1713
|
abstract protected _getReverseIterator(...args): IterableIterator<E>;
|
|
1714
1714
|
```
|
|
1715
1715
|
|
|
1716
|
-
Defined in: [data-structures/base/linear-base.ts:
|
|
1716
|
+
Defined in: [data-structures/base/linear-base.ts:387](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L387)
|
|
1717
1717
|
|
|
1718
1718
|
Reverse-direction iterator over elements.
|
|
1719
1719
|
|