data-structure-typed 2.6.0 → 2.6.1
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/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
- package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
- package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
- 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 +14 -14
- package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
- package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
- 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 +284 -3972
- 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
|
@@ -146,7 +146,7 @@ Optional configuration.
|
|
|
146
146
|
get comparator(): Comparator<E>;
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
149
|
+
Defined in: [data-structures/heap/heap.ts:1314](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1314)
|
|
150
150
|
|
|
151
151
|
Get the comparator used to order elements.
|
|
152
152
|
|
|
@@ -202,7 +202,7 @@ Internal elements array.
|
|
|
202
202
|
get leaf(): E | undefined;
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
205
|
+
Defined in: [data-structures/heap/heap.ts:251](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L251)
|
|
206
206
|
|
|
207
207
|
Get the last leaf element.
|
|
208
208
|
|
|
@@ -230,7 +230,7 @@ Last element or undefined.
|
|
|
230
230
|
get size(): number;
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
233
|
+
Defined in: [data-structures/heap/heap.ts:241](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L241)
|
|
234
234
|
|
|
235
235
|
Get the number of elements.
|
|
236
236
|
|
|
@@ -333,7 +333,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
|
|
|
333
333
|
add(element): boolean;
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
336
|
+
Defined in: [data-structures/heap/heap.ts:352](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L352)
|
|
337
337
|
|
|
338
338
|
Insert an element.
|
|
339
339
|
|
|
@@ -388,7 +388,7 @@ Time O(log N) amortized, Space O(1)
|
|
|
388
388
|
addMany(elements): boolean[];
|
|
389
389
|
```
|
|
390
390
|
|
|
391
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
391
|
+
Defined in: [data-structures/heap/heap.ts:409](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L409)
|
|
392
392
|
|
|
393
393
|
Insert many elements from an iterable.
|
|
394
394
|
|
|
@@ -434,7 +434,7 @@ Time O(N log N), Space O(1)
|
|
|
434
434
|
clear(): void;
|
|
435
435
|
```
|
|
436
436
|
|
|
437
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
437
|
+
Defined in: [data-structures/heap/heap.ts:761](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L761)
|
|
438
438
|
|
|
439
439
|
Remove all elements.
|
|
440
440
|
|
|
@@ -471,7 +471,7 @@ Time O(1), Space O(1)
|
|
|
471
471
|
clone(): this;
|
|
472
472
|
```
|
|
473
473
|
|
|
474
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
474
|
+
Defined in: [data-structures/heap/heap.ts:1136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1136)
|
|
475
475
|
|
|
476
476
|
Deep clone this heap.
|
|
477
477
|
|
|
@@ -510,7 +510,7 @@ Time O(N), Space O(N)
|
|
|
510
510
|
delete(element): boolean;
|
|
511
511
|
```
|
|
512
512
|
|
|
513
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
513
|
+
Defined in: [data-structures/heap/heap.ts:868](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L868)
|
|
514
514
|
|
|
515
515
|
Delete one occurrence of an element.
|
|
516
516
|
|
|
@@ -555,7 +555,7 @@ Time O(N), Space O(1)
|
|
|
555
555
|
deleteBy(predicate): boolean;
|
|
556
556
|
```
|
|
557
557
|
|
|
558
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
558
|
+
Defined in: [data-structures/heap/heap.ts:892](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L892)
|
|
559
559
|
|
|
560
560
|
#### Parameters
|
|
561
561
|
|
|
@@ -583,7 +583,7 @@ Use `deleteWhere` instead. Will be removed in a future major version.
|
|
|
583
583
|
deleteWhere(predicate): boolean;
|
|
584
584
|
```
|
|
585
585
|
|
|
586
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
586
|
+
Defined in: [data-structures/heap/heap.ts:902](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L902)
|
|
587
587
|
|
|
588
588
|
Delete the first element that matches a predicate.
|
|
589
589
|
|
|
@@ -617,7 +617,7 @@ Time O(N), Space O(1)
|
|
|
617
617
|
dfs(order?): E[];
|
|
618
618
|
```
|
|
619
619
|
|
|
620
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
620
|
+
Defined in: [data-structures/heap/heap.ts:980](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L980)
|
|
621
621
|
|
|
622
622
|
Traverse the binary heap as a complete binary tree and collect elements.
|
|
623
623
|
|
|
@@ -656,6 +656,30 @@ Time O(N), Space O(H)
|
|
|
656
656
|
|
|
657
657
|
***
|
|
658
658
|
|
|
659
|
+
### entries()
|
|
660
|
+
|
|
661
|
+
```ts
|
|
662
|
+
entries(): IterableIterator<[number, E]>;
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
Defined in: [data-structures/base/iterable-element-base.ts:208](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L208)
|
|
666
|
+
|
|
667
|
+
Return an iterator of `[index, value]` pairs (Array-compatible).
|
|
668
|
+
|
|
669
|
+
#### Returns
|
|
670
|
+
|
|
671
|
+
`IterableIterator`\<\[`number`, `E`\]\>
|
|
672
|
+
|
|
673
|
+
#### Remarks
|
|
674
|
+
|
|
675
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
676
|
+
|
|
677
|
+
#### Inherited from
|
|
678
|
+
|
|
679
|
+
[`Heap`](Heap.md).[`entries`](Heap.md#entries)
|
|
680
|
+
|
|
681
|
+
***
|
|
682
|
+
|
|
659
683
|
### every()
|
|
660
684
|
|
|
661
685
|
```ts
|
|
@@ -702,7 +726,7 @@ Time O(n) in the worst case; may exit early when the first failure is found. Spa
|
|
|
702
726
|
filter(callback, thisArg?): this;
|
|
703
727
|
```
|
|
704
728
|
|
|
705
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
729
|
+
Defined in: [data-structures/heap/heap.ts:1195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1195)
|
|
706
730
|
|
|
707
731
|
Filter elements into a new heap of the same class.
|
|
708
732
|
|
|
@@ -843,7 +867,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
|
|
|
843
867
|
fix(): boolean[];
|
|
844
868
|
```
|
|
845
869
|
|
|
846
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
870
|
+
Defined in: [data-structures/heap/heap.ts:1011](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1011)
|
|
847
871
|
|
|
848
872
|
Restore heap order bottom-up (heapify in-place).
|
|
849
873
|
|
|
@@ -909,7 +933,7 @@ Time O(n), Space O(1).
|
|
|
909
933
|
has(element): boolean;
|
|
910
934
|
```
|
|
911
935
|
|
|
912
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
936
|
+
Defined in: [data-structures/heap/heap.ts:812](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L812)
|
|
913
937
|
|
|
914
938
|
Check if an equal element exists in the heap.
|
|
915
939
|
|
|
@@ -948,13 +972,47 @@ Time O(N), Space O(1)
|
|
|
948
972
|
|
|
949
973
|
***
|
|
950
974
|
|
|
975
|
+
### includes()
|
|
976
|
+
|
|
977
|
+
```ts
|
|
978
|
+
includes(element): boolean;
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
Defined in: [data-structures/base/iterable-element-base.ts:200](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L200)
|
|
982
|
+
|
|
983
|
+
Check whether a value exists (Array-compatible alias for `has`).
|
|
984
|
+
|
|
985
|
+
#### Parameters
|
|
986
|
+
|
|
987
|
+
##### element
|
|
988
|
+
|
|
989
|
+
`E`
|
|
990
|
+
|
|
991
|
+
Element to search for (uses `===`).
|
|
992
|
+
|
|
993
|
+
#### Returns
|
|
994
|
+
|
|
995
|
+
`boolean`
|
|
996
|
+
|
|
997
|
+
`true` if found.
|
|
998
|
+
|
|
999
|
+
#### Remarks
|
|
1000
|
+
|
|
1001
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1).
|
|
1002
|
+
|
|
1003
|
+
#### Inherited from
|
|
1004
|
+
|
|
1005
|
+
[`Heap`](Heap.md).[`includes`](Heap.md#includes)
|
|
1006
|
+
|
|
1007
|
+
***
|
|
1008
|
+
|
|
951
1009
|
### isEmpty()
|
|
952
1010
|
|
|
953
1011
|
```ts
|
|
954
1012
|
isEmpty(): boolean;
|
|
955
1013
|
```
|
|
956
1014
|
|
|
957
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1015
|
+
Defined in: [data-structures/heap/heap.ts:706](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L706)
|
|
958
1016
|
|
|
959
1017
|
Check whether the heap is empty.
|
|
960
1018
|
|
|
@@ -986,6 +1044,30 @@ Time O(1), Space O(1)
|
|
|
986
1044
|
|
|
987
1045
|
***
|
|
988
1046
|
|
|
1047
|
+
### keys()
|
|
1048
|
+
|
|
1049
|
+
```ts
|
|
1050
|
+
keys(): IterableIterator<number>;
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
Defined in: [data-structures/base/iterable-element-base.ts:219](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L219)
|
|
1054
|
+
|
|
1055
|
+
Return an iterator of numeric indices (Array-compatible).
|
|
1056
|
+
|
|
1057
|
+
#### Returns
|
|
1058
|
+
|
|
1059
|
+
`IterableIterator`\<`number`\>
|
|
1060
|
+
|
|
1061
|
+
#### Remarks
|
|
1062
|
+
|
|
1063
|
+
Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
|
|
1064
|
+
|
|
1065
|
+
#### Inherited from
|
|
1066
|
+
|
|
1067
|
+
[`Heap`](Heap.md).[`keys`](Heap.md#keys)
|
|
1068
|
+
|
|
1069
|
+
***
|
|
1070
|
+
|
|
989
1071
|
### map()
|
|
990
1072
|
|
|
991
1073
|
```ts
|
|
@@ -995,7 +1077,7 @@ map<EM, RM>(
|
|
|
995
1077
|
thisArg?): Heap<EM, RM>;
|
|
996
1078
|
```
|
|
997
1079
|
|
|
998
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1080
|
+
Defined in: [data-structures/heap/heap.ts:1263](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1263)
|
|
999
1081
|
|
|
1000
1082
|
Map elements into a new heap of possibly different element type.
|
|
1001
1083
|
|
|
@@ -1062,7 +1144,7 @@ Time O(N log N), Space O(N)
|
|
|
1062
1144
|
mapSame(callback, thisArg?): this;
|
|
1063
1145
|
```
|
|
1064
1146
|
|
|
1065
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1147
|
+
Defined in: [data-structures/heap/heap.ts:1287](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1287)
|
|
1066
1148
|
|
|
1067
1149
|
Map elements into a new heap of the same element type.
|
|
1068
1150
|
|
|
@@ -1102,7 +1184,7 @@ Time O(N log N), Space O(N)
|
|
|
1102
1184
|
peek(): E | undefined;
|
|
1103
1185
|
```
|
|
1104
1186
|
|
|
1105
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1187
|
+
Defined in: [data-structures/heap/heap.ts:650](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L650)
|
|
1106
1188
|
|
|
1107
1189
|
Get the current top element without removing it.
|
|
1108
1190
|
|
|
@@ -1193,7 +1275,7 @@ Time O(1), Space O(1)
|
|
|
1193
1275
|
poll(): E | undefined;
|
|
1194
1276
|
```
|
|
1195
1277
|
|
|
1196
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1278
|
+
Defined in: [data-structures/heap/heap.ts:523](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L523)
|
|
1197
1279
|
|
|
1198
1280
|
#### Returns
|
|
1199
1281
|
|
|
@@ -1202,6 +1284,7 @@ Defined in: [data-structures/heap/heap.ts:511](https://github.com/zrwusa/data-st
|
|
|
1202
1284
|
#### Deprecated
|
|
1203
1285
|
|
|
1204
1286
|
Use `pop` instead. Will be removed in a future major version.
|
|
1287
|
+
|
|
1205
1288
|
*
|
|
1206
1289
|
|
|
1207
1290
|
#### Example
|
|
@@ -1245,7 +1328,7 @@ Use `pop` instead. Will be removed in a future major version.
|
|
|
1245
1328
|
pop(): E | undefined;
|
|
1246
1329
|
```
|
|
1247
1330
|
|
|
1248
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1331
|
+
Defined in: [data-structures/heap/heap.ts:532](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L532)
|
|
1249
1332
|
|
|
1250
1333
|
Remove and return the top element (min or max depending on comparator).
|
|
1251
1334
|
|
|
@@ -1271,7 +1354,7 @@ Time O(log N) amortized, Space O(1)
|
|
|
1271
1354
|
print(): void;
|
|
1272
1355
|
```
|
|
1273
1356
|
|
|
1274
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1357
|
+
Defined in: [data-structures/base/iterable-element-base.ts:301](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L301)
|
|
1275
1358
|
|
|
1276
1359
|
Prints `toVisual()` to the console. Intended for quick debugging.
|
|
1277
1360
|
|
|
@@ -1329,7 +1412,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
|
|
|
1329
1412
|
reduce(callbackfn): E;
|
|
1330
1413
|
```
|
|
1331
1414
|
|
|
1332
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1415
|
+
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)
|
|
1333
1416
|
|
|
1334
1417
|
##### Parameters
|
|
1335
1418
|
|
|
@@ -1351,7 +1434,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
|
|
|
1351
1434
|
reduce(callbackfn, initialValue): E;
|
|
1352
1435
|
```
|
|
1353
1436
|
|
|
1354
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1437
|
+
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)
|
|
1355
1438
|
|
|
1356
1439
|
##### Parameters
|
|
1357
1440
|
|
|
@@ -1377,7 +1460,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
|
|
|
1377
1460
|
reduce<U>(callbackfn, initialValue): U;
|
|
1378
1461
|
```
|
|
1379
1462
|
|
|
1380
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1463
|
+
Defined in: [data-structures/base/iterable-element-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L228)
|
|
1381
1464
|
|
|
1382
1465
|
##### Type Parameters
|
|
1383
1466
|
|
|
@@ -1411,7 +1494,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
|
|
|
1411
1494
|
setEquality(equals): this;
|
|
1412
1495
|
```
|
|
1413
1496
|
|
|
1414
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1497
|
+
Defined in: [data-structures/heap/heap.ts:930](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L930)
|
|
1415
1498
|
|
|
1416
1499
|
Set the equality comparator used by has/delete operations.
|
|
1417
1500
|
|
|
@@ -1485,7 +1568,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
|
|
|
1485
1568
|
sort(): E[];
|
|
1486
1569
|
```
|
|
1487
1570
|
|
|
1488
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1571
|
+
Defined in: [data-structures/heap/heap.ts:1072](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1072)
|
|
1489
1572
|
|
|
1490
1573
|
Return all elements in ascending order by repeatedly polling.
|
|
1491
1574
|
|
|
@@ -1522,7 +1605,7 @@ Time O(N log N), Space O(N)
|
|
|
1522
1605
|
toArray(): E[];
|
|
1523
1606
|
```
|
|
1524
1607
|
|
|
1525
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1608
|
+
Defined in: [data-structures/base/iterable-element-base.ts:278](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L278)
|
|
1526
1609
|
|
|
1527
1610
|
Materializes the elements into a new array.
|
|
1528
1611
|
|
|
@@ -1548,7 +1631,7 @@ Time O(n), Space O(n).
|
|
|
1548
1631
|
toVisual(): E[];
|
|
1549
1632
|
```
|
|
1550
1633
|
|
|
1551
|
-
Defined in: [data-structures/base/iterable-element-base.ts:
|
|
1634
|
+
Defined in: [data-structures/base/iterable-element-base.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L290)
|
|
1552
1635
|
|
|
1553
1636
|
Returns a representation of the structure suitable for quick visualization.
|
|
1554
1637
|
Defaults to an array of elements; subclasses may override to provide richer visuals.
|
|
@@ -1604,7 +1687,7 @@ static from<T, R, S>(
|
|
|
1604
1687
|
options?): S;
|
|
1605
1688
|
```
|
|
1606
1689
|
|
|
1607
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1690
|
+
Defined in: [data-structures/heap/heap.ts:266](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L266)
|
|
1608
1691
|
|
|
1609
1692
|
Create a heap of the same class from an iterable.
|
|
1610
1693
|
|
|
@@ -1662,7 +1745,7 @@ Time O(N), Space O(N)
|
|
|
1662
1745
|
static heapify<EE, RR>(elements, options): Heap<EE, RR>;
|
|
1663
1746
|
```
|
|
1664
1747
|
|
|
1665
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1748
|
+
Defined in: [data-structures/heap/heap.ts:284](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L284)
|
|
1666
1749
|
|
|
1667
1750
|
Build a Heap from an iterable in linear time given a comparator.
|
|
1668
1751
|
|
|
@@ -1745,7 +1828,7 @@ Time O(1), Space O(1).
|
|
|
1745
1828
|
protected _createInstance(options?): this;
|
|
1746
1829
|
```
|
|
1747
1830
|
|
|
1748
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1831
|
+
Defined in: [data-structures/heap/heap.ts:1360](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1360)
|
|
1749
1832
|
|
|
1750
1833
|
(Protected) Create an empty instance of the same concrete class.
|
|
1751
1834
|
|
|
@@ -1779,7 +1862,7 @@ Time O(1), Space O(1)
|
|
|
1779
1862
|
protected _createLike<EM, RM>(elements?, options?): Heap<EM, RM>;
|
|
1780
1863
|
```
|
|
1781
1864
|
|
|
1782
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1865
|
+
Defined in: [data-structures/heap/heap.ts:1378](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1378)
|
|
1783
1866
|
|
|
1784
1867
|
(Protected) Create a like-kind instance seeded by elements.
|
|
1785
1868
|
|
|
@@ -1829,7 +1912,7 @@ Time O(N log N), Space O(N)
|
|
|
1829
1912
|
protected _getIterator(): IterableIterator<E>;
|
|
1830
1913
|
```
|
|
1831
1914
|
|
|
1832
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1915
|
+
Defined in: [data-structures/heap/heap.ts:1318](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1318)
|
|
1833
1916
|
|
|
1834
1917
|
Internal iterator factory used by the default iterator.
|
|
1835
1918
|
|
|
@@ -1855,7 +1938,7 @@ Implementations should yield in O(1) per element with O(1) extra space when poss
|
|
|
1855
1938
|
protected _spawnLike<EM, RM>(options?): Heap<EM, RM>;
|
|
1856
1939
|
```
|
|
1857
1940
|
|
|
1858
|
-
Defined in: [data-structures/heap/heap.ts:
|
|
1941
|
+
Defined in: [data-structures/heap/heap.ts:1398](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1398)
|
|
1859
1942
|
|
|
1860
1943
|
(Protected) Spawn an empty like-kind heap instance.
|
|
1861
1944
|
|