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
@@ -107,7 +107,7 @@ Time O(n) to iterate, Space O(1)
107
107
  ceiling(key): [K, V | undefined] | undefined;
108
108
  ```
109
109
 
110
- Defined in: [data-structures/linked-list/skip-linked-list.ts:831](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L831)
110
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:867](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L867)
111
111
 
112
112
  Least entry ≥ key, or `undefined`.
113
113
 
@@ -140,7 +140,7 @@ Least entry ≥ key, or `undefined`.
140
140
  clear(): void;
141
141
  ```
142
142
 
143
- Defined in: [data-structures/linked-list/skip-linked-list.ts:229](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L229)
143
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:235](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L235)
144
144
 
145
145
  Remove all entries
146
146
 
@@ -171,7 +171,7 @@ Remove all entries
171
171
  clone(): this;
172
172
  ```
173
173
 
174
- Defined in: [data-structures/linked-list/skip-linked-list.ts:280](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L280)
174
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:289](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L289)
175
175
 
176
176
  Create independent copy
177
177
 
@@ -203,7 +203,7 @@ Create independent copy
203
203
  delete(key): boolean;
204
204
  ```
205
205
 
206
- Defined in: [data-structures/linked-list/skip-linked-list.ts:553](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L553)
206
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:574](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L574)
207
207
 
208
208
  Delete a key. Returns `true` if the key was found and removed.
209
209
 
@@ -309,7 +309,7 @@ Time O(n), Space O(1)
309
309
  filter(callbackfn, thisArg?): this;
310
310
  ```
311
311
 
312
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1201](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1201)
312
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1255](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1255)
313
313
 
314
314
  Creates a new SkipList with entries that pass the predicate.
315
315
 
@@ -390,7 +390,7 @@ Time O(n), Space O(1)
390
390
  first(): [K, V | undefined] | undefined;
391
391
  ```
392
392
 
393
- Defined in: [data-structures/linked-list/skip-linked-list.ts:621](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L621)
393
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:645](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L645)
394
394
 
395
395
  Returns the first (smallest key) entry, or `undefined` if empty.
396
396
 
@@ -416,7 +416,7 @@ Returns the first (smallest key) entry, or `undefined` if empty.
416
416
  floor(key): [K, V | undefined] | undefined;
417
417
  ```
418
418
 
419
- Defined in: [data-structures/linked-list/skip-linked-list.ts:890](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L890)
419
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:929](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L929)
420
420
 
421
421
  Greatest entry ≤ key, or `undefined`.
422
422
 
@@ -487,7 +487,7 @@ Time O(n), Space O(1)
487
487
  get(key): V | undefined;
488
488
  ```
489
489
 
490
- Defined in: [data-structures/linked-list/skip-linked-list.ts:442](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L442)
490
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:457](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L457)
491
491
 
492
492
  Get the value for a key, or `undefined` if not found.
493
493
  Overrides base O(n) with O(log n) skip-list search.
@@ -540,7 +540,7 @@ Overrides base O(n) with O(log n) skip-list search.
540
540
  has(key): boolean;
541
541
  ```
542
542
 
543
- Defined in: [data-structures/linked-list/skip-linked-list.ts:495](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L495)
543
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:513](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L513)
544
544
 
545
545
  Check if a key exists.
546
546
  Overrides base O(n) with O(log n) skip-list search.
@@ -612,7 +612,7 @@ Time O(n), Space O(1)
612
612
  higher(key): [K, V | undefined] | undefined;
613
613
  ```
614
614
 
615
- Defined in: [data-structures/linked-list/skip-linked-list.ts:949](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L949)
615
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:991](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L991)
616
616
 
617
617
  Least entry strictly > key, or `undefined`.
618
618
 
@@ -645,7 +645,7 @@ Least entry strictly > key, or `undefined`.
645
645
  isEmpty(): boolean;
646
646
  ```
647
647
 
648
- Defined in: [data-structures/linked-list/skip-linked-list.ts:181](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L181)
648
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:184](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L184)
649
649
 
650
650
  Check if empty
651
651
 
@@ -701,7 +701,7 @@ Time O(n), Space O(1)
701
701
  last(): [K, V | undefined] | undefined;
702
702
  ```
703
703
 
704
- Defined in: [data-structures/linked-list/skip-linked-list.ts:672](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L672)
704
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:699](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L699)
705
705
 
706
706
  Returns the last (largest key) entry, or `undefined` if empty.
707
707
 
@@ -727,7 +727,7 @@ Returns the last (largest key) entry, or `undefined` if empty.
727
727
  lower(key): [K, V | undefined] | undefined;
728
728
  ```
729
729
 
730
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1005](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1005)
730
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1050](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1050)
731
731
 
732
732
  Greatest entry strictly < key, or `undefined`.
733
733
 
@@ -760,7 +760,7 @@ Greatest entry strictly < key, or `undefined`.
760
760
  map<MK, MV>(callback, options?): SkipList<MK, MV>;
761
761
  ```
762
762
 
763
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1144](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1144)
763
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1195)
764
764
 
765
765
  Creates a new SkipList with entries transformed by callback.
766
766
 
@@ -811,7 +811,7 @@ Creates a new SkipList with entries transformed by callback.
811
811
  pollFirst(): [K, V | undefined] | undefined;
812
812
  ```
813
813
 
814
- Defined in: [data-structures/linked-list/skip-linked-list.ts:726](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L726)
814
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:756](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L756)
815
815
 
816
816
  Remove and return the first (smallest key) entry.
817
817
 
@@ -838,7 +838,7 @@ Remove and return the first (smallest key) entry.
838
838
  pollLast(): [K, V | undefined] | undefined;
839
839
  ```
840
840
 
841
- Defined in: [data-structures/linked-list/skip-linked-list.ts:777](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L777)
841
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:810](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L810)
842
842
 
843
843
  Remove and return the last (largest key) entry.
844
844
 
@@ -889,7 +889,7 @@ Time O(n), Space O(n)
889
889
  rangeSearch(range, options?): [K, V | undefined][];
890
890
  ```
891
891
 
892
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1067](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1067)
892
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1115](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1115)
893
893
 
894
894
  Returns entries within the given key range.
895
895
 
@@ -972,7 +972,7 @@ Time O(n), Space O(1)
972
972
  set(key, value): this;
973
973
  ```
974
974
 
975
- Defined in: [data-structures/linked-list/skip-linked-list.ts:349](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L349)
975
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:361](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L361)
976
976
 
977
977
  Insert or update a key-value pair. Returns `this` for chaining.
978
978
  Unique keys only — if key exists, value is updated in place.
@@ -1164,7 +1164,7 @@ Creates a default comparator supporting number, string, Date, and bigint.
1164
1164
  protected _findNode(key): SkipListNode<K, V> | undefined;
1165
1165
  ```
1166
1166
 
1167
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1254](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1254)
1167
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1308](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1308)
1168
1168
 
1169
1169
  Finds the node for a given key, or undefined.
1170
1170
 
@@ -1186,7 +1186,7 @@ Finds the node for a given key, or undefined.
1186
1186
  protected _findUpdate(key): SkipListNode<K, V>[];
1187
1187
  ```
1188
1188
 
1189
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1236](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1236)
1189
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1290)
1190
1190
 
1191
1191
  Finds the update array (predecessors at each level) for a given key.
1192
1192
 
@@ -1208,7 +1208,7 @@ Finds the update array (predecessors at each level) for a given key.
1208
1208
  protected _getIterator(): IterableIterator<[K, V | undefined]>;
1209
1209
  ```
1210
1210
 
1211
- Defined in: [data-structures/linked-list/skip-linked-list.ts:1220](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1220)
1211
+ Defined in: [data-structures/linked-list/skip-linked-list.ts:1274](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/skip-linked-list.ts#L1274)
1212
1212
 
1213
1213
  Underlying iterator for the default iteration protocol.
1214
1214
 
@@ -236,7 +236,7 @@ Internal elements array.
236
236
  get size(): number;
237
237
  ```
238
238
 
239
- Defined in: [data-structures/stack/stack.ts:210](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L210)
239
+ Defined in: [data-structures/stack/stack.ts:213](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L213)
240
240
 
241
241
  Get the number of stored elements.
242
242
 
@@ -330,7 +330,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
330
330
  clear(): void;
331
331
  ```
332
332
 
333
- Defined in: [data-structures/stack/stack.ts:621](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L621)
333
+ Defined in: [data-structures/stack/stack.ts:642](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L642)
334
334
 
335
335
  Remove all elements and reset storage.
336
336
 
@@ -367,7 +367,7 @@ Time O(1), Space O(1)
367
367
  clone(): this;
368
368
  ```
369
369
 
370
- Defined in: [data-structures/stack/stack.ts:675](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L675)
370
+ Defined in: [data-structures/stack/stack.ts:699](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L699)
371
371
 
372
372
  Deep clone this stack.
373
373
 
@@ -406,7 +406,7 @@ Time O(N), Space O(N)
406
406
  delete(element): boolean;
407
407
  ```
408
408
 
409
- Defined in: [data-structures/stack/stack.ts:538](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L538)
409
+ Defined in: [data-structures/stack/stack.ts:556](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L556)
410
410
 
411
411
  Delete the first occurrence of a specific element.
412
412
 
@@ -447,7 +447,7 @@ Time O(N), Space O(1)
447
447
  deleteAt(index): E | undefined;
448
448
  ```
449
449
 
450
- Defined in: [data-structures/stack/stack.ts:550](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L550)
450
+ Defined in: [data-structures/stack/stack.ts:568](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L568)
451
451
 
452
452
  Delete the element at an index.
453
453
 
@@ -477,7 +477,7 @@ Time O(N), Space O(1)
477
477
  deleteWhere(predicate): boolean;
478
478
  ```
479
479
 
480
- Defined in: [data-structures/stack/stack.ts:563](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L563)
480
+ Defined in: [data-structures/stack/stack.ts:581](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L581)
481
481
 
482
482
  Delete the first element that satisfies a predicate.
483
483
 
@@ -501,6 +501,30 @@ Time O(N), Space O(1)
501
501
 
502
502
  ***
503
503
 
504
+ ### entries()
505
+
506
+ ```ts
507
+ entries(): IterableIterator<[number, E]>;
508
+ ```
509
+
510
+ 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)
511
+
512
+ Return an iterator of `[index, value]` pairs (Array-compatible).
513
+
514
+ #### Returns
515
+
516
+ `IterableIterator`\<\[`number`, `E`\]\>
517
+
518
+ #### Remarks
519
+
520
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
521
+
522
+ #### Inherited from
523
+
524
+ [`IterableElementBase`](IterableElementBase.md).[`entries`](IterableElementBase.md#entries)
525
+
526
+ ***
527
+
504
528
  ### every()
505
529
 
506
530
  ```ts
@@ -547,7 +571,7 @@ Time O(n) in the worst case; may exit early when the first failure is found. Spa
547
571
  filter(predicate, thisArg?): this;
548
572
  ```
549
573
 
550
- Defined in: [data-structures/stack/stack.ts:731](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L731)
574
+ Defined in: [data-structures/stack/stack.ts:758](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L758)
551
575
 
552
576
  Filter elements into a new stack of the same class.
553
577
 
@@ -756,13 +780,47 @@ Time O(n) in the worst case. Space O(1).
756
780
 
757
781
  ***
758
782
 
783
+ ### includes()
784
+
785
+ ```ts
786
+ includes(element): boolean;
787
+ ```
788
+
789
+ 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)
790
+
791
+ Check whether a value exists (Array-compatible alias for `has`).
792
+
793
+ #### Parameters
794
+
795
+ ##### element
796
+
797
+ `E`
798
+
799
+ Element to search for (uses `===`).
800
+
801
+ #### Returns
802
+
803
+ `boolean`
804
+
805
+ `true` if found.
806
+
807
+ #### Remarks
808
+
809
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1).
810
+
811
+ #### Inherited from
812
+
813
+ [`IterableElementBase`](IterableElementBase.md).[`includes`](IterableElementBase.md#includes)
814
+
815
+ ***
816
+
759
817
  ### isEmpty()
760
818
 
761
819
  ```ts
762
820
  isEmpty(): boolean;
763
821
  ```
764
822
 
765
- Defined in: [data-structures/stack/stack.ts:284](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L284)
823
+ Defined in: [data-structures/stack/stack.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L290)
766
824
 
767
825
  Check whether the stack is empty.
768
826
 
@@ -794,6 +852,30 @@ Time O(1), Space O(1)
794
852
 
795
853
  ***
796
854
 
855
+ ### keys()
856
+
857
+ ```ts
858
+ keys(): IterableIterator<number>;
859
+ ```
860
+
861
+ 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)
862
+
863
+ Return an iterator of numeric indices (Array-compatible).
864
+
865
+ #### Returns
866
+
867
+ `IterableIterator`\<`number`\>
868
+
869
+ #### Remarks
870
+
871
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
872
+
873
+ #### Inherited from
874
+
875
+ [`IterableElementBase`](IterableElementBase.md).[`keys`](IterableElementBase.md#keys)
876
+
877
+ ***
878
+
797
879
  ### map()
798
880
 
799
881
  ```ts
@@ -803,7 +885,7 @@ map<EM, RM>(
803
885
  thisArg?): Stack<EM, RM>;
804
886
  ```
805
887
 
806
- Defined in: [data-structures/stack/stack.ts:811](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L811)
888
+ Defined in: [data-structures/stack/stack.ts:841](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L841)
807
889
 
808
890
  Map values into a new stack (possibly different element type).
809
891
 
@@ -870,7 +952,7 @@ Time O(N), Space O(N)
870
952
  mapSame(callback, thisArg?): this;
871
953
  ```
872
954
 
873
- Defined in: [data-structures/stack/stack.ts:749](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L749)
955
+ Defined in: [data-structures/stack/stack.ts:776](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L776)
874
956
 
875
957
  Map values into a new stack of the same element type.
876
958
 
@@ -910,7 +992,7 @@ Time O(N), Space O(N)
910
992
  peek(): E | undefined;
911
993
  ```
912
994
 
913
- Defined in: [data-structures/stack/stack.ts:338](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L338)
995
+ Defined in: [data-structures/stack/stack.ts:347](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L347)
914
996
 
915
997
  Get the top element without removing it.
916
998
 
@@ -943,7 +1025,7 @@ Time O(1), Space O(1)
943
1025
  pop(): E | undefined;
944
1026
  ```
945
1027
 
946
- Defined in: [data-structures/stack/stack.ts:470](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L470)
1028
+ Defined in: [data-structures/stack/stack.ts:485](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L485)
947
1029
 
948
1030
  Pop and return the top element.
949
1031
 
@@ -989,7 +1071,7 @@ Time O(1), Space O(1)
989
1071
  print(): void;
990
1072
  ```
991
1073
 
992
- 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)
1074
+ 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)
993
1075
 
994
1076
  Prints `toVisual()` to the console. Intended for quick debugging.
995
1077
 
@@ -1015,7 +1097,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
1015
1097
  push(element): boolean;
1016
1098
  ```
1017
1099
 
1018
- Defined in: [data-structures/stack/stack.ts:402](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L402)
1100
+ Defined in: [data-structures/stack/stack.ts:414](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L414)
1019
1101
 
1020
1102
  Push one element onto the top.
1021
1103
 
@@ -1065,7 +1147,7 @@ Time O(1), Space O(1)
1065
1147
  pushMany(elements): boolean[];
1066
1148
  ```
1067
1149
 
1068
- Defined in: [data-structures/stack/stack.ts:481](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L481)
1150
+ Defined in: [data-structures/stack/stack.ts:496](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L496)
1069
1151
 
1070
1152
  Push many elements from an iterable.
1071
1153
 
@@ -1127,7 +1209,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
1127
1209
  reduce(callbackfn): E;
1128
1210
  ```
1129
1211
 
1130
- 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)
1212
+ 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)
1131
1213
 
1132
1214
  ##### Parameters
1133
1215
 
@@ -1149,7 +1231,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
1149
1231
  reduce(callbackfn, initialValue): E;
1150
1232
  ```
1151
1233
 
1152
- 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)
1234
+ 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)
1153
1235
 
1154
1236
  ##### Parameters
1155
1237
 
@@ -1175,7 +1257,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
1175
1257
  reduce<U>(callbackfn, initialValue): U;
1176
1258
  ```
1177
1259
 
1178
- 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)
1260
+ 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)
1179
1261
 
1180
1262
  ##### Type Parameters
1181
1263
 
@@ -1209,7 +1291,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
1209
1291
  setEquality(equals): this;
1210
1292
  ```
1211
1293
 
1212
- Defined in: [data-structures/stack/stack.ts:832](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L832)
1294
+ Defined in: [data-structures/stack/stack.ts:862](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L862)
1213
1295
 
1214
1296
  Set the equality comparator used by delete/search operations.
1215
1297
 
@@ -1279,7 +1361,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
1279
1361
  toArray(): E[];
1280
1362
  ```
1281
1363
 
1282
- 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)
1364
+ 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)
1283
1365
 
1284
1366
  Materializes the elements into a new array.
1285
1367
 
@@ -1305,7 +1387,7 @@ Time O(n), Space O(n).
1305
1387
  toVisual(): E[];
1306
1388
  ```
1307
1389
 
1308
- 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)
1390
+ 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)
1309
1391
 
1310
1392
  Returns a representation of the structure suitable for quick visualization.
1311
1393
  Defaults to an array of elements; subclasses may override to provide richer visuals.
@@ -1361,7 +1443,7 @@ static fromArray<E, R>(
1361
1443
  options?): any;
1362
1444
  ```
1363
1445
 
1364
- Defined in: [data-structures/stack/stack.ts:225](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L225)
1446
+ Defined in: [data-structures/stack/stack.ts:228](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L228)
1365
1447
 
1366
1448
  Create a stack from an array of elements.
1367
1449
 
@@ -1446,7 +1528,7 @@ Time O(1), Space O(1).
1446
1528
  protected _createInstance(options?): this;
1447
1529
  ```
1448
1530
 
1449
- Defined in: [data-structures/stack/stack.ts:856](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L856)
1531
+ Defined in: [data-structures/stack/stack.ts:886](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L886)
1450
1532
 
1451
1533
  (Protected) Create an empty instance of the same concrete class.
1452
1534
 
@@ -1476,7 +1558,7 @@ Time O(1), Space O(1)
1476
1558
  protected _createLike<T, RR>(elements?, options?): Stack<T, RR>;
1477
1559
  ```
1478
1560
 
1479
- Defined in: [data-structures/stack/stack.ts:871](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L871)
1561
+ Defined in: [data-structures/stack/stack.ts:901](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L901)
1480
1562
 
1481
1563
  (Protected) Create a like-kind stack and seed it from an iterable.
1482
1564
 
@@ -1522,7 +1604,7 @@ Time O(N), Space O(N)
1522
1604
  protected _getIterator(): IterableIterator<E>;
1523
1605
  ```
1524
1606
 
1525
- Defined in: [data-structures/stack/stack.ts:888](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L888)
1607
+ Defined in: [data-structures/stack/stack.ts:918](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L918)
1526
1608
 
1527
1609
  (Protected) Iterate elements from bottom to top.
1528
1610
 
@@ -1548,7 +1630,7 @@ Time O(N), Space O(1)
1548
1630
  protected _indexOfByEquals(target): number;
1549
1631
  ```
1550
1632
 
1551
- Defined in: [data-structures/stack/stack.ts:844](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L844)
1633
+ Defined in: [data-structures/stack/stack.ts:874](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/stack/stack.ts#L874)
1552
1634
 
1553
1635
  (Protected) Find the index of a target element using the equality function.
1554
1636