data-structure-typed 2.5.3 → 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 (158) hide show
  1. package/.github/workflows/ci.yml +7 -2
  2. package/.github/workflows/release-package.yml +9 -2
  3. package/.husky/pre-commit +3 -0
  4. package/CHANGELOG.md +1 -1
  5. package/MIGRATION.md +48 -0
  6. package/README.md +20 -2
  7. package/README_CN.md +20 -2
  8. package/SPECIFICATION.md +24 -0
  9. package/SPECIFICATION.zh-CN.md +24 -0
  10. package/dist/cjs/binary-tree.cjs +1897 -19
  11. package/dist/cjs/graph.cjs +174 -0
  12. package/dist/cjs/hash.cjs +33 -0
  13. package/dist/cjs/heap.cjs +71 -0
  14. package/dist/cjs/index.cjs +2383 -3
  15. package/dist/cjs/linked-list.cjs +224 -2
  16. package/dist/cjs/matrix.cjs +24 -0
  17. package/dist/cjs/priority-queue.cjs +71 -0
  18. package/dist/cjs/queue.cjs +221 -1
  19. package/dist/cjs/stack.cjs +59 -0
  20. package/dist/cjs/trie.cjs +62 -0
  21. package/dist/cjs-legacy/binary-tree.cjs +1897 -19
  22. package/dist/cjs-legacy/graph.cjs +174 -0
  23. package/dist/cjs-legacy/hash.cjs +33 -0
  24. package/dist/cjs-legacy/heap.cjs +71 -0
  25. package/dist/cjs-legacy/index.cjs +2383 -3
  26. package/dist/cjs-legacy/linked-list.cjs +224 -2
  27. package/dist/cjs-legacy/matrix.cjs +24 -0
  28. package/dist/cjs-legacy/priority-queue.cjs +71 -0
  29. package/dist/cjs-legacy/queue.cjs +221 -1
  30. package/dist/cjs-legacy/stack.cjs +59 -0
  31. package/dist/cjs-legacy/trie.cjs +62 -0
  32. package/dist/esm/binary-tree.mjs +1897 -19
  33. package/dist/esm/graph.mjs +174 -0
  34. package/dist/esm/hash.mjs +33 -0
  35. package/dist/esm/heap.mjs +71 -0
  36. package/dist/esm/index.mjs +2383 -3
  37. package/dist/esm/linked-list.mjs +224 -2
  38. package/dist/esm/matrix.mjs +24 -0
  39. package/dist/esm/priority-queue.mjs +71 -0
  40. package/dist/esm/queue.mjs +221 -1
  41. package/dist/esm/stack.mjs +59 -0
  42. package/dist/esm/trie.mjs +62 -0
  43. package/dist/esm-legacy/binary-tree.mjs +1897 -19
  44. package/dist/esm-legacy/graph.mjs +174 -0
  45. package/dist/esm-legacy/hash.mjs +33 -0
  46. package/dist/esm-legacy/heap.mjs +71 -0
  47. package/dist/esm-legacy/index.mjs +2383 -3
  48. package/dist/esm-legacy/linked-list.mjs +224 -2
  49. package/dist/esm-legacy/matrix.mjs +24 -0
  50. package/dist/esm-legacy/priority-queue.mjs +71 -0
  51. package/dist/esm-legacy/queue.mjs +221 -1
  52. package/dist/esm-legacy/stack.mjs +59 -0
  53. package/dist/esm-legacy/trie.mjs +62 -0
  54. package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
  55. package/dist/types/data-structures/base/linear-base.d.ts +6 -0
  56. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +36 -0
  57. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
  58. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +75 -0
  59. package/dist/types/data-structures/binary-tree/bst.d.ts +72 -0
  60. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
  61. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
  62. package/dist/types/data-structures/binary-tree/tree-map.d.ts +375 -0
  63. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
  64. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
  65. package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -0
  66. package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
  67. package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
  68. package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
  69. package/dist/types/data-structures/heap/heap.d.ts +42 -0
  70. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -2
  71. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
  72. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
  73. package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
  74. package/dist/types/data-structures/queue/deque.d.ts +90 -1
  75. package/dist/types/data-structures/queue/queue.d.ts +36 -0
  76. package/dist/types/data-structures/stack/stack.d.ts +30 -0
  77. package/dist/types/data-structures/trie/trie.d.ts +36 -0
  78. package/dist/umd/data-structure-typed.js +2383 -3
  79. package/dist/umd/data-structure-typed.min.js +3 -3
  80. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
  81. package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
  82. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
  83. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
  84. package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
  85. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
  86. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
  87. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  88. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  89. package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
  90. package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
  91. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
  92. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
  93. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
  94. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +30 -26
  95. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
  96. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
  97. package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
  98. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
  99. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
  100. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
  101. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
  102. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
  103. package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
  104. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
  105. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
  106. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
  107. package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
  108. package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
  109. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
  110. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
  111. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
  112. package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
  113. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
  114. package/jest.integration.config.js +1 -2
  115. package/package.json +51 -50
  116. package/src/common/error.ts +15 -32
  117. package/src/common/index.ts +0 -3
  118. package/src/data-structures/base/iterable-element-base.ts +32 -3
  119. package/src/data-structures/base/linear-base.ts +13 -36
  120. package/src/data-structures/binary-tree/avl-tree.ts +31 -493
  121. package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -530
  122. package/src/data-structures/binary-tree/binary-tree.ts +326 -1236
  123. package/src/data-structures/binary-tree/bst.ts +158 -1010
  124. package/src/data-structures/binary-tree/red-black-tree.ts +451 -1233
  125. package/src/data-structures/binary-tree/segment-tree.ts +73 -333
  126. package/src/data-structures/binary-tree/tree-map.ts +462 -4749
  127. package/src/data-structures/binary-tree/tree-multi-map.ts +310 -4530
  128. package/src/data-structures/binary-tree/tree-multi-set.ts +300 -3652
  129. package/src/data-structures/binary-tree/tree-set.ts +437 -4443
  130. package/src/data-structures/graph/abstract-graph.ts +98 -167
  131. package/src/data-structures/graph/directed-graph.ts +137 -532
  132. package/src/data-structures/graph/map-graph.ts +0 -3
  133. package/src/data-structures/graph/undirected-graph.ts +132 -484
  134. package/src/data-structures/hash/hash-map.ts +154 -549
  135. package/src/data-structures/heap/heap.ts +200 -753
  136. package/src/data-structures/linked-list/doubly-linked-list.ts +153 -809
  137. package/src/data-structures/linked-list/singly-linked-list.ts +122 -749
  138. package/src/data-structures/linked-list/skip-linked-list.ts +211 -864
  139. package/src/data-structures/matrix/matrix.ts +179 -494
  140. package/src/data-structures/matrix/navigator.ts +0 -1
  141. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
  142. package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
  143. package/src/data-structures/priority-queue/priority-queue.ts +1 -2
  144. package/src/data-structures/queue/deque.ts +241 -807
  145. package/src/data-structures/queue/queue.ts +102 -589
  146. package/src/data-structures/stack/stack.ts +76 -475
  147. package/src/data-structures/trie/trie.ts +98 -592
  148. package/src/types/common.ts +0 -10
  149. package/src/types/data-structures/binary-tree/bst.ts +0 -7
  150. package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
  151. package/src/types/data-structures/graph/abstract-graph.ts +0 -2
  152. package/src/types/data-structures/hash/hash-map.ts +0 -3
  153. package/src/types/data-structures/hash/index.ts +0 -1
  154. package/src/types/data-structures/matrix/navigator.ts +0 -2
  155. package/src/types/utils/utils.ts +0 -7
  156. package/src/types/utils/validate-type.ts +0 -7
  157. package/src/utils/number.ts +0 -2
  158. package/src/utils/utils.ts +0 -5
@@ -43,7 +43,7 @@ minTree.query(0, 4); // 1
43
43
  iterator: IterableIterator<E>;
44
44
  ```
45
45
 
46
- Defined in: [data-structures/binary-tree/segment-tree.ts:586](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L586)
46
+ Defined in: [data-structures/binary-tree/segment-tree.ts:604](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L604)
47
47
 
48
48
  Iterates over leaf values in index order.
49
49
 
@@ -65,7 +65,7 @@ Iterable.[iterator]
65
65
  get(index): E;
66
66
  ```
67
67
 
68
- Defined in: [data-structures/binary-tree/segment-tree.ts:360](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L360)
68
+ Defined in: [data-structures/binary-tree/segment-tree.ts:372](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L372)
69
69
 
70
70
  Get element at index.
71
71
  Time: O(1)
@@ -99,7 +99,7 @@ Time: O(1)
99
99
  maxRight(left, predicate): number;
100
100
  ```
101
101
 
102
- Defined in: [data-structures/binary-tree/segment-tree.ts:420](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L420)
102
+ Defined in: [data-structures/binary-tree/segment-tree.ts:435](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L435)
103
103
 
104
104
  Find the largest r such that predicate(query(left, r)) is true.
105
105
  Returns left-1 if predicate(identity) is false.
@@ -142,7 +142,7 @@ Time: O(log n)
142
142
  minLeft(right, predicate): number;
143
143
  ```
144
144
 
145
- Defined in: [data-structures/binary-tree/segment-tree.ts:515](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L515)
145
+ Defined in: [data-structures/binary-tree/segment-tree.ts:533](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L533)
146
146
 
147
147
  Find the smallest l such that predicate(query(l, right)) is true.
148
148
  Returns right+1 if predicate(identity) is false.
@@ -184,7 +184,7 @@ Time: O(log n)
184
184
  query(start, end): E;
185
185
  ```
186
186
 
187
- Defined in: [data-structures/binary-tree/segment-tree.ts:286](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L286)
187
+ Defined in: [data-structures/binary-tree/segment-tree.ts:295](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L295)
188
188
 
189
189
  Range query: returns merger result over [start, end] (inclusive).
190
190
  Time: O(log n)
@@ -229,7 +229,7 @@ Time: O(log n)
229
229
  update(index, value): void;
230
230
  ```
231
231
 
232
- Defined in: [data-structures/binary-tree/segment-tree.ts:217](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L217)
232
+ Defined in: [data-structures/binary-tree/segment-tree.ts:223](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L223)
233
233
 
234
234
  Point update: set element at index to value.
235
235
  Time: O(log n)
@@ -279,7 +279,7 @@ Time: O(log n)
279
279
  static max(elements): SegmentTree<number>;
280
280
  ```
281
281
 
282
- Defined in: [data-structures/binary-tree/segment-tree.ts:148](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L148)
282
+ Defined in: [data-structures/binary-tree/segment-tree.ts:151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L151)
283
283
 
284
284
  Create a max segment tree.
285
285
 
@@ -308,7 +308,7 @@ st.query(1, 4); // 5
308
308
  static min(elements): SegmentTree<number>;
309
309
  ```
310
310
 
311
- Defined in: [data-structures/binary-tree/segment-tree.ts:133](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L133)
311
+ Defined in: [data-structures/binary-tree/segment-tree.ts:136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/segment-tree.ts#L136)
312
312
 
313
313
  Create a min segment tree.
314
314
 
@@ -442,7 +442,7 @@ Producing the iterator is O(1); consuming the entire iterator is Time O(n) with
442
442
  addAfter(existingElementOrNode, newElementOrNode): boolean;
443
443
  ```
444
444
 
445
- 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)
445
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1225](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1225)
446
446
 
447
447
  Insert a new element/node after an existing one.
448
448
 
@@ -482,7 +482,7 @@ Time O(N), Space O(1)
482
482
  addAt(index, newElementOrNode): boolean;
483
483
  ```
484
484
 
485
- 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)
485
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:961](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L961)
486
486
 
487
487
  Insert a new element/node at an index, shifting following nodes.
488
488
 
@@ -533,7 +533,7 @@ Time O(N), Space O(1)
533
533
  addBefore(existingElementOrNode, newElementOrNode): boolean;
534
534
  ```
535
535
 
536
- 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)
536
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1195)
537
537
 
538
538
  Insert a new element/node before an existing one.
539
539
 
@@ -573,7 +573,7 @@ Time O(N), Space O(1)
573
573
  at(index): E | undefined;
574
574
  ```
575
575
 
576
- 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)
576
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:701](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L701)
577
577
 
578
578
  Get the element at a given index.
579
579
 
@@ -619,7 +619,7 @@ Time O(N), Space O(1)
619
619
  clear(): void;
620
620
  ```
621
621
 
622
- 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)
622
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1092](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1092)
623
623
 
624
624
  Remove all nodes and reset length.
625
625
 
@@ -656,7 +656,7 @@ Time O(N), Space O(1)
656
656
  clone(): this;
657
657
  ```
658
658
 
659
- Defined in: [data-structures/linked-list/singly-linked-list.ts:1367](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1367)
659
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1406](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1406)
660
660
 
661
661
  Deep clone this list (values are copied by reference).
662
662
 
@@ -695,7 +695,7 @@ Time O(N), Space O(N)
695
695
  concat(...items): this;
696
696
  ```
697
697
 
698
- 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)
698
+ Defined in: [data-structures/base/linear-base.ts:484](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L484)
699
699
 
700
700
  Concatenate lists/elements preserving order.
701
701
 
@@ -731,7 +731,7 @@ Time O(sum(length)), Space O(sum(length))
731
731
  countOccurrences(elementOrNode): number;
732
732
  ```
733
733
 
734
- 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)
734
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1301](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1301)
735
735
 
736
736
  Count how many nodes match a value/node/predicate.
737
737
 
@@ -763,7 +763,7 @@ Time O(N), Space O(1)
763
763
  delete(elementOrNode?): boolean;
764
764
  ```
765
765
 
766
- 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)
766
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:892](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L892)
767
767
 
768
768
  Delete the first match by value/node.
769
769
 
@@ -808,7 +808,7 @@ Time O(N), Space O(1)
808
808
  deleteAt(index): E | undefined;
809
809
  ```
810
810
 
811
- 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)
811
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:829](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L829)
812
812
 
813
813
  Delete the element at an index.
814
814
 
@@ -853,7 +853,7 @@ Time O(N), Space O(1)
853
853
  deleteWhere(predicate): boolean;
854
854
  ```
855
855
 
856
- 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)
856
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1331](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1331)
857
857
 
858
858
  Delete the first node whose value matches a predicate.
859
859
 
@@ -877,6 +877,30 @@ Time O(N), Space O(1)
877
877
 
878
878
  ***
879
879
 
880
+ ### entries()
881
+
882
+ ```ts
883
+ entries(): IterableIterator<[number, E]>;
884
+ ```
885
+
886
+ 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)
887
+
888
+ Return an iterator of `[index, value]` pairs (Array-compatible).
889
+
890
+ #### Returns
891
+
892
+ `IterableIterator`\<\[`number`, `E`\]\>
893
+
894
+ #### Remarks
895
+
896
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
897
+
898
+ #### Inherited from
899
+
900
+ [`LinearLinkedBase`](LinearLinkedBase.md).[`entries`](LinearLinkedBase.md#entries)
901
+
902
+ ***
903
+
880
904
  ### every()
881
905
 
882
906
  ```ts
@@ -972,7 +996,7 @@ Time O(n), Space O(1)
972
996
  filter(callback, thisArg?): this;
973
997
  ```
974
998
 
975
- 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)
999
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1477](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1477)
976
1000
 
977
1001
  Filter values into a new list of the same class.
978
1002
 
@@ -1203,7 +1227,7 @@ Time O(n), Space O(1).
1203
1227
  getNode(elementNodeOrPredicate?): SinglyLinkedListNode<E> | undefined;
1204
1228
  ```
1205
1229
 
1206
- 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)
1230
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1173](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1173)
1207
1231
 
1208
1232
  Find a node by value, reference, or predicate.
1209
1233
 
@@ -1235,7 +1259,7 @@ Time O(N), Space O(1)
1235
1259
  getNodeAt(index): SinglyLinkedListNode<E> | undefined;
1236
1260
  ```
1237
1261
 
1238
- 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)
1262
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:771](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L771)
1239
1263
 
1240
1264
  Get the node reference at a given index.
1241
1265
 
@@ -1307,13 +1331,47 @@ Time O(n) in the worst case. Space O(1).
1307
1331
 
1308
1332
  ***
1309
1333
 
1334
+ ### includes()
1335
+
1336
+ ```ts
1337
+ includes(element): boolean;
1338
+ ```
1339
+
1340
+ 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)
1341
+
1342
+ Check whether a value exists (Array-compatible alias for `has`).
1343
+
1344
+ #### Parameters
1345
+
1346
+ ##### element
1347
+
1348
+ `E`
1349
+
1350
+ Element to search for (uses `===`).
1351
+
1352
+ #### Returns
1353
+
1354
+ `boolean`
1355
+
1356
+ `true` if found.
1357
+
1358
+ #### Remarks
1359
+
1360
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1).
1361
+
1362
+ #### Inherited from
1363
+
1364
+ [`LinearLinkedBase`](LinearLinkedBase.md).[`includes`](LinearLinkedBase.md#includes)
1365
+
1366
+ ***
1367
+
1310
1368
  ### indexOf()
1311
1369
 
1312
1370
  ```ts
1313
1371
  indexOf(searchElement, fromIndex?): number;
1314
1372
  ```
1315
1373
 
1316
- 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)
1374
+ Defined in: [data-structures/base/linear-base.ts:433](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L433)
1317
1375
 
1318
1376
  Linked-list optimized `indexOf` (forwards scan).
1319
1377
 
@@ -1353,7 +1411,7 @@ Time O(n), Space O(1)
1353
1411
  isEmpty(): boolean;
1354
1412
  ```
1355
1413
 
1356
- 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)
1414
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1037](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1037)
1357
1415
 
1358
1416
  Check whether the list is empty.
1359
1417
 
@@ -1388,7 +1446,7 @@ Time O(1), Space O(1)
1388
1446
  isNode(elementNodeOrPredicate): elementNodeOrPredicate is SinglyLinkedListNode<E>;
1389
1447
  ```
1390
1448
 
1391
- 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)
1449
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:715](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L715)
1392
1450
 
1393
1451
  Type guard: check whether the input is a SinglyLinkedListNode.
1394
1452
 
@@ -1448,13 +1506,37 @@ Time O(n), Space O(n)
1448
1506
 
1449
1507
  ***
1450
1508
 
1509
+ ### keys()
1510
+
1511
+ ```ts
1512
+ keys(): IterableIterator<number>;
1513
+ ```
1514
+
1515
+ 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)
1516
+
1517
+ Return an iterator of numeric indices (Array-compatible).
1518
+
1519
+ #### Returns
1520
+
1521
+ `IterableIterator`\<`number`\>
1522
+
1523
+ #### Remarks
1524
+
1525
+ Provided for familiarity when migrating from Array. Time O(n), Space O(1) per step.
1526
+
1527
+ #### Inherited from
1528
+
1529
+ [`LinearLinkedBase`](LinearLinkedBase.md).[`keys`](LinearLinkedBase.md#keys)
1530
+
1531
+ ***
1532
+
1451
1533
  ### lastIndexOf()
1452
1534
 
1453
1535
  ```ts
1454
1536
  lastIndexOf(searchElement, fromIndex?): number;
1455
1537
  ```
1456
1538
 
1457
- 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)
1539
+ Defined in: [data-structures/base/linear-base.ts:459](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L459)
1458
1540
 
1459
1541
  Linked-list optimized `lastIndexOf` (reverse scan).
1460
1542
 
@@ -1497,7 +1579,7 @@ map<EM, RM>(
1497
1579
  thisArg?): SinglyLinkedList<EM, RM>;
1498
1580
  ```
1499
1581
 
1500
- 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)
1582
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1560](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1560)
1501
1583
 
1502
1584
  Map values into a new list (possibly different element type).
1503
1585
 
@@ -1564,7 +1646,7 @@ Time O(N), Space O(N)
1564
1646
  mapSame(callback, thisArg?): this;
1565
1647
  ```
1566
1648
 
1567
- 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)
1649
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1492](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1492)
1568
1650
 
1569
1651
  Map values into a new list of the same class.
1570
1652
 
@@ -1604,7 +1686,7 @@ Time O(N), Space O(N)
1604
1686
  pop(): E | undefined;
1605
1687
  ```
1606
1688
 
1607
- 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)
1689
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:434](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L434)
1608
1690
 
1609
1691
  Remove and return the tail element.
1610
1692
 
@@ -1647,7 +1729,7 @@ Time O(N), Space O(1)
1647
1729
  print(): void;
1648
1730
  ```
1649
1731
 
1650
- 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)
1732
+ 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)
1651
1733
 
1652
1734
  Prints `toVisual()` to the console. Intended for quick debugging.
1653
1735
 
@@ -1673,7 +1755,7 @@ Time O(n) due to materialization, Space O(n) for the intermediate representation
1673
1755
  push(elementOrNode): boolean;
1674
1756
  ```
1675
1757
 
1676
- 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)
1758
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:358](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L358)
1677
1759
 
1678
1760
  Append an element/node to the tail.
1679
1761
 
@@ -1728,7 +1810,7 @@ Time O(1), Space O(1)
1728
1810
  pushMany(elements): boolean[];
1729
1811
  ```
1730
1812
 
1731
- 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)
1813
+ 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)
1732
1814
 
1733
1815
  Append a sequence of elements/nodes.
1734
1816
 
@@ -1796,7 +1878,7 @@ Time O(n), Space O(1). Throws if called on an empty structure without `initialVa
1796
1878
  reduce(callbackfn): E;
1797
1879
  ```
1798
1880
 
1799
- 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)
1881
+ 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)
1800
1882
 
1801
1883
  ##### Parameters
1802
1884
 
@@ -1818,7 +1900,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:194](https://github.c
1818
1900
  reduce(callbackfn, initialValue): E;
1819
1901
  ```
1820
1902
 
1821
- 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)
1903
+ 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)
1822
1904
 
1823
1905
  ##### Parameters
1824
1906
 
@@ -1844,7 +1926,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:195](https://github.c
1844
1926
  reduce<U>(callbackfn, initialValue): U;
1845
1927
  ```
1846
1928
 
1847
- 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)
1929
+ 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)
1848
1930
 
1849
1931
  ##### Type Parameters
1850
1932
 
@@ -1878,7 +1960,7 @@ Defined in: [data-structures/base/iterable-element-base.ts:196](https://github.c
1878
1960
  reduceRight<U>(callbackfn, initialValue): U;
1879
1961
  ```
1880
1962
 
1881
- 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)
1963
+ Defined in: [data-structures/base/linear-base.ts:585](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L585)
1882
1964
 
1883
1965
  Right-to-left reduction using reverse iterator.
1884
1966
 
@@ -1924,7 +2006,7 @@ Time O(n), Space O(1)
1924
2006
  reverse(): this;
1925
2007
  ```
1926
2008
 
1927
- 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)
2009
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1151](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1151)
1928
2010
 
1929
2011
  Reverse the list in place.
1930
2012
 
@@ -1961,7 +2043,7 @@ Time O(N), Space O(1)
1961
2043
  search(elementNodeOrPredicate): E | undefined;
1962
2044
  ```
1963
2045
 
1964
- 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)
2046
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:634](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L634)
1965
2047
 
1966
2048
  Find the first value matching a predicate (by node).
1967
2049
 
@@ -1993,7 +2075,7 @@ Time O(N), Space O(1)
1993
2075
  setAt(index, value): boolean;
1994
2076
  ```
1995
2077
 
1996
- 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)
2078
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:981](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L981)
1997
2079
 
1998
2080
  Set the element value at an index.
1999
2081
 
@@ -2033,7 +2115,7 @@ Time O(N), Space O(1)
2033
2115
  setEquality(equals): this;
2034
2116
  ```
2035
2117
 
2036
- 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)
2118
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1319](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1319)
2037
2119
 
2038
2120
  Set the equality comparator used to compare values.
2039
2121
 
@@ -2063,7 +2145,7 @@ Time O(1), Space O(1)
2063
2145
  shift(): E | undefined;
2064
2146
  ```
2065
2147
 
2066
- 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)
2148
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:505](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L505)
2067
2149
 
2068
2150
  Remove and return the head element.
2069
2151
 
@@ -2096,7 +2178,7 @@ Time O(1), Space O(1)
2096
2178
  slice(start?, end?): this;
2097
2179
  ```
2098
2180
 
2099
- 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)
2181
+ Defined in: [data-structures/base/linear-base.ts:505](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L505)
2100
2182
 
2101
2183
  Slice via forward iteration (no random access required).
2102
2184
 
@@ -2213,7 +2295,7 @@ splice(
2213
2295
  items?): this;
2214
2296
  ```
2215
2297
 
2216
- 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)
2298
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1245](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1245)
2217
2299
 
2218
2300
  Remove and/or insert elements at a position (array-like behavior).
2219
2301
 
@@ -2259,7 +2341,7 @@ Time O(N + M), Space O(M)
2259
2341
  toArray(): E[];
2260
2342
  ```
2261
2343
 
2262
- 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)
2344
+ 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)
2263
2345
 
2264
2346
  Materializes the elements into a new array.
2265
2347
 
@@ -2279,6 +2361,32 @@ Time O(n), Space O(n).
2279
2361
 
2280
2362
  ***
2281
2363
 
2364
+ ### toReversed()
2365
+
2366
+ ```ts
2367
+ toReversed(): this;
2368
+ ```
2369
+
2370
+ Defined in: [data-structures/base/linear-base.ts:335](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L335)
2371
+
2372
+ Return a new instance of the same type with elements in reverse order (non-mutating).
2373
+
2374
+ #### Returns
2375
+
2376
+ `this`
2377
+
2378
+ A new reversed instance.
2379
+
2380
+ #### Remarks
2381
+
2382
+ Provided for familiarity when migrating from Array (ES2023 `toReversed`). Time O(n), Space O(n).
2383
+
2384
+ #### Inherited from
2385
+
2386
+ [`LinearLinkedBase`](LinearLinkedBase.md).[`toReversed`](LinearLinkedBase.md#toreversed)
2387
+
2388
+ ***
2389
+
2282
2390
  ### toReversedArray()
2283
2391
 
2284
2392
  ```ts
@@ -2311,7 +2419,7 @@ Time O(n), Space O(n)
2311
2419
  toVisual(): E[];
2312
2420
  ```
2313
2421
 
2314
- 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)
2422
+ 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)
2315
2423
 
2316
2424
  Returns a representation of the structure suitable for quick visualization.
2317
2425
  Defaults to an array of elements; subclasses may override to provide richer visuals.
@@ -2338,7 +2446,7 @@ Time O(n), Space O(n).
2338
2446
  unshift(elementOrNode): boolean;
2339
2447
  ```
2340
2448
 
2341
- 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)
2449
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:583](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L583)
2342
2450
 
2343
2451
  Prepend an element/node to the head.
2344
2452
 
@@ -2394,7 +2502,7 @@ Time O(1), Space O(1)
2394
2502
  unshiftMany(elements): boolean[];
2395
2503
  ```
2396
2504
 
2397
- 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)
2505
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:618](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L618)
2398
2506
 
2399
2507
  Prepend a sequence of elements/nodes.
2400
2508
 
@@ -2544,7 +2652,7 @@ Time O(1), Space O(1).
2544
2652
  protected _createInstance(options?): this;
2545
2653
  ```
2546
2654
 
2547
- 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)
2655
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1683](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1683)
2548
2656
 
2549
2657
  (Protected) Create an empty instance of the same concrete class.
2550
2658
 
@@ -2578,7 +2686,7 @@ Time O(1), Space O(1)
2578
2686
  protected _createLike<EM, RM>(elements?, options?): SinglyLinkedList<EM, RM>;
2579
2687
  ```
2580
2688
 
2581
- 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)
2689
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1701](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1701)
2582
2690
 
2583
2691
  (Protected) Create a like-kind instance and seed it from an iterable.
2584
2692
 
@@ -2626,7 +2734,7 @@ Time O(N), Space O(N)
2626
2734
  protected _ensureNode(elementOrNode): SinglyLinkedListNode<E>;
2627
2735
  ```
2628
2736
 
2629
- 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)
2737
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1602](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1602)
2630
2738
 
2631
2739
  (Protected) Normalize input into a node instance.
2632
2740
 
@@ -2656,7 +2764,7 @@ Time O(1), Space O(1)
2656
2764
  protected _ensurePredicate(elementNodeOrPredicate): (node) => boolean;
2657
2765
  ```
2658
2766
 
2659
- 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)
2767
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1614](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1614)
2660
2768
 
2661
2769
  (Protected) Normalize input into a node predicate.
2662
2770
 
@@ -2688,7 +2796,7 @@ Time O(1), Space O(1)
2688
2796
  protected _getIterator(): IterableIterator<E>;
2689
2797
  ```
2690
2798
 
2691
- 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)
2799
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1643](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1643)
2692
2800
 
2693
2801
  (Protected) Iterate values from head to tail.
2694
2802
 
@@ -2714,7 +2822,7 @@ Time O(N), Space O(1)
2714
2822
  protected _getNodeIterator(): IterableIterator<SinglyLinkedListNode<E>>;
2715
2823
  ```
2716
2824
 
2717
- 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)
2825
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1668](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1668)
2718
2826
 
2719
2827
  (Protected) Iterate nodes from head to tail.
2720
2828
 
@@ -2740,7 +2848,7 @@ Time O(N), Space O(1)
2740
2848
  protected _getPrevNode(node): SinglyLinkedListNode<E> | undefined;
2741
2849
  ```
2742
2850
 
2743
- 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)
2851
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1630](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1630)
2744
2852
 
2745
2853
  (Protected) Get the previous node of a given node.
2746
2854
 
@@ -2774,7 +2882,7 @@ Time O(N), Space O(1)
2774
2882
  protected _getReverseIterator(): IterableIterator<E>;
2775
2883
  ```
2776
2884
 
2777
- 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)
2885
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1657](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1657)
2778
2886
 
2779
2887
  (Protected) Iterate values from tail to head.
2780
2888
 
@@ -2800,7 +2908,7 @@ Time O(N), Space O(N)
2800
2908
  protected _isPredicate(elementNodeOrPredicate): elementNodeOrPredicate is (node: SinglyLinkedListNode<E>) => boolean;
2801
2909
  ```
2802
2910
 
2803
- 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)
2911
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1589](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1589)
2804
2912
 
2805
2913
  (Protected) Check if input is a node predicate function.
2806
2914
 
@@ -2832,7 +2940,7 @@ Time O(1), Space O(1)
2832
2940
  protected _spawnLike<EM, RM>(options?): SinglyLinkedList<EM, RM>;
2833
2941
  ```
2834
2942
 
2835
- 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)
2943
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1721](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1721)
2836
2944
 
2837
2945
  (Protected) Spawn an empty like-kind list instance.
2838
2946
 
@@ -2872,7 +2980,7 @@ Time O(1), Space O(1)
2872
2980
  protected createNode(value): SinglyLinkedListNode<E>;
2873
2981
  ```
2874
2982
 
2875
- 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)
2983
+ Defined in: [data-structures/linked-list/singly-linked-list.ts:1578](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/linked-list/singly-linked-list.ts#L1578)
2876
2984
 
2877
2985
  (Protected) Create a node from a value.
2878
2986