data-structure-typed 2.5.1 → 2.5.3

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 (184) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/MIGRATION.md +169 -0
  3. package/README.md +135 -23
  4. package/README_CN.md +551 -143
  5. package/SPECIFICATION.md +20 -14
  6. package/SPECIFICATION.zh-CN.md +20 -14
  7. package/dist/cjs/binary-tree.cjs +6460 -1591
  8. package/dist/cjs/graph.cjs +440 -20
  9. package/dist/cjs/hash.cjs +125 -22
  10. package/dist/cjs/heap.cjs +196 -47
  11. package/dist/cjs/index.cjs +8486 -2429
  12. package/dist/cjs/linked-list.cjs +456 -31
  13. package/dist/cjs/matrix.cjs +79 -9
  14. package/dist/cjs/priority-queue.cjs +193 -44
  15. package/dist/cjs/queue.cjs +391 -2
  16. package/dist/cjs/stack.cjs +92 -6
  17. package/dist/cjs/trie.cjs +122 -28
  18. package/dist/cjs-legacy/binary-tree.cjs +6484 -1612
  19. package/dist/cjs-legacy/graph.cjs +440 -20
  20. package/dist/cjs-legacy/hash.cjs +125 -22
  21. package/dist/cjs-legacy/heap.cjs +196 -47
  22. package/dist/cjs-legacy/index.cjs +8654 -2594
  23. package/dist/cjs-legacy/linked-list.cjs +456 -31
  24. package/dist/cjs-legacy/matrix.cjs +79 -9
  25. package/dist/cjs-legacy/priority-queue.cjs +193 -44
  26. package/dist/cjs-legacy/queue.cjs +391 -2
  27. package/dist/cjs-legacy/stack.cjs +92 -6
  28. package/dist/cjs-legacy/trie.cjs +122 -28
  29. package/dist/esm/binary-tree.mjs +6460 -1591
  30. package/dist/esm/graph.mjs +440 -20
  31. package/dist/esm/hash.mjs +125 -22
  32. package/dist/esm/heap.mjs +196 -47
  33. package/dist/esm/index.mjs +8486 -2430
  34. package/dist/esm/linked-list.mjs +456 -31
  35. package/dist/esm/matrix.mjs +79 -9
  36. package/dist/esm/priority-queue.mjs +193 -44
  37. package/dist/esm/queue.mjs +391 -2
  38. package/dist/esm/stack.mjs +92 -6
  39. package/dist/esm/trie.mjs +122 -28
  40. package/dist/esm-legacy/binary-tree.mjs +6484 -1612
  41. package/dist/esm-legacy/graph.mjs +440 -20
  42. package/dist/esm-legacy/hash.mjs +125 -22
  43. package/dist/esm-legacy/heap.mjs +196 -47
  44. package/dist/esm-legacy/index.mjs +8654 -2595
  45. package/dist/esm-legacy/linked-list.mjs +456 -31
  46. package/dist/esm-legacy/matrix.mjs +79 -9
  47. package/dist/esm-legacy/priority-queue.mjs +193 -44
  48. package/dist/esm-legacy/queue.mjs +391 -2
  49. package/dist/esm-legacy/stack.mjs +92 -6
  50. package/dist/esm-legacy/trie.mjs +122 -28
  51. package/dist/types/common/error.d.ts +9 -0
  52. package/dist/types/common/index.d.ts +1 -1
  53. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +98 -2
  54. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +112 -0
  55. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +214 -13
  56. package/dist/types/data-structures/binary-tree/bst.d.ts +294 -3
  57. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +155 -8
  58. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +48 -0
  59. package/dist/types/data-structures/binary-tree/tree-map.d.ts +1370 -323
  60. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1329 -316
  61. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +1116 -295
  62. package/dist/types/data-structures/binary-tree/tree-set.d.ts +1330 -326
  63. package/dist/types/data-structures/graph/directed-graph.d.ts +80 -0
  64. package/dist/types/data-structures/graph/undirected-graph.d.ts +72 -0
  65. package/dist/types/data-structures/hash/hash-map.d.ts +95 -6
  66. package/dist/types/data-structures/heap/heap.d.ts +154 -12
  67. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +143 -0
  68. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -1
  69. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +144 -0
  70. package/dist/types/data-structures/matrix/matrix.d.ts +64 -0
  71. package/dist/types/data-structures/queue/deque.d.ts +142 -0
  72. package/dist/types/data-structures/queue/queue.d.ts +109 -0
  73. package/dist/types/data-structures/stack/stack.d.ts +82 -2
  74. package/dist/types/data-structures/trie/trie.d.ts +96 -0
  75. package/dist/types/interfaces/binary-tree.d.ts +2 -3
  76. package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
  77. package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
  78. package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
  79. package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
  80. package/dist/umd/data-structure-typed.js +8623 -2564
  81. package/dist/umd/data-structure-typed.min.js +5 -5
  82. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +696 -194
  83. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
  84. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
  85. package/docs-site-docusaurus/docs/api/classes/BST.md +639 -189
  86. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
  87. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
  88. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +148 -160
  89. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  90. package/docs-site-docusaurus/docs/api/classes/Deque.md +105 -91
  91. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
  92. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +104 -74
  93. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
  94. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
  95. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  96. package/docs-site-docusaurus/docs/api/classes/HashMap.md +51 -51
  97. package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
  98. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
  99. package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
  100. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
  101. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
  102. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +55 -55
  103. package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
  104. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
  105. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
  106. package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
  107. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
  108. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
  109. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
  110. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
  111. package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
  112. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
  113. package/docs-site-docusaurus/docs/api/classes/Queue.md +112 -60
  114. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +708 -206
  115. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
  116. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +79 -79
  117. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
  118. package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
  119. package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
  120. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +236 -33
  121. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
  122. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +232 -32
  123. package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
  124. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  125. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
  126. package/docs-site-docusaurus/docs/guide/architecture.md +75 -5
  127. package/docs-site-docusaurus/docs/guide/concepts.md +53 -3
  128. package/docs-site-docusaurus/docs/guide/faq.md +233 -0
  129. package/docs-site-docusaurus/docs/guide/guides.md +43 -58
  130. package/docs-site-docusaurus/docs/guide/installation.md +2 -0
  131. package/docs-site-docusaurus/docs/guide/integrations.md +75 -176
  132. package/docs-site-docusaurus/docs/guide/overview.md +132 -11
  133. package/docs-site-docusaurus/docs/guide/performance.md +2 -0
  134. package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
  135. package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
  136. package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
  137. package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
  138. package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
  139. package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
  140. package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
  141. package/docs-site-docusaurus/docusaurus.config.ts +1 -1
  142. package/docs-site-docusaurus/src/pages/index.tsx +55 -2
  143. package/docs-site-docusaurus/static/llms.txt +37 -0
  144. package/docs-site-docusaurus/typedoc.json +1 -0
  145. package/llms.txt +37 -0
  146. package/package.json +65 -56
  147. package/src/common/error.ts +19 -1
  148. package/src/common/index.ts +1 -1
  149. package/src/data-structures/base/iterable-element-base.ts +3 -2
  150. package/src/data-structures/binary-tree/avl-tree.ts +99 -5
  151. package/src/data-structures/binary-tree/binary-indexed-tree.ts +102 -4
  152. package/src/data-structures/binary-tree/binary-tree.ts +239 -78
  153. package/src/data-structures/binary-tree/bst.ts +542 -13
  154. package/src/data-structures/binary-tree/red-black-tree.ts +155 -15
  155. package/src/data-structures/binary-tree/segment-tree.ts +42 -0
  156. package/src/data-structures/binary-tree/tree-map.ts +1223 -261
  157. package/src/data-structures/binary-tree/tree-multi-map.ts +939 -30
  158. package/src/data-structures/binary-tree/tree-multi-set.ts +746 -10
  159. package/src/data-structures/binary-tree/tree-set.ts +1018 -99
  160. package/src/data-structures/graph/abstract-graph.ts +2 -2
  161. package/src/data-structures/graph/directed-graph.ts +71 -1
  162. package/src/data-structures/graph/undirected-graph.ts +64 -1
  163. package/src/data-structures/hash/hash-map.ts +102 -16
  164. package/src/data-structures/heap/heap.ts +153 -23
  165. package/src/data-structures/heap/max-heap.ts +2 -2
  166. package/src/data-structures/linked-list/doubly-linked-list.ts +139 -0
  167. package/src/data-structures/linked-list/singly-linked-list.ts +106 -1
  168. package/src/data-structures/linked-list/skip-linked-list.ts +131 -5
  169. package/src/data-structures/matrix/matrix.ts +65 -9
  170. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
  171. package/src/data-structures/queue/deque.ts +130 -0
  172. package/src/data-structures/queue/queue.ts +109 -0
  173. package/src/data-structures/stack/stack.ts +75 -5
  174. package/src/data-structures/trie/trie.ts +86 -2
  175. package/src/interfaces/binary-tree.ts +1 -9
  176. package/src/types/data-structures/binary-tree/bst.ts +1 -0
  177. package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
  178. package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
  179. package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
  180. package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
  181. package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
  182. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
  183. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
  184. package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: LinkedHashMap\<K, V, R\>
8
8
 
9
- Defined in: [data-structures/hash/hash-map.ts:795](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L795)
9
+ Defined in: [data-structures/hash/hash-map.ts:920](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L920)
10
10
 
11
11
  Hash-based map that preserves insertion order via a doubly-linked list.
12
12
 
@@ -46,7 +46,7 @@ examples will be generated by unit test
46
46
  new LinkedHashMap<K, V, R>(entryOrRawElements?, options?): LinkedHashMap<K, V, R>;
47
47
  ```
48
48
 
49
- Defined in: [data-structures/hash/hash-map.ts:805](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L805)
49
+ Defined in: [data-structures/hash/hash-map.ts:930](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L930)
50
50
 
51
51
  Create a LinkedHashMap and optionally bulk-insert entries.
52
52
 
@@ -90,7 +90,7 @@ IterableEntryBase<K, V>.constructor
90
90
  get first(): [K, V] | undefined;
91
91
  ```
92
92
 
93
- Defined in: [data-structures/hash/hash-map.ts:897](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L897)
93
+ Defined in: [data-structures/hash/hash-map.ts:1020](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1020)
94
94
 
95
95
  Get the first [key, value] pair.
96
96
 
@@ -114,7 +114,7 @@ First entry or undefined when empty.
114
114
  get head(): HashMapLinkedNode<K, V | undefined>;
115
115
  ```
116
116
 
117
- Defined in: [data-structures/hash/hash-map.ts:859](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L859)
117
+ Defined in: [data-structures/hash/hash-map.ts:984](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L984)
118
118
 
119
119
  Get the head node (first entry) sentinel link.
120
120
 
@@ -138,7 +138,7 @@ Head node or sentinel.
138
138
  get last(): [K, V] | undefined;
139
139
  ```
140
140
 
141
- Defined in: [data-structures/hash/hash-map.ts:907](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L907)
141
+ Defined in: [data-structures/hash/hash-map.ts:1030](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1030)
142
142
 
143
143
  Get the last [key, value] pair.
144
144
 
@@ -162,7 +162,7 @@ Last entry or undefined when empty.
162
162
  get noObjMap(): Record<string, HashMapLinkedNode<K, V | undefined>>;
163
163
  ```
164
164
 
165
- Defined in: [data-structures/hash/hash-map.ts:843](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L843)
165
+ Defined in: [data-structures/hash/hash-map.ts:968](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L968)
166
166
 
167
167
  Get the internal record for non-object keys.
168
168
 
@@ -186,7 +186,7 @@ Record of hash→node.
186
186
  get objHashFn(): (key) => object;
187
187
  ```
188
188
 
189
- Defined in: [data-structures/hash/hash-map.ts:832](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L832)
189
+ Defined in: [data-structures/hash/hash-map.ts:957](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L957)
190
190
 
191
191
  Get the hash function for object/weak keys.
192
192
 
@@ -210,7 +210,7 @@ Object-hash function.
210
210
  get size(): number;
211
211
  ```
212
212
 
213
- Defined in: [data-structures/hash/hash-map.ts:888](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L888)
213
+ Defined in: [data-structures/hash/hash-map.ts:1011](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1011)
214
214
 
215
215
  Total number of entries.
216
216
 
@@ -238,7 +238,7 @@ Entry count.
238
238
  get tail(): HashMapLinkedNode<K, V | undefined>;
239
239
  ```
240
240
 
241
- Defined in: [data-structures/hash/hash-map.ts:870](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L870)
241
+ Defined in: [data-structures/hash/hash-map.ts:995](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L995)
242
242
 
243
243
  Get the tail node (last entry) sentinel link.
244
244
 
@@ -260,7 +260,7 @@ Tail node or sentinel.
260
260
  iterator: IterableIterator<[K, V]>;
261
261
  ```
262
262
 
263
- Defined in: [data-structures/base/iterable-entry-base.ts:22](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L22)
263
+ Defined in: [data-structures/base/iterable-entry-base.ts:22](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L22)
264
264
 
265
265
  Default iterator yielding `[key, value]` entries.
266
266
 
@@ -268,7 +268,7 @@ Default iterator yielding `[key, value]` entries.
268
268
 
269
269
  ##### args
270
270
 
271
- ...`any`[]
271
+ ...`unknown`[]
272
272
 
273
273
  #### Returns
274
274
 
@@ -292,7 +292,7 @@ Time O(n) to iterate, Space O(1)
292
292
  at(index): V | undefined;
293
293
  ```
294
294
 
295
- Defined in: [data-structures/hash/hash-map.ts:1021](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1021)
295
+ Defined in: [data-structures/hash/hash-map.ts:1148](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1148)
296
296
 
297
297
  Get the value at a given index in insertion order.
298
298
 
@@ -322,7 +322,7 @@ Time O(N), Space O(1)
322
322
  begin(): Generator<(K | V | undefined)[], void, unknown>;
323
323
  ```
324
324
 
325
- Defined in: [data-structures/hash/hash-map.ts:917](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L917)
325
+ Defined in: [data-structures/hash/hash-map.ts:1040](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1040)
326
326
 
327
327
  Iterate from head → tail.
328
328
 
@@ -344,7 +344,7 @@ Time O(N), Space O(1)
344
344
  clear(): void;
345
345
  ```
346
346
 
347
- Defined in: [data-structures/hash/hash-map.ts:1091](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1091)
347
+ Defined in: [data-structures/hash/hash-map.ts:1220](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1220)
348
348
 
349
349
  Remove all entries.
350
350
 
@@ -365,16 +365,16 @@ Time O(n) typical, Space O(1)
365
365
  ### clone()
366
366
 
367
367
  ```ts
368
- clone(): any;
368
+ clone(): this;
369
369
  ```
370
370
 
371
- Defined in: [data-structures/hash/hash-map.ts:1097](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1097)
371
+ Defined in: [data-structures/hash/hash-map.ts:1226](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1226)
372
372
 
373
373
  Deep clone preserving the concrete subtype.
374
374
 
375
375
  #### Returns
376
376
 
377
- `any`
377
+ `this`
378
378
 
379
379
  A new instance of the same concrete class (`this` type).
380
380
 
@@ -391,10 +391,10 @@ Time O(n) typical, Space O(n)
391
391
  ### deleteAt()
392
392
 
393
393
  ```ts
394
- deleteAt(index): boolean;
394
+ deleteAt(index): [K, V | undefined] | undefined;
395
395
  ```
396
396
 
397
- Defined in: [data-structures/hash/hash-map.ts:1076](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1076)
397
+ Defined in: [data-structures/hash/hash-map.ts:1203](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1203)
398
398
 
399
399
  Delete the entry at a given index.
400
400
 
@@ -408,9 +408,9 @@ Zero-based index.
408
408
 
409
409
  #### Returns
410
410
 
411
- `boolean`
411
+ \[`K`, `V` \| `undefined`\] \| `undefined`
412
412
 
413
- True if removed.
413
+ The removed entry [key, value], or undefined if the index is out of range.
414
414
 
415
415
  #### Remarks
416
416
 
@@ -424,7 +424,7 @@ Time O(N), Space O(1)
424
424
  deleteWhere(predicate): boolean;
425
425
  ```
426
426
 
427
- Defined in: [data-structures/hash/hash-map.ts:1050](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1050)
427
+ Defined in: [data-structures/hash/hash-map.ts:1177](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1177)
428
428
 
429
429
  Delete the first entry that matches a predicate.
430
430
 
@@ -454,7 +454,7 @@ Time O(N), Space O(1)
454
454
  entries(): IterableIterator<[K, V | undefined]>;
455
455
  ```
456
456
 
457
- Defined in: [data-structures/base/iterable-entry-base.ts:31](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L31)
457
+ Defined in: [data-structures/base/iterable-entry-base.ts:31](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L31)
458
458
 
459
459
  Iterate over `[key, value]` pairs (may yield `undefined` values).
460
460
 
@@ -480,7 +480,7 @@ Time O(n), Space O(1)
480
480
  every(predicate, thisArg?): boolean;
481
481
  ```
482
482
 
483
- Defined in: [data-structures/base/iterable-entry-base.ts:66](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L66)
483
+ Defined in: [data-structures/base/iterable-entry-base.ts:66](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L66)
484
484
 
485
485
  Test whether all entries satisfy the predicate.
486
486
 
@@ -494,7 +494,7 @@ Test whether all entries satisfy the predicate.
494
494
 
495
495
  ##### thisArg?
496
496
 
497
- `any`
497
+ `unknown`
498
498
 
499
499
  Optional `this` for callback.
500
500
 
@@ -517,10 +517,10 @@ Time O(n), Space O(1)
517
517
  ### filter()
518
518
 
519
519
  ```ts
520
- filter(predicate, thisArg?): any;
520
+ filter(predicate, thisArg?): this;
521
521
  ```
522
522
 
523
- Defined in: [data-structures/hash/hash-map.ts:1102](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1102)
523
+ Defined in: [data-structures/hash/hash-map.ts:1231](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1231)
524
524
 
525
525
  Filter entries and return the same-species structure.
526
526
 
@@ -532,11 +532,11 @@ Filter entries and return the same-species structure.
532
532
 
533
533
  ##### thisArg?
534
534
 
535
- `any`
535
+ `unknown`
536
536
 
537
537
  #### Returns
538
538
 
539
- `any`
539
+ `this`
540
540
 
541
541
  A new instance of the same concrete class (`this` type).
542
542
 
@@ -556,7 +556,7 @@ Time O(n), Space O(n)
556
556
  find(callbackfn, thisArg?): [K, V] | undefined;
557
557
  ```
558
558
 
559
- Defined in: [data-structures/base/iterable-entry-base.ts:114](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L114)
559
+ Defined in: [data-structures/base/iterable-entry-base.ts:114](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L114)
560
560
 
561
561
  Find the first entry that matches a predicate.
562
562
 
@@ -570,7 +570,7 @@ Find the first entry that matches a predicate.
570
570
 
571
571
  ##### thisArg?
572
572
 
573
- `any`
573
+ `unknown`
574
574
 
575
575
  Optional `this` for callback.
576
576
 
@@ -596,7 +596,7 @@ Time O(n), Space O(1)
596
596
  forEach(callbackfn, thisArg?): void;
597
597
  ```
598
598
 
599
- Defined in: [data-structures/base/iterable-entry-base.ts:99](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L99)
599
+ Defined in: [data-structures/base/iterable-entry-base.ts:99](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L99)
600
600
 
601
601
  Visit each entry, left-to-right.
602
602
 
@@ -610,7 +610,7 @@ Visit each entry, left-to-right.
610
610
 
611
611
  ##### thisArg?
612
612
 
613
- `any`
613
+ `unknown`
614
614
 
615
615
  Optional `this` for callback.
616
616
 
@@ -634,7 +634,7 @@ Time O(n), Space O(1)
634
634
  get(key): V | undefined;
635
635
  ```
636
636
 
637
- Defined in: [data-structures/hash/hash-map.ts:1004](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1004)
637
+ Defined in: [data-structures/hash/hash-map.ts:1131](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1131)
638
638
 
639
639
  Get the value under a key.
640
640
 
@@ -668,7 +668,7 @@ Time O(n) generic, Space O(1)
668
668
  has(key): boolean;
669
669
  ```
670
670
 
671
- Defined in: [data-structures/hash/hash-map.ts:995](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L995)
671
+ Defined in: [data-structures/hash/hash-map.ts:1122](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1122)
672
672
 
673
673
  Whether the given key exists.
674
674
 
@@ -702,7 +702,7 @@ Time O(n) generic, Space O(1)
702
702
  hasValue(value): boolean;
703
703
  ```
704
704
 
705
- Defined in: [data-structures/base/iterable-entry-base.ts:143](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L143)
705
+ Defined in: [data-structures/base/iterable-entry-base.ts:143](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L143)
706
706
 
707
707
  Whether there exists an entry with the given value.
708
708
 
@@ -736,7 +736,7 @@ Time O(n), Space O(1)
736
736
  isEmpty(): boolean;
737
737
  ```
738
738
 
739
- Defined in: [data-structures/hash/hash-map.ts:1083](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1083)
739
+ Defined in: [data-structures/hash/hash-map.ts:1212](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1212)
740
740
 
741
741
  Whether there are no entries.
742
742
 
@@ -762,7 +762,7 @@ Time O(1) typical, Space O(1)
762
762
  keys(): IterableIterator<K>;
763
763
  ```
764
764
 
765
- Defined in: [data-structures/base/iterable-entry-base.ts:42](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L42)
765
+ Defined in: [data-structures/base/iterable-entry-base.ts:42](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L42)
766
766
 
767
767
  Iterate over keys only.
768
768
 
@@ -785,10 +785,10 @@ Time O(n), Space O(1)
785
785
  ### map()
786
786
 
787
787
  ```ts
788
- map<MK, MV>(callback, thisArg?): any;
788
+ map<MK, MV>(callback, thisArg?): LinkedHashMap<MK, MV>;
789
789
  ```
790
790
 
791
- Defined in: [data-structures/hash/hash-map.ts:1121](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1121)
791
+ Defined in: [data-structures/hash/hash-map.ts:1250](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1250)
792
792
 
793
793
  Map each entry to a new [key, value] pair and preserve order.
794
794
 
@@ -812,13 +812,13 @@ Mapping function (key, value, index, map) → [newKey, newValue].
812
812
 
813
813
  ##### thisArg?
814
814
 
815
- `any`
815
+ `unknown`
816
816
 
817
817
  Value for `this` inside the callback.
818
818
 
819
819
  #### Returns
820
820
 
821
- `any`
821
+ `LinkedHashMap`\<`MK`, `MV`\>
822
822
 
823
823
  A new map of the same class with transformed entries.
824
824
 
@@ -838,7 +838,7 @@ Time O(N), Space O(N)
838
838
  print(): void;
839
839
  ```
840
840
 
841
- Defined in: [data-structures/base/iterable-entry-base.ts:203](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L203)
841
+ Defined in: [data-structures/base/iterable-entry-base.ts:203](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L203)
842
842
 
843
843
  Print a human-friendly representation to the console.
844
844
 
@@ -862,7 +862,7 @@ Time O(n), Space O(n)
862
862
  reduce<U>(callbackfn, initialValue): U;
863
863
  ```
864
864
 
865
- Defined in: [data-structures/base/iterable-entry-base.ts:171](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L171)
865
+ Defined in: [data-structures/base/iterable-entry-base.ts:171](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L171)
866
866
 
867
867
  Reduce entries into a single accumulator.
868
868
 
@@ -908,7 +908,7 @@ Time O(n), Space O(1)
908
908
  reverseBegin(): Generator<(K | V | undefined)[], void, unknown>;
909
909
  ```
910
910
 
911
- Defined in: [data-structures/hash/hash-map.ts:930](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L930)
911
+ Defined in: [data-structures/hash/hash-map.ts:1053](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1053)
912
912
 
913
913
  Iterate from tail → head.
914
914
 
@@ -927,10 +927,10 @@ Time O(N), Space O(1)
927
927
  ### set()
928
928
 
929
929
  ```ts
930
- set(key, value?): boolean;
930
+ set(key, value?): this;
931
931
  ```
932
932
 
933
- Defined in: [data-structures/hash/hash-map.ts:945](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L945)
933
+ Defined in: [data-structures/hash/hash-map.ts:1068](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1068)
934
934
 
935
935
  Insert or replace a single entry; preserves insertion order.
936
936
 
@@ -950,9 +950,9 @@ Value.
950
950
 
951
951
  #### Returns
952
952
 
953
- `boolean`
953
+ `this`
954
954
 
955
- True when the operation succeeds.
955
+ This map (for chaining).
956
956
 
957
957
  #### Remarks
958
958
 
@@ -966,7 +966,7 @@ Time O(1), Space O(1)
966
966
  some(predicate, thisArg?): boolean;
967
967
  ```
968
968
 
969
- Defined in: [data-structures/base/iterable-entry-base.ts:83](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L83)
969
+ Defined in: [data-structures/base/iterable-entry-base.ts:83](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L83)
970
970
 
971
971
  Test whether any entry satisfies the predicate.
972
972
 
@@ -980,7 +980,7 @@ Test whether any entry satisfies the predicate.
980
980
 
981
981
  ##### thisArg?
982
982
 
983
- `any`
983
+ `unknown`
984
984
 
985
985
  Optional `this` for callback.
986
986
 
@@ -1006,7 +1006,7 @@ Time O(n), Space O(1)
1006
1006
  toArray(): [K, V][];
1007
1007
  ```
1008
1008
 
1009
- Defined in: [data-structures/base/iterable-entry-base.ts:186](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L186)
1009
+ Defined in: [data-structures/base/iterable-entry-base.ts:186](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L186)
1010
1010
 
1011
1011
  Converts data structure to `[key, value]` pairs.
1012
1012
 
@@ -1032,7 +1032,7 @@ Time O(n), Space O(n)
1032
1032
  toVisual(): string | [K, V][];
1033
1033
  ```
1034
1034
 
1035
- Defined in: [data-structures/base/iterable-entry-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L195)
1035
+ Defined in: [data-structures/base/iterable-entry-base.ts:195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L195)
1036
1036
 
1037
1037
  Visualize the iterable as an array of `[key, value]` pairs (or a custom string).
1038
1038
 
@@ -1058,7 +1058,7 @@ Time O(n), Space O(n)
1058
1058
  values(): IterableIterator<V>;
1059
1059
  ```
1060
1060
 
1061
- Defined in: [data-structures/base/iterable-entry-base.ts:53](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/iterable-entry-base.ts#L53)
1061
+ Defined in: [data-structures/base/iterable-entry-base.ts:53](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L53)
1062
1062
 
1063
1063
  Iterate over values only.
1064
1064
 
@@ -1087,7 +1087,7 @@ Time O(n), Space O(1)
1087
1087
  protected _getIterator(): IterableIterator<[K, V]>;
1088
1088
  ```
1089
1089
 
1090
- Defined in: [data-structures/hash/hash-map.ts:1132](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/hash/hash-map.ts#L1132)
1090
+ Defined in: [data-structures/hash/hash-map.ts:1261](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/hash/hash-map.ts#L1261)
1091
1091
 
1092
1092
  Underlying iterator for the default iteration protocol.
1093
1093
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: LinkedListNode\<E\>
8
8
 
9
- Defined in: [data-structures/base/linear-base.ts:9](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L9)
9
+ Defined in: [data-structures/base/linear-base.ts:9](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L9)
10
10
 
11
11
  Singly-linked list node.
12
12
 
@@ -35,7 +35,7 @@ Element type.
35
35
  new LinkedListNode<E>(value): LinkedListNode<E>;
36
36
  ```
37
37
 
38
- Defined in: [data-structures/base/linear-base.ts:15](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L15)
38
+ Defined in: [data-structures/base/linear-base.ts:15](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L15)
39
39
 
40
40
  Initialize a node.
41
41
 
@@ -65,7 +65,7 @@ Time O(1), Space O(1)
65
65
  get next(): LinkedListNode<E> | undefined;
66
66
  ```
67
67
 
68
- Defined in: [data-structures/base/linear-base.ts:47](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L47)
68
+ Defined in: [data-structures/base/linear-base.ts:47](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L47)
69
69
 
70
70
  Next node getter.
71
71
 
@@ -85,7 +85,7 @@ Next node or `undefined`.
85
85
  set next(value): void;
86
86
  ```
87
87
 
88
- Defined in: [data-structures/base/linear-base.ts:56](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L56)
88
+ Defined in: [data-structures/base/linear-base.ts:56](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L56)
89
89
 
90
90
  Next node setter.
91
91
 
@@ -115,7 +115,7 @@ Next node or `undefined`.
115
115
  get value(): E;
116
116
  ```
117
117
 
118
- Defined in: [data-structures/base/linear-base.ts:27](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L27)
118
+ Defined in: [data-structures/base/linear-base.ts:27](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L27)
119
119
 
120
120
  Element payload getter.
121
121
 
@@ -135,7 +135,7 @@ Element value.
135
135
  set value(value): void;
136
136
  ```
137
137
 
138
- Defined in: [data-structures/base/linear-base.ts:36](https://github.com/zrwusa/data-structure-typed/blob/2f6ceb3aee852228efc88b111e19c0809753e805/src/data-structures/base/linear-base.ts#L36)
138
+ Defined in: [data-structures/base/linear-base.ts:36](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/linear-base.ts#L36)
139
139
 
140
140
  Element payload setter.
141
141