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.
Files changed (80) hide show
  1. package/.github/workflows/ci.yml +7 -2
  2. package/.github/workflows/release-package.yml +9 -2
  3. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
  4. package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
  5. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
  6. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
  7. package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
  8. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
  9. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
  10. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  11. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  12. package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
  13. package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
  14. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
  15. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
  16. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
  17. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
  18. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
  19. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
  20. package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
  21. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
  22. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
  23. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
  24. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
  25. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
  26. package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
  27. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
  28. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
  29. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
  30. package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
  31. package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
  32. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
  33. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
  34. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
  35. package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
  36. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
  37. package/package.json +45 -46
  38. package/src/common/error.ts +15 -32
  39. package/src/common/index.ts +0 -3
  40. package/src/data-structures/base/iterable-element-base.ts +0 -3
  41. package/src/data-structures/base/linear-base.ts +2 -36
  42. package/src/data-structures/binary-tree/avl-tree.ts +31 -529
  43. package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
  44. package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
  45. package/src/data-structures/binary-tree/bst.ts +158 -1082
  46. package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
  47. package/src/data-structures/binary-tree/segment-tree.ts +73 -351
  48. package/src/data-structures/binary-tree/tree-map.ts +462 -5124
  49. package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
  50. package/src/data-structures/binary-tree/tree-multi-set.ts +284 -3972
  51. package/src/data-structures/binary-tree/tree-set.ts +338 -4836
  52. package/src/data-structures/graph/abstract-graph.ts +98 -167
  53. package/src/data-structures/graph/directed-graph.ts +137 -562
  54. package/src/data-structures/graph/map-graph.ts +0 -3
  55. package/src/data-structures/graph/undirected-graph.ts +132 -511
  56. package/src/data-structures/hash/hash-map.ts +154 -582
  57. package/src/data-structures/heap/heap.ts +200 -795
  58. package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
  59. package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
  60. package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
  61. package/src/data-structures/matrix/matrix.ts +179 -518
  62. package/src/data-structures/matrix/navigator.ts +0 -1
  63. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
  64. package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
  65. package/src/data-structures/priority-queue/priority-queue.ts +1 -2
  66. package/src/data-structures/queue/deque.ts +214 -882
  67. package/src/data-structures/queue/queue.ts +102 -625
  68. package/src/data-structures/stack/stack.ts +76 -505
  69. package/src/data-structures/trie/trie.ts +98 -628
  70. package/src/types/common.ts +0 -10
  71. package/src/types/data-structures/binary-tree/bst.ts +0 -7
  72. package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
  73. package/src/types/data-structures/graph/abstract-graph.ts +0 -2
  74. package/src/types/data-structures/hash/hash-map.ts +0 -3
  75. package/src/types/data-structures/hash/index.ts +0 -1
  76. package/src/types/data-structures/matrix/navigator.ts +0 -2
  77. package/src/types/utils/utils.ts +0 -7
  78. package/src/types/utils/validate-type.ts +0 -7
  79. package/src/utils/number.ts +0 -2
  80. package/src/utils/utils.ts +0 -5
@@ -133,7 +133,7 @@ Optional configuration.
133
133
  get comparator(): Comparator<E>;
134
134
  ```
135
135
 
136
- Defined in: [data-structures/heap/heap.ts:1272](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1272)
136
+ Defined in: [data-structures/heap/heap.ts:1314](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1314)
137
137
 
138
138
  Get the comparator used to order elements.
139
139
 
@@ -189,7 +189,7 @@ Internal elements array.
189
189
  get leaf(): E | undefined;
190
190
  ```
191
191
 
192
- Defined in: [data-structures/heap/heap.ts:248](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L248)
192
+ Defined in: [data-structures/heap/heap.ts:251](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L251)
193
193
 
194
194
  Get the last leaf element.
195
195
 
@@ -217,7 +217,7 @@ Last element or undefined.
217
217
  get size(): number;
218
218
  ```
219
219
 
220
- Defined in: [data-structures/heap/heap.ts:238](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L238)
220
+ Defined in: [data-structures/heap/heap.ts:241](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L241)
221
221
 
222
222
  Get the number of elements.
223
223
 
@@ -320,7 +320,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
320
320
  add(element): boolean;
321
321
  ```
322
322
 
323
- Defined in: [data-structures/heap/heap.ts:346](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L346)
323
+ Defined in: [data-structures/heap/heap.ts:352](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L352)
324
324
 
325
325
  Insert an element.
326
326
 
@@ -375,7 +375,7 @@ Time O(log N) amortized, Space O(1)
375
375
  addMany(elements): boolean[];
376
376
  ```
377
377
 
378
- Defined in: [data-structures/heap/heap.ts:400](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L400)
378
+ Defined in: [data-structures/heap/heap.ts:409](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L409)
379
379
 
380
380
  Insert many elements from an iterable.
381
381
 
@@ -421,7 +421,7 @@ Time O(N log N), Space O(1)
421
421
  clear(): void;
422
422
  ```
423
423
 
424
- Defined in: [data-structures/heap/heap.ts:740](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L740)
424
+ Defined in: [data-structures/heap/heap.ts:761](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L761)
425
425
 
426
426
  Remove all elements.
427
427
 
@@ -458,7 +458,7 @@ Time O(1), Space O(1)
458
458
  clone(): this;
459
459
  ```
460
460
 
461
- Defined in: [data-structures/heap/heap.ts:1100](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1100)
461
+ Defined in: [data-structures/heap/heap.ts:1136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1136)
462
462
 
463
463
  Deep clone this heap.
464
464
 
@@ -497,7 +497,7 @@ Time O(N), Space O(N)
497
497
  delete(element): boolean;
498
498
  ```
499
499
 
500
- Defined in: [data-structures/heap/heap.ts:841](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L841)
500
+ Defined in: [data-structures/heap/heap.ts:868](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L868)
501
501
 
502
502
  Delete one occurrence of an element.
503
503
 
@@ -542,7 +542,7 @@ Time O(N), Space O(1)
542
542
  deleteBy(predicate): boolean;
543
543
  ```
544
544
 
545
- Defined in: [data-structures/heap/heap.ts:865](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L865)
545
+ Defined in: [data-structures/heap/heap.ts:892](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L892)
546
546
 
547
547
  #### Parameters
548
548
 
@@ -570,7 +570,7 @@ Use `deleteWhere` instead. Will be removed in a future major version.
570
570
  deleteWhere(predicate): boolean;
571
571
  ```
572
572
 
573
- Defined in: [data-structures/heap/heap.ts:875](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L875)
573
+ Defined in: [data-structures/heap/heap.ts:902](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L902)
574
574
 
575
575
  Delete the first element that matches a predicate.
576
576
 
@@ -604,7 +604,7 @@ Time O(N), Space O(1)
604
604
  dfs(order?): E[];
605
605
  ```
606
606
 
607
- Defined in: [data-structures/heap/heap.ts:950](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L950)
607
+ Defined in: [data-structures/heap/heap.ts:980](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L980)
608
608
 
609
609
  Traverse the binary heap as a complete binary tree and collect elements.
610
610
 
@@ -643,6 +643,30 @@ Time O(N), Space O(H)
643
643
 
644
644
  ***
645
645
 
646
+ ### entries()
647
+
648
+ ```ts
649
+ entries(): IterableIterator<[number, E]>;
650
+ ```
651
+
652
+ 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)
653
+
654
+ Return an iterator of `[index, value]` pairs (Array-compatible).
655
+
656
+ #### Returns
657
+
658
+ `IterableIterator`\<\[`number`, `E`\]\>
659
+
660
+ #### Remarks
661
+
662
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
663
+
664
+ #### Inherited from
665
+
666
+ [`Heap`](Heap.md).[`entries`](Heap.md#entries)
667
+
668
+ ***
669
+
646
670
  ### every()
647
671
 
648
672
  ```ts
@@ -689,7 +713,7 @@ Time O(n) in the worst case; may exit early when the first failure is found. Spa
689
713
  filter(callback, thisArg?): this;
690
714
  ```
691
715
 
692
- Defined in: [data-structures/heap/heap.ts:1156](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1156)
716
+ Defined in: [data-structures/heap/heap.ts:1195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1195)
693
717
 
694
718
  Filter elements into a new heap of the same class.
695
719
 
@@ -830,7 +854,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
830
854
  fix(): boolean[];
831
855
  ```
832
856
 
833
- Defined in: [data-structures/heap/heap.ts:981](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L981)
857
+ Defined in: [data-structures/heap/heap.ts:1011](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1011)
834
858
 
835
859
  Restore heap order bottom-up (heapify in-place).
836
860
 
@@ -896,7 +920,7 @@ Time O(n), Space O(1).
896
920
  has(element): boolean;
897
921
  ```
898
922
 
899
- Defined in: [data-structures/heap/heap.ts:788](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L788)
923
+ Defined in: [data-structures/heap/heap.ts:812](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L812)
900
924
 
901
925
  Check if an equal element exists in the heap.
902
926
 
@@ -935,13 +959,47 @@ Time O(N), Space O(1)
935
959
 
936
960
  ***
937
961
 
962
+ ### includes()
963
+
964
+ ```ts
965
+ includes(element): boolean;
966
+ ```
967
+
968
+ 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)
969
+
970
+ Check whether a value exists (Array-compatible alias for `has`).
971
+
972
+ #### Parameters
973
+
974
+ ##### element
975
+
976
+ `E`
977
+
978
+ Element to search for (uses `===`).
979
+
980
+ #### Returns
981
+
982
+ `boolean`
983
+
984
+ `true` if found.
985
+
986
+ #### Remarks
987
+
988
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1).
989
+
990
+ #### Inherited from
991
+
992
+ [`Heap`](Heap.md).[`includes`](Heap.md#includes)
993
+
994
+ ***
995
+
938
996
  ### isEmpty()
939
997
 
940
998
  ```ts
941
999
  isEmpty(): boolean;
942
1000
  ```
943
1001
 
944
- Defined in: [data-structures/heap/heap.ts:688](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L688)
1002
+ Defined in: [data-structures/heap/heap.ts:706](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L706)
945
1003
 
946
1004
  Check whether the heap is empty.
947
1005
 
@@ -973,6 +1031,30 @@ Time O(1), Space O(1)
973
1031
 
974
1032
  ***
975
1033
 
1034
+ ### keys()
1035
+
1036
+ ```ts
1037
+ keys(): IterableIterator<number>;
1038
+ ```
1039
+
1040
+ 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)
1041
+
1042
+ Return an iterator of numeric indices (Array-compatible).
1043
+
1044
+ #### Returns
1045
+
1046
+ `IterableIterator`\<`number`\>
1047
+
1048
+ #### Remarks
1049
+
1050
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
1051
+
1052
+ #### Inherited from
1053
+
1054
+ [`Heap`](Heap.md).[`keys`](Heap.md#keys)
1055
+
1056
+ ***
1057
+
976
1058
  ### map()
977
1059
 
978
1060
  ```ts
@@ -982,7 +1064,7 @@ map<EM, RM>(
982
1064
  thisArg?): Heap<EM, RM>;
983
1065
  ```
984
1066
 
985
- Defined in: [data-structures/heap/heap.ts:1221](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1221)
1067
+ Defined in: [data-structures/heap/heap.ts:1263](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1263)
986
1068
 
987
1069
  Map elements into a new heap of possibly different element type.
988
1070
 
@@ -1049,7 +1131,7 @@ Time O(N log N), Space O(N)
1049
1131
  mapSame(callback, thisArg?): this;
1050
1132
  ```
1051
1133
 
1052
- Defined in: [data-structures/heap/heap.ts:1245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1245)
1134
+ Defined in: [data-structures/heap/heap.ts:1287](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1287)
1053
1135
 
1054
1136
  Map elements into a new heap of the same element type.
1055
1137
 
@@ -1089,7 +1171,7 @@ Time O(N log N), Space O(N)
1089
1171
  peek(): E | undefined;
1090
1172
  ```
1091
1173
 
1092
- Defined in: [data-structures/heap/heap.ts:635](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L635)
1174
+ Defined in: [data-structures/heap/heap.ts:650](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L650)
1093
1175
 
1094
1176
  Get the current top element without removing it.
1095
1177
 
@@ -1180,7 +1262,7 @@ Time O(1), Space O(1)
1180
1262
  poll(): E | undefined;
1181
1263
  ```
1182
1264
 
1183
- Defined in: [data-structures/heap/heap.ts:511](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L511)
1265
+ Defined in: [data-structures/heap/heap.ts:523](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L523)
1184
1266
 
1185
1267
  #### Returns
1186
1268
 
@@ -1189,6 +1271,7 @@ Defined in: [data-structures/heap/heap.ts:511](https://github.com/zrwusa/data-st
1189
1271
  #### Deprecated
1190
1272
 
1191
1273
  Use `pop` instead. Will be removed in a future major version.
1274
+
1192
1275
  *
1193
1276
 
1194
1277
  #### Example
@@ -1232,7 +1315,7 @@ Use `pop` instead. Will be removed in a future major version.
1232
1315
  pop(): E | undefined;
1233
1316
  ```
1234
1317
 
1235
- Defined in: [data-structures/heap/heap.ts:520](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L520)
1318
+ Defined in: [data-structures/heap/heap.ts:532](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L532)
1236
1319
 
1237
1320
  Remove and return the top element (min or max depending on comparator).
1238
1321
 
@@ -1258,7 +1341,7 @@ Time O(log N) amortized, Space O(1)
1258
1341
  print(): void;
1259
1342
  ```
1260
1343
 
1261
- 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)
1344
+ 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)
1262
1345
 
1263
1346
  Prints `toVisual()` to the console. Intended for quick debugging.
1264
1347
 
@@ -1316,7 +1399,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
1316
1399
  reduce(callbackfn): E;
1317
1400
  ```
1318
1401
 
1319
- 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)
1402
+ 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)
1320
1403
 
1321
1404
  ##### Parameters
1322
1405
 
@@ -1338,7 +1421,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
1338
1421
  reduce(callbackfn, initialValue): E;
1339
1422
  ```
1340
1423
 
1341
- 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)
1424
+ 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)
1342
1425
 
1343
1426
  ##### Parameters
1344
1427
 
@@ -1364,7 +1447,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
1364
1447
  reduce<U>(callbackfn, initialValue): U;
1365
1448
  ```
1366
1449
 
1367
- 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)
1450
+ 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)
1368
1451
 
1369
1452
  ##### Type Parameters
1370
1453
 
@@ -1398,7 +1481,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
1398
1481
  setEquality(equals): this;
1399
1482
  ```
1400
1483
 
1401
- Defined in: [data-structures/heap/heap.ts:903](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L903)
1484
+ Defined in: [data-structures/heap/heap.ts:930](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L930)
1402
1485
 
1403
1486
  Set the equality comparator used by has/delete operations.
1404
1487
 
@@ -1472,7 +1555,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
1472
1555
  sort(): E[];
1473
1556
  ```
1474
1557
 
1475
- Defined in: [data-structures/heap/heap.ts:1039](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1039)
1558
+ Defined in: [data-structures/heap/heap.ts:1072](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1072)
1476
1559
 
1477
1560
  Return all elements in ascending order by repeatedly polling.
1478
1561
 
@@ -1509,7 +1592,7 @@ Time O(N log N), Space O(N)
1509
1592
  toArray(): E[];
1510
1593
  ```
1511
1594
 
1512
- 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)
1595
+ 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)
1513
1596
 
1514
1597
  Materializes the elements into a new array.
1515
1598
 
@@ -1535,7 +1618,7 @@ Time O(n), Space O(n).
1535
1618
  toVisual(): E[];
1536
1619
  ```
1537
1620
 
1538
- 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)
1621
+ 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)
1539
1622
 
1540
1623
  Returns a representation of the structure suitable for quick visualization.
1541
1624
  Defaults to an array of elements; subclasses may override to provide richer visuals.
@@ -1591,7 +1674,7 @@ static from<T, R, S>(
1591
1674
  options?): S;
1592
1675
  ```
1593
1676
 
1594
- Defined in: [data-structures/heap/heap.ts:263](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L263)
1677
+ Defined in: [data-structures/heap/heap.ts:266](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L266)
1595
1678
 
1596
1679
  Create a heap of the same class from an iterable.
1597
1680
 
@@ -1649,7 +1732,7 @@ Time O(N), Space O(N)
1649
1732
  static heapify<EE, RR>(elements, options): Heap<EE, RR>;
1650
1733
  ```
1651
1734
 
1652
- Defined in: [data-structures/heap/heap.ts:281](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L281)
1735
+ Defined in: [data-structures/heap/heap.ts:284](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L284)
1653
1736
 
1654
1737
  Build a Heap from an iterable in linear time given a comparator.
1655
1738
 
@@ -1732,7 +1815,7 @@ Time O(1), Space O(1).
1732
1815
  protected _createInstance(options?): this;
1733
1816
  ```
1734
1817
 
1735
- Defined in: [data-structures/heap/heap.ts:1318](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1318)
1818
+ Defined in: [data-structures/heap/heap.ts:1360](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1360)
1736
1819
 
1737
1820
  (Protected) Create an empty instance of the same concrete class.
1738
1821
 
@@ -1766,7 +1849,7 @@ Time O(1), Space O(1)
1766
1849
  protected _createLike<EM, RM>(elements?, options?): Heap<EM, RM>;
1767
1850
  ```
1768
1851
 
1769
- Defined in: [data-structures/heap/heap.ts:1336](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1336)
1852
+ Defined in: [data-structures/heap/heap.ts:1378](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1378)
1770
1853
 
1771
1854
  (Protected) Create a like-kind instance seeded by elements.
1772
1855
 
@@ -1816,7 +1899,7 @@ Time O(N log N), Space O(N)
1816
1899
  protected _getIterator(): IterableIterator<E>;
1817
1900
  ```
1818
1901
 
1819
- Defined in: [data-structures/heap/heap.ts:1276](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1276)
1902
+ Defined in: [data-structures/heap/heap.ts:1318](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1318)
1820
1903
 
1821
1904
  Internal iterator factory used by the default iterator.
1822
1905
 
@@ -1842,7 +1925,7 @@ Implementations should yield in O(1) per element with O(1) extra space when poss
1842
1925
  protected _spawnLike<EM, RM>(options?): Heap<EM, RM>;
1843
1926
  ```
1844
1927
 
1845
- Defined in: [data-structures/heap/heap.ts:1356](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1356)
1928
+ Defined in: [data-structures/heap/heap.ts:1398](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/heap/heap.ts#L1398)
1846
1929
 
1847
1930
  (Protected) Spawn an empty like-kind heap instance.
1848
1931