data-structure-typed 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/.github/workflows/ci.yml +7 -2
  2. package/.github/workflows/release-package.yml +9 -2
  3. package/CHANGELOG.md +9 -1
  4. package/dist/cjs/binary-tree.cjs +2927 -23688
  5. package/dist/cjs/graph.cjs +845 -2634
  6. package/dist/cjs/hash.cjs +185 -616
  7. package/dist/cjs/heap.cjs +266 -818
  8. package/dist/cjs/index.cjs +5116 -31358
  9. package/dist/cjs/linked-list.cjs +644 -2615
  10. package/dist/cjs/matrix.cjs +220 -535
  11. package/dist/cjs/priority-queue.cjs +266 -818
  12. package/dist/cjs/queue.cjs +637 -2343
  13. package/dist/cjs/stack.cjs +124 -530
  14. package/dist/cjs/trie.cjs +145 -592
  15. package/dist/cjs-legacy/binary-tree.cjs +4352 -25113
  16. package/dist/cjs-legacy/graph.cjs +847 -2636
  17. package/dist/cjs-legacy/hash.cjs +181 -612
  18. package/dist/cjs-legacy/heap.cjs +266 -818
  19. package/dist/cjs-legacy/index.cjs +6657 -32899
  20. package/dist/cjs-legacy/linked-list.cjs +640 -2611
  21. package/dist/cjs-legacy/matrix.cjs +220 -535
  22. package/dist/cjs-legacy/priority-queue.cjs +266 -818
  23. package/dist/cjs-legacy/queue.cjs +634 -2340
  24. package/dist/cjs-legacy/stack.cjs +124 -530
  25. package/dist/cjs-legacy/trie.cjs +145 -592
  26. package/dist/esm/binary-tree.mjs +2927 -23688
  27. package/dist/esm/graph.mjs +845 -2634
  28. package/dist/esm/hash.mjs +185 -616
  29. package/dist/esm/heap.mjs +266 -818
  30. package/dist/esm/index.mjs +5116 -31358
  31. package/dist/esm/linked-list.mjs +644 -2615
  32. package/dist/esm/matrix.mjs +220 -535
  33. package/dist/esm/priority-queue.mjs +266 -818
  34. package/dist/esm/queue.mjs +637 -2343
  35. package/dist/esm/stack.mjs +124 -530
  36. package/dist/esm/trie.mjs +145 -592
  37. package/dist/esm-legacy/binary-tree.mjs +4352 -25113
  38. package/dist/esm-legacy/graph.mjs +847 -2636
  39. package/dist/esm-legacy/hash.mjs +181 -612
  40. package/dist/esm-legacy/heap.mjs +266 -818
  41. package/dist/esm-legacy/index.mjs +6657 -32899
  42. package/dist/esm-legacy/linked-list.mjs +640 -2611
  43. package/dist/esm-legacy/matrix.mjs +220 -535
  44. package/dist/esm-legacy/priority-queue.mjs +266 -818
  45. package/dist/esm-legacy/queue.mjs +634 -2340
  46. package/dist/esm-legacy/stack.mjs +124 -530
  47. package/dist/esm-legacy/trie.mjs +145 -592
  48. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +29 -500
  49. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +38 -563
  50. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +230 -1212
  51. package/dist/types/data-structures/binary-tree/bst.d.ts +124 -1063
  52. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +99 -854
  53. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +62 -314
  54. package/dist/types/data-structures/binary-tree/tree-map.d.ts +366 -5057
  55. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +277 -4885
  56. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +253 -3929
  57. package/dist/types/data-structures/binary-tree/tree-set.d.ts +261 -4782
  58. package/dist/types/data-structures/graph/abstract-graph.d.ts +44 -44
  59. package/dist/types/data-structures/graph/directed-graph.d.ts +130 -527
  60. package/dist/types/data-structures/graph/undirected-graph.d.ts +125 -482
  61. package/dist/types/data-structures/hash/hash-map.d.ts +132 -562
  62. package/dist/types/data-structures/heap/heap.d.ts +194 -746
  63. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +120 -809
  64. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -733
  65. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +193 -863
  66. package/dist/types/data-structures/matrix/matrix.d.ts +159 -474
  67. package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -6
  68. package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +6 -11
  69. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
  70. package/dist/types/data-structures/queue/deque.d.ts +196 -804
  71. package/dist/types/data-structures/queue/queue.d.ts +99 -585
  72. package/dist/types/data-structures/stack/stack.d.ts +75 -481
  73. package/dist/types/data-structures/trie/trie.d.ts +98 -584
  74. package/dist/umd/data-structure-typed.js +6580 -32822
  75. package/dist/umd/data-structure-typed.min.js +3 -3
  76. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +162 -215
  77. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +9 -9
  78. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +47 -47
  79. package/docs-site-docusaurus/docs/api/classes/BST.md +155 -208
  80. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +7 -7
  81. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -29
  82. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +104 -158
  83. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  84. package/docs-site-docusaurus/docs/api/classes/Deque.md +253 -101
  85. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +60 -80
  86. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +244 -114
  87. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +6 -6
  88. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  89. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  90. package/docs-site-docusaurus/docs/api/classes/HashMap.md +52 -48
  91. package/docs-site-docusaurus/docs/api/classes/Heap.md +119 -64
  92. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +84 -14
  93. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +138 -34
  94. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +149 -41
  95. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
  96. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +172 -92
  97. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +60 -80
  98. package/docs-site-docusaurus/docs/api/classes/Matrix.md +57 -52
  99. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -62
  100. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +120 -70
  101. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -62
  102. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +125 -75
  103. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +119 -64
  104. package/docs-site-docusaurus/docs/api/classes/Queue.md +158 -74
  105. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +171 -225
  106. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -22
  107. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +172 -94
  108. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +4 -4
  109. package/docs-site-docusaurus/docs/api/classes/SkipList.md +98 -75
  110. package/docs-site-docusaurus/docs/api/classes/Stack.md +112 -50
  111. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +104 -129
  112. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +90 -121
  113. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +298 -107
  114. package/docs-site-docusaurus/docs/api/classes/Trie.md +116 -58
  115. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  116. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +59 -77
  117. package/package.json +45 -46
  118. package/src/common/error.ts +15 -32
  119. package/src/common/index.ts +0 -3
  120. package/src/data-structures/base/iterable-element-base.ts +0 -3
  121. package/src/data-structures/base/linear-base.ts +2 -36
  122. package/src/data-structures/binary-tree/avl-tree.ts +31 -529
  123. package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
  124. package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
  125. package/src/data-structures/binary-tree/bst.ts +158 -1082
  126. package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
  127. package/src/data-structures/binary-tree/segment-tree.ts +73 -351
  128. package/src/data-structures/binary-tree/tree-map.ts +462 -5124
  129. package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
  130. package/src/data-structures/binary-tree/tree-multi-set.ts +299 -3983
  131. package/src/data-structures/binary-tree/tree-set.ts +338 -4836
  132. package/src/data-structures/graph/abstract-graph.ts +98 -167
  133. package/src/data-structures/graph/directed-graph.ts +137 -562
  134. package/src/data-structures/graph/map-graph.ts +0 -3
  135. package/src/data-structures/graph/undirected-graph.ts +132 -511
  136. package/src/data-structures/hash/hash-map.ts +154 -582
  137. package/src/data-structures/heap/heap.ts +200 -795
  138. package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
  139. package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
  140. package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
  141. package/src/data-structures/matrix/matrix.ts +179 -518
  142. package/src/data-structures/matrix/navigator.ts +0 -1
  143. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
  144. package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
  145. package/src/data-structures/priority-queue/priority-queue.ts +1 -2
  146. package/src/data-structures/queue/deque.ts +214 -882
  147. package/src/data-structures/queue/queue.ts +102 -625
  148. package/src/data-structures/stack/stack.ts +76 -505
  149. package/src/data-structures/trie/trie.ts +98 -628
  150. package/src/types/common.ts +0 -10
  151. package/src/types/data-structures/binary-tree/bst.ts +0 -7
  152. package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
  153. package/src/types/data-structures/graph/abstract-graph.ts +0 -2
  154. package/src/types/data-structures/hash/hash-map.ts +0 -3
  155. package/src/types/data-structures/hash/index.ts +0 -1
  156. package/src/types/data-structures/matrix/navigator.ts +0 -2
  157. package/src/types/utils/utils.ts +0 -7
  158. package/src/types/utils/validate-type.ts +0 -7
  159. package/src/utils/number.ts +0 -2
  160. package/src/utils/utils.ts +0 -5
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: LinkedListQueue\<E, R\>
8
8
 
9
- Defined in: [data-structures/queue/queue.ts:1110](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1110)
9
+ Defined in: [data-structures/queue/queue.ts:624](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L624)
10
10
 
11
11
  Queue implemented over a singly linked list; preserves head/tail operations with linear scans for queries.
12
12
 
@@ -42,7 +42,7 @@ examples will be generated by unit test
42
42
  new LinkedListQueue<E, R>(elements?, options?): LinkedListQueue<E, R>;
43
43
  ```
44
44
 
45
- Defined in: [data-structures/linked-list/singly-linked-list.ts:205](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L205)
45
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:198](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L198)
46
46
 
47
47
  Create a SinglyLinkedList and optionally bulk-insert elements.
48
48
 
@@ -86,7 +86,7 @@ Time O(N), Space O(N)
86
86
  get first(): E | undefined;
87
87
  ```
88
88
 
89
- Defined in: [data-structures/linked-list/singly-linked-list.ts:255](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L255)
89
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:244](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L244)
90
90
 
91
91
  Get the first element value.
92
92
 
@@ -114,7 +114,7 @@ First element or undefined.
114
114
  get head(): SinglyLinkedListNode<E> | undefined;
115
115
  ```
116
116
 
117
- Defined in: [data-structures/linked-list/singly-linked-list.ts:221](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L221)
117
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:213](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L213)
118
118
 
119
119
  Get the head node.
120
120
 
@@ -142,7 +142,7 @@ Head node or undefined.
142
142
  get last(): E | undefined;
143
143
  ```
144
144
 
145
- Defined in: [data-structures/linked-list/singly-linked-list.ts:265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L265)
145
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:253](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L253)
146
146
 
147
147
  Get the last element value.
148
148
 
@@ -170,7 +170,7 @@ Last element or undefined.
170
170
  get length(): number;
171
171
  ```
172
172
 
173
- Defined in: [data-structures/linked-list/singly-linked-list.ts:245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L245)
173
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:235](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L235)
174
174
 
175
175
  Get the number of elements.
176
176
 
@@ -226,7 +226,7 @@ Maximum allowed length.
226
226
  get tail(): SinglyLinkedListNode<E> | undefined;
227
227
  ```
228
228
 
229
- Defined in: [data-structures/linked-list/singly-linked-list.ts:233](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L233)
229
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:224](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L224)
230
230
 
231
231
  Get the tail node.
232
232
 
@@ -314,7 +314,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
314
314
  addAfter(existingElementOrNode, newElementOrNode): boolean;
315
315
  ```
316
316
 
317
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1189](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1189)
317
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:702](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L702)
318
318
 
319
319
  Insert a new element/node after an existing one.
320
320
 
@@ -354,7 +354,7 @@ Time O(N), Space O(1)
354
354
  addAt(index, newElementOrNode): boolean;
355
355
  ```
356
356
 
357
- Defined in: [data-structures/linked-list/singly-linked-list.ts:934](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L934)
357
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:568](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L568)
358
358
 
359
359
  Insert a new element/node at an index, shifting following nodes.
360
360
 
@@ -378,8 +378,6 @@ Element or node to insert.
378
378
 
379
379
  True if inserted.
380
380
 
381
- *
382
-
383
381
  #### Remarks
384
382
 
385
383
  Time O(N), Space O(1)
@@ -405,7 +403,7 @@ Time O(N), Space O(1)
405
403
  addBefore(existingElementOrNode, newElementOrNode): boolean;
406
404
  ```
407
405
 
408
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1159](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1159)
406
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:674](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L674)
409
407
 
410
408
  Insert a new element/node before an existing one.
411
409
 
@@ -445,7 +443,7 @@ Time O(N), Space O(1)
445
443
  at(index): E | undefined;
446
444
  ```
447
445
 
448
- Defined in: [data-structures/linked-list/singly-linked-list.ts:686](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L686)
446
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:470](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L470)
449
447
 
450
448
  Get the element at a given index.
451
449
 
@@ -463,8 +461,6 @@ Zero-based index.
463
461
 
464
462
  Element or undefined.
465
463
 
466
- *
467
-
468
464
  #### Remarks
469
465
 
470
466
  Time O(N), Space O(1)
@@ -491,7 +487,7 @@ Time O(N), Space O(1)
491
487
  clear(): void;
492
488
  ```
493
489
 
494
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1059](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1059)
490
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:616](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L616)
495
491
 
496
492
  Remove all nodes and reset length.
497
493
 
@@ -501,8 +497,6 @@ Remove all nodes and reset length.
501
497
 
502
498
  void
503
499
 
504
- *
505
-
506
500
  #### Remarks
507
501
 
508
502
  Time O(N), Space O(1)
@@ -528,7 +522,7 @@ Time O(N), Space O(1)
528
522
  clone(): this;
529
523
  ```
530
524
 
531
- Defined in: [data-structures/queue/queue.ts:1117](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L1117)
525
+ Defined in: [data-structures/queue/queue.ts:630](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/queue/queue.ts#L630)
532
526
 
533
527
  Deep clone this linked-list-based queue.
534
528
 
@@ -554,7 +548,7 @@ Time O(N), Space O(N)
554
548
  concat(...items): this;
555
549
  ```
556
550
 
557
- Defined in: [data-structures/base/linear-base.ts:473](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L473)
551
+ Defined in: [data-structures/base/linear-base.ts:462](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L462)
558
552
 
559
553
  Concatenate lists/elements preserving order.
560
554
 
@@ -590,7 +584,7 @@ Time O(sum(length)), Space O(sum(length))
590
584
  countOccurrences(elementOrNode): number;
591
585
  ```
592
586
 
593
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1265)
587
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:768](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L768)
594
588
 
595
589
  Count how many nodes match a value/node/predicate.
596
590
 
@@ -626,7 +620,7 @@ Time O(N), Space O(1)
626
620
  delete(elementOrNode?): boolean;
627
621
  ```
628
622
 
629
- Defined in: [data-structures/linked-list/singly-linked-list.ts:868](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L868)
623
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:540](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L540)
630
624
 
631
625
  Delete the first match by value/node.
632
626
 
@@ -644,8 +638,6 @@ Element or node to remove; if omitted/undefined, nothing happens.
644
638
 
645
639
  True if removed.
646
640
 
647
- *
648
-
649
641
  #### Remarks
650
642
 
651
643
  Time O(N), Space O(1)
@@ -671,7 +663,7 @@ Time O(N), Space O(1)
671
663
  deleteAt(index): E | undefined;
672
664
  ```
673
665
 
674
- Defined in: [data-structures/linked-list/singly-linked-list.ts:808](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L808)
666
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:517](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L517)
675
667
 
676
668
  Delete the element at an index.
677
669
 
@@ -689,8 +681,6 @@ Zero-based index.
689
681
 
690
682
  Removed element or undefined.
691
683
 
692
- *
693
-
694
684
  #### Remarks
695
685
 
696
686
  Time O(N), Space O(1)
@@ -716,7 +706,7 @@ Time O(N), Space O(1)
716
706
  deleteWhere(predicate): boolean;
717
707
  ```
718
708
 
719
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1295](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1295)
709
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:796](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L796)
720
710
 
721
711
  Delete the first node whose value matches a predicate.
722
712
 
@@ -744,6 +734,30 @@ Time O(N), Space O(1)
744
734
 
745
735
  ***
746
736
 
737
+ ### entries()
738
+
739
+ ```ts
740
+ entries(): IterableIterator<[number, E]>;
741
+ ```
742
+
743
+ 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)
744
+
745
+ Return an iterator of `[index, value]` pairs (Array-compatible).
746
+
747
+ #### Returns
748
+
749
+ `IterableIterator`\<\[`number`, `E`\]\>
750
+
751
+ #### Remarks
752
+
753
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
754
+
755
+ #### Inherited from
756
+
757
+ [`SinglyLinkedList`](SinglyLinkedList.md).[`entries`](SinglyLinkedList.md#entries)
758
+
759
+ ***
760
+
747
761
  ### every()
748
762
 
749
763
  ```ts
@@ -793,7 +807,7 @@ fill(
793
807
  end?): this;
794
808
  ```
795
809
 
796
- Defined in: [data-structures/base/linear-base.ts:292](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L292)
810
+ 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)
797
811
 
798
812
  Fill a range with a value.
799
813
 
@@ -839,7 +853,7 @@ Time O(n), Space O(1)
839
853
  filter(callback, thisArg?): this;
840
854
  ```
841
855
 
842
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1435](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1435)
856
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:858](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L858)
843
857
 
844
858
  Filter values into a new list of the same class.
845
859
 
@@ -863,8 +877,6 @@ Value for `this` inside the callback.
863
877
 
864
878
  A new list with kept values.
865
879
 
866
- *
867
-
868
880
  #### Remarks
869
881
 
870
882
  Time O(N), Space O(N)
@@ -990,7 +1002,7 @@ Time O(n) in the worst case; may exit early on the first match. Space O(1).
990
1002
  findIndex(predicate, thisArg?): number;
991
1003
  ```
992
1004
 
993
- Defined in: [data-structures/base/linear-base.ts:151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L151)
1005
+ 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)
994
1006
 
995
1007
  Find the first index matching a predicate.
996
1008
 
@@ -1070,7 +1082,7 @@ Time O(n), Space O(1).
1070
1082
  getNode(elementNodeOrPredicate?): SinglyLinkedListNode<E> | undefined;
1071
1083
  ```
1072
1084
 
1073
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1137](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1137)
1085
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:653](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L653)
1074
1086
 
1075
1087
  Find a node by value, reference, or predicate.
1076
1088
 
@@ -1106,7 +1118,7 @@ Time O(N), Space O(1)
1106
1118
  getNodeAt(index): SinglyLinkedListNode<E> | undefined;
1107
1119
  ```
1108
1120
 
1109
- Defined in: [data-structures/linked-list/singly-linked-list.ts:753](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L753)
1121
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:499](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L499)
1110
1122
 
1111
1123
  Get the node reference at a given index.
1112
1124
 
@@ -1124,8 +1136,6 @@ Zero-based index.
1124
1136
 
1125
1137
  Node or undefined.
1126
1138
 
1127
- *
1128
-
1129
1139
  #### Remarks
1130
1140
 
1131
1141
  Time O(N), Space O(1)
@@ -1150,7 +1160,7 @@ Time O(N), Space O(1)
1150
1160
  has(element): boolean;
1151
1161
  ```
1152
1162
 
1153
- Defined in: [data-structures/base/iterable-element-base.ts:189](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-element-base.ts#L189)
1163
+ 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)
1154
1164
 
1155
1165
  Checks whether a strictly-equal element exists in the structure.
1156
1166
 
@@ -1178,13 +1188,47 @@ Time O(n) in the worst case. Space O(1).
1178
1188
 
1179
1189
  ***
1180
1190
 
1191
+ ### includes()
1192
+
1193
+ ```ts
1194
+ includes(element): boolean;
1195
+ ```
1196
+
1197
+ 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)
1198
+
1199
+ Check whether a value exists (Array-compatible alias for `has`).
1200
+
1201
+ #### Parameters
1202
+
1203
+ ##### element
1204
+
1205
+ `E`
1206
+
1207
+ Element to search for (uses `===`).
1208
+
1209
+ #### Returns
1210
+
1211
+ `boolean`
1212
+
1213
+ `true` if found.
1214
+
1215
+ #### Remarks
1216
+
1217
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1).
1218
+
1219
+ #### Inherited from
1220
+
1221
+ [`SinglyLinkedList`](SinglyLinkedList.md).[`includes`](SinglyLinkedList.md#includes)
1222
+
1223
+ ***
1224
+
1181
1225
  ### indexOf()
1182
1226
 
1183
1227
  ```ts
1184
1228
  indexOf(searchElement, fromIndex?): number;
1185
1229
  ```
1186
1230
 
1187
- Defined in: [data-structures/base/linear-base.ts:422](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L422)
1231
+ Defined in: [data-structures/base/linear-base.ts:417](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L417)
1188
1232
 
1189
1233
  Linked-list optimized `indexOf` (forwards scan).
1190
1234
 
@@ -1224,7 +1268,7 @@ Time O(n), Space O(1)
1224
1268
  isEmpty(): boolean;
1225
1269
  ```
1226
1270
 
1227
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1007](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1007)
1271
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:602](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L602)
1228
1272
 
1229
1273
  Check whether the list is empty.
1230
1274
 
@@ -1234,8 +1278,6 @@ Check whether the list is empty.
1234
1278
 
1235
1279
  True if length is 0.
1236
1280
 
1237
- *
1238
-
1239
1281
  #### Remarks
1240
1282
 
1241
1283
  Time O(1), Space O(1)
@@ -1259,7 +1301,7 @@ Time O(1), Space O(1)
1259
1301
  isNode(elementNodeOrPredicate): elementNodeOrPredicate is SinglyLinkedListNode<E>;
1260
1302
  ```
1261
1303
 
1262
- Defined in: [data-structures/linked-list/singly-linked-list.ts:700](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L700)
1304
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:483](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L483)
1263
1305
 
1264
1306
  Type guard: check whether the input is a SinglyLinkedListNode.
1265
1307
 
@@ -1295,7 +1337,7 @@ Time O(1), Space O(1)
1295
1337
  join(separator?): string;
1296
1338
  ```
1297
1339
 
1298
- Defined in: [data-structures/base/linear-base.ts:228](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L228)
1340
+ 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)
1299
1341
 
1300
1342
  Join all elements into a string.
1301
1343
 
@@ -1323,13 +1365,37 @@ Time O(n), Space O(n)
1323
1365
 
1324
1366
  ***
1325
1367
 
1368
+ ### keys()
1369
+
1370
+ ```ts
1371
+ keys(): IterableIterator<number>;
1372
+ ```
1373
+
1374
+ 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)
1375
+
1376
+ Return an iterator of numeric indices (Array-compatible).
1377
+
1378
+ #### Returns
1379
+
1380
+ `IterableIterator`\<`number`\>
1381
+
1382
+ #### Remarks
1383
+
1384
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
1385
+
1386
+ #### Inherited from
1387
+
1388
+ [`SinglyLinkedList`](SinglyLinkedList.md).[`keys`](SinglyLinkedList.md#keys)
1389
+
1390
+ ***
1391
+
1326
1392
  ### lastIndexOf()
1327
1393
 
1328
1394
  ```ts
1329
1395
  lastIndexOf(searchElement, fromIndex?): number;
1330
1396
  ```
1331
1397
 
1332
- Defined in: [data-structures/base/linear-base.ts:448](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L448)
1398
+ Defined in: [data-structures/base/linear-base.ts:440](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L440)
1333
1399
 
1334
1400
  Linked-list optimized `lastIndexOf` (reverse scan).
1335
1401
 
@@ -1372,7 +1438,7 @@ map<EM, RM>(
1372
1438
  thisArg?): SinglyLinkedList<EM, RM>;
1373
1439
  ```
1374
1440
 
1375
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1515](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1515)
1441
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:897](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L897)
1376
1442
 
1377
1443
  Map values into a new list (possibly different element type).
1378
1444
 
@@ -1412,8 +1478,6 @@ Value for `this` inside the callback.
1412
1478
 
1413
1479
  A new SinglyLinkedList with mapped values.
1414
1480
 
1415
- *
1416
-
1417
1481
  #### Remarks
1418
1482
 
1419
1483
  Time O(N), Space O(N)
@@ -1439,7 +1503,7 @@ Time O(N), Space O(N)
1439
1503
  mapSame(callback, thisArg?): this;
1440
1504
  ```
1441
1505
 
1442
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1450](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1450)
1506
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:872](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L872)
1443
1507
 
1444
1508
  Map values into a new list of the same class.
1445
1509
 
@@ -1479,7 +1543,7 @@ Time O(N), Space O(N)
1479
1543
  pop(): E | undefined;
1480
1544
  ```
1481
1545
 
1482
- Defined in: [data-structures/linked-list/singly-linked-list.ts:428](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L428)
1546
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:335](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L335)
1483
1547
 
1484
1548
  Remove and return the tail element.
1485
1549
 
@@ -1489,8 +1553,6 @@ Remove and return the tail element.
1489
1553
 
1490
1554
  Removed element or undefined.
1491
1555
 
1492
- *
1493
-
1494
1556
  #### Remarks
1495
1557
 
1496
1558
  Time O(N), Space O(1)
@@ -1526,7 +1588,7 @@ Time O(N), Space O(1)
1526
1588
  print(): void;
1527
1589
  ```
1528
1590
 
1529
- 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)
1591
+ 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)
1530
1592
 
1531
1593
  Prints `toVisual()` to the console. Intended for quick debugging.
1532
1594
 
@@ -1552,7 +1614,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
1552
1614
  push(elementOrNode): boolean;
1553
1615
  ```
1554
1616
 
1555
- Defined in: [data-structures/linked-list/singly-linked-list.ts:355](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L355)
1617
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:302](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L302)
1556
1618
 
1557
1619
  Append an element/node to the tail.
1558
1620
 
@@ -1570,8 +1632,6 @@ Element or node to append.
1570
1632
 
1571
1633
  True when appended.
1572
1634
 
1573
- *
1574
-
1575
1635
  #### Remarks
1576
1636
 
1577
1637
  Time O(1), Space O(1)
@@ -1607,7 +1667,7 @@ Time O(1), Space O(1)
1607
1667
  pushMany(elements): boolean[];
1608
1668
  ```
1609
1669
 
1610
- Defined in: [data-structures/linked-list/singly-linked-list.ts:590](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L590)
1670
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:416](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L416)
1611
1671
 
1612
1672
  Append a sequence of elements/nodes.
1613
1673
 
@@ -1675,7 +1735,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
1675
1735
  reduce(callbackfn): E;
1676
1736
  ```
1677
1737
 
1678
- 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)
1738
+ 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)
1679
1739
 
1680
1740
  ##### Parameters
1681
1741
 
@@ -1697,7 +1757,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
1697
1757
  reduce(callbackfn, initialValue): E;
1698
1758
  ```
1699
1759
 
1700
- 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)
1760
+ 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)
1701
1761
 
1702
1762
  ##### Parameters
1703
1763
 
@@ -1723,7 +1783,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
1723
1783
  reduce<U>(callbackfn, initialValue): U;
1724
1784
  ```
1725
1785
 
1726
- 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)
1786
+ 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)
1727
1787
 
1728
1788
  ##### Type Parameters
1729
1789
 
@@ -1757,7 +1817,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
1757
1817
  reduceRight<U>(callbackfn, initialValue): U;
1758
1818
  ```
1759
1819
 
1760
- Defined in: [data-structures/base/linear-base.ts:574](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L574)
1820
+ Defined in: [data-structures/base/linear-base.ts:552](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L552)
1761
1821
 
1762
1822
  Right-to-left reduction using reverse iterator.
1763
1823
 
@@ -1803,7 +1863,7 @@ Time O(n), Space O(1)
1803
1863
  reverse(): this;
1804
1864
  ```
1805
1865
 
1806
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1115](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1115)
1866
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:632](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L632)
1807
1867
 
1808
1868
  Reverse the list in place.
1809
1869
 
@@ -1813,8 +1873,6 @@ Reverse the list in place.
1813
1873
 
1814
1874
  This list.
1815
1875
 
1816
- *
1817
-
1818
1876
  #### Remarks
1819
1877
 
1820
1878
  Time O(N), Space O(1)
@@ -1840,7 +1898,7 @@ Time O(N), Space O(1)
1840
1898
  search(elementNodeOrPredicate): E | undefined;
1841
1899
  ```
1842
1900
 
1843
- Defined in: [data-structures/linked-list/singly-linked-list.ts:622](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L622)
1901
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:446](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L446)
1844
1902
 
1845
1903
  Find the first value matching a predicate (by node).
1846
1904
 
@@ -1876,7 +1934,7 @@ Time O(N), Space O(1)
1876
1934
  setAt(index, value): boolean;
1877
1935
  ```
1878
1936
 
1879
- Defined in: [data-structures/linked-list/singly-linked-list.ts:954](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L954)
1937
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:587](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L587)
1880
1938
 
1881
1939
  Set the element value at an index.
1882
1940
 
@@ -1916,7 +1974,7 @@ Time O(N), Space O(1)
1916
1974
  setEquality(equals): this;
1917
1975
  ```
1918
1976
 
1919
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1283](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1283)
1977
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:785](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L785)
1920
1978
 
1921
1979
  Set the equality comparator used to compare values.
1922
1980
 
@@ -1950,7 +2008,7 @@ Time O(1), Space O(1)
1950
2008
  shift(): E | undefined;
1951
2009
  ```
1952
2010
 
1953
- Defined in: [data-structures/linked-list/singly-linked-list.ts:496](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L496)
2011
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:363](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L363)
1954
2012
 
1955
2013
  Remove and return the head element.
1956
2014
 
@@ -1960,8 +2018,6 @@ Remove and return the head element.
1960
2018
 
1961
2019
  Removed element or undefined.
1962
2020
 
1963
- *
1964
-
1965
2021
  #### Remarks
1966
2022
 
1967
2023
  Time O(1), Space O(1)
@@ -1987,7 +2043,7 @@ Time O(1), Space O(1)
1987
2043
  slice(start?, end?): this;
1988
2044
  ```
1989
2045
 
1990
- Defined in: [data-structures/base/linear-base.ts:494](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L494)
2046
+ Defined in: [data-structures/base/linear-base.ts:481](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L481)
1991
2047
 
1992
2048
  Slice via forward iteration (no random access required).
1993
2049
 
@@ -2067,7 +2123,7 @@ Time O(n) in the worst case; may exit early on first success. Space O(1).
2067
2123
  sort(compareFn?): this;
2068
2124
  ```
2069
2125
 
2070
- Defined in: [data-structures/base/linear-base.ts:185](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L185)
2126
+ 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)
2071
2127
 
2072
2128
  In-place stable order via array sort semantics.
2073
2129
 
@@ -2104,7 +2160,7 @@ splice(
2104
2160
  items?): this;
2105
2161
  ```
2106
2162
 
2107
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1209](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1209)
2163
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:721](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L721)
2108
2164
 
2109
2165
  Remove and/or insert elements at a position (array-like behavior).
2110
2166
 
@@ -2150,7 +2206,7 @@ Time O(N + M), Space O(M)
2150
2206
  toArray(): E[];
2151
2207
  ```
2152
2208
 
2153
- 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)
2209
+ 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)
2154
2210
 
2155
2211
  Materializes the elements into a new array.
2156
2212
 
@@ -2170,13 +2226,39 @@ Time O(n), Space O(n).
2170
2226
 
2171
2227
  ***
2172
2228
 
2229
+ ### toReversed()
2230
+
2231
+ ```ts
2232
+ toReversed(): this;
2233
+ ```
2234
+
2235
+ 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)
2236
+
2237
+ Return a new instance of the same type with elements in reverse order (non-mutating).
2238
+
2239
+ #### Returns
2240
+
2241
+ `this`
2242
+
2243
+ A new reversed instance.
2244
+
2245
+ #### Remarks
2246
+
2247
+ Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
2248
+
2249
+ #### Inherited from
2250
+
2251
+ [`SinglyLinkedList`](SinglyLinkedList.md).[`toReversed`](SinglyLinkedList.md#toreversed)
2252
+
2253
+ ***
2254
+
2173
2255
  ### toReversedArray()
2174
2256
 
2175
2257
  ```ts
2176
2258
  toReversedArray(): E[];
2177
2259
  ```
2178
2260
 
2179
- Defined in: [data-structures/base/linear-base.ts:237](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L237)
2261
+ 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)
2180
2262
 
2181
2263
  Snapshot elements into a reversed array.
2182
2264
 
@@ -2202,7 +2284,7 @@ Time O(n), Space O(n)
2202
2284
  toVisual(): E[];
2203
2285
  ```
2204
2286
 
2205
- 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)
2287
+ 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)
2206
2288
 
2207
2289
  Returns a representation of the structure suitable for quick visualization.
2208
2290
  Defaults to an array of elements; subclasses may override to provide richer visuals.
@@ -2229,7 +2311,7 @@ Time O(n), Space O(n).
2229
2311
  unshift(elementOrNode): boolean;
2230
2312
  ```
2231
2313
 
2232
- Defined in: [data-structures/linked-list/singly-linked-list.ts:571](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L571)
2314
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:398](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L398)
2233
2315
 
2234
2316
  Prepend an element/node to the head.
2235
2317
 
@@ -2247,8 +2329,6 @@ Element or node to prepend.
2247
2329
 
2248
2330
  True when prepended.
2249
2331
 
2250
- *
2251
-
2252
2332
  #### Remarks
2253
2333
 
2254
2334
  Time O(1), Space O(1)
@@ -2289,7 +2369,7 @@ Time O(1), Space O(1)
2289
2369
  unshiftMany(elements): boolean[];
2290
2370
  ```
2291
2371
 
2292
- Defined in: [data-structures/linked-list/singly-linked-list.ts:606](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L606)
2372
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:431](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L431)
2293
2373
 
2294
2374
  Prepend a sequence of elements/nodes.
2295
2375
 
@@ -2354,7 +2434,7 @@ static from<E, R, S>(
2354
2434
  options?): S;
2355
2435
  ```
2356
2436
 
2357
- Defined in: [data-structures/linked-list/singly-linked-list.ts:281](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L281)
2437
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:268](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L268)
2358
2438
 
2359
2439
  Create a new list from an iterable of elements.
2360
2440
 
@@ -2447,7 +2527,7 @@ Time O(1), Space O(1).
2447
2527
  protected _createInstance(options?): this;
2448
2528
  ```
2449
2529
 
2450
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1638](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1638)
2530
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1013](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1013)
2451
2531
 
2452
2532
  (Protected) Create an empty instance of the same concrete class.
2453
2533
 
@@ -2481,7 +2561,7 @@ Time O(1), Space O(1)
2481
2561
  protected _createLike<EM, RM>(elements?, options?): SinglyLinkedList<EM, RM>;
2482
2562
  ```
2483
2563
 
2484
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1656)
2564
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1030](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1030)
2485
2565
 
2486
2566
  (Protected) Create a like-kind instance and seed it from an iterable.
2487
2567
 
@@ -2533,7 +2613,7 @@ Time O(N), Space O(N)
2533
2613
  protected _ensureNode(elementOrNode): SinglyLinkedListNode<E>;
2534
2614
  ```
2535
2615
 
2536
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1557](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1557)
2616
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:938](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L938)
2537
2617
 
2538
2618
  (Protected) Normalize input into a node instance.
2539
2619
 
@@ -2567,7 +2647,7 @@ Time O(1), Space O(1)
2567
2647
  protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
2568
2648
  ```
2569
2649
 
2570
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1569](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1569)
2650
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:949](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L949)
2571
2651
 
2572
2652
  (Protected) Normalize input into a node predicate.
2573
2653
 
@@ -2603,7 +2683,7 @@ Time O(1), Space O(1)
2603
2683
  protected _getIterator(): IterableIterator<E>;
2604
2684
  ```
2605
2685
 
2606
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1598](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1598)
2686
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:976](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L976)
2607
2687
 
2608
2688
  (Protected) Iterate values from head to tail.
2609
2689
 
@@ -2629,7 +2709,7 @@ Time O(N), Space O(1)
2629
2709
  protected _getNodeIterator(): IterableIterator<SinglyLinkedListNode<E>>;
2630
2710
  ```
2631
2711
 
2632
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1623](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1623)
2712
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:999](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L999)
2633
2713
 
2634
2714
  (Protected) Iterate nodes from head to tail.
2635
2715
 
@@ -2655,7 +2735,7 @@ Time O(N), Space O(1)
2655
2735
  protected _getPrevNode(node): SinglyLinkedListNode<E> | undefined;
2656
2736
  ```
2657
2737
 
2658
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1585](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1585)
2738
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:964](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L964)
2659
2739
 
2660
2740
  (Protected) Get the previous node of a given node.
2661
2741
 
@@ -2689,7 +2769,7 @@ Time O(N), Space O(1)
2689
2769
  protected _getReverseIterator(): IterableIterator<E>;
2690
2770
  ```
2691
2771
 
2692
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1612](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1612)
2772
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:989](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L989)
2693
2773
 
2694
2774
  (Protected) Iterate values from tail to head.
2695
2775
 
@@ -2715,7 +2795,7 @@ Time O(N), Space O(N)
2715
2795
  protected _isPredicate(elementNodeOrPredicate): elementNodeOrPredicate is (node: SinglyLinkedListNode<E>) => boolean;
2716
2796
  ```
2717
2797
 
2718
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1544](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1544)
2798
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:926](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L926)
2719
2799
 
2720
2800
  (Protected) Check if input is a node predicate function.
2721
2801
 
@@ -2751,7 +2831,7 @@ Time O(1), Space O(1)
2751
2831
  protected _spawnLike<EM, RM>(options?): SinglyLinkedList<EM, RM>;
2752
2832
  ```
2753
2833
 
2754
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1676](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1676)
2834
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1049](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1049)
2755
2835
 
2756
2836
  (Protected) Spawn an empty like-kind list instance.
2757
2837
 
@@ -2795,7 +2875,7 @@ Time O(1), Space O(1)
2795
2875
  protected createNode(value): SinglyLinkedListNode<E>;
2796
2876
  ```
2797
2877
 
2798
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1533](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1533)
2878
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:916](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L916)
2799
2879
 
2800
2880
  (Protected) Create a node from a value.
2801
2881