data-structure-typed 1.54.0 → 1.54.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 (488) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +1 -0
  3. package/benchmark/report.html +1 -28
  4. package/benchmark/report.json +17 -326
  5. package/dist/{mjs/data-structures/binary-tree/avl-tree-multi-map.d.ts → cjs/data-structures/binary-tree/avl-tree-counter.d.ts} +54 -47
  6. package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +408 -0
  7. package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
  8. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -177
  9. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +135 -340
  10. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
  11. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +102 -57
  12. package/dist/cjs/data-structures/binary-tree/avl-tree.js +110 -47
  13. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  14. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
  15. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  16. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -1
  17. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +240 -190
  18. package/dist/cjs/data-structures/binary-tree/binary-tree.js +269 -240
  19. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  20. package/dist/cjs/data-structures/binary-tree/bst.d.ts +145 -112
  21. package/dist/cjs/data-structures/binary-tree/bst.js +180 -129
  22. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  23. package/dist/cjs/data-structures/binary-tree/index.d.ts +2 -0
  24. package/dist/cjs/data-structures/binary-tree/index.js +2 -0
  25. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -1
  26. package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +100 -82
  27. package/dist/cjs/data-structures/binary-tree/red-black-tree.js +115 -79
  28. package/dist/cjs/data-structures/binary-tree/red-black-tree.js.map +1 -1
  29. package/dist/{mjs/data-structures/binary-tree/tree-multi-map.d.ts → cjs/data-structures/binary-tree/tree-counter.d.ts} +74 -64
  30. package/dist/cjs/data-structures/binary-tree/tree-counter.js +445 -0
  31. package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +1 -0
  32. package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +78 -174
  33. package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +142 -377
  34. package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
  35. package/dist/cjs/data-structures/graph/directed-graph.d.ts +3 -0
  36. package/dist/cjs/data-structures/graph/directed-graph.js +3 -0
  37. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
  38. package/dist/cjs/data-structures/graph/map-graph.d.ts +3 -0
  39. package/dist/cjs/data-structures/graph/map-graph.js +3 -0
  40. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -1
  41. package/dist/cjs/data-structures/graph/undirected-graph.d.ts +3 -0
  42. package/dist/cjs/data-structures/graph/undirected-graph.js +3 -0
  43. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
  44. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +3 -0
  45. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +3 -0
  46. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  47. package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +3 -0
  48. package/dist/cjs/data-structures/linked-list/skip-linked-list.js +3 -0
  49. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
  50. package/dist/cjs/data-structures/matrix/matrix.d.ts +3 -0
  51. package/dist/cjs/data-structures/matrix/matrix.js +3 -0
  52. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -1
  53. package/dist/cjs/data-structures/matrix/navigator.d.ts +3 -0
  54. package/dist/cjs/data-structures/matrix/navigator.js +3 -0
  55. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -1
  56. package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
  57. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +3 -0
  58. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  59. package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
  60. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +3 -0
  61. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  62. package/dist/cjs/data-structures/trie/trie.d.ts +0 -4
  63. package/dist/cjs/data-structures/trie/trie.js +0 -4
  64. package/dist/cjs/data-structures/trie/trie.js.map +1 -1
  65. package/dist/cjs/interfaces/binary-tree.d.ts +8 -8
  66. package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  67. package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js +3 -0
  68. package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
  69. package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -4
  70. package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +0 -3
  71. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +0 -3
  72. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +3 -3
  73. package/dist/cjs/types/data-structures/binary-tree/index.d.ts +2 -0
  74. package/dist/cjs/types/data-structures/binary-tree/index.js +2 -0
  75. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -1
  76. package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -4
  77. package/dist/cjs/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  78. package/dist/cjs/types/data-structures/binary-tree/tree-counter.js +3 -0
  79. package/dist/cjs/types/data-structures/binary-tree/tree-counter.js.map +1 -0
  80. package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -4
  81. package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
  82. package/dist/{mjs/data-structures/binary-tree/avl-tree-multi-map.js → esm/data-structures/binary-tree/avl-tree-counter.js} +73 -60
  83. package/dist/esm/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
  84. package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -0
  85. package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +191 -0
  86. package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -0
  87. package/dist/esm/data-structures/binary-tree/avl-tree.d.ts +234 -0
  88. package/dist/{mjs → esm}/data-structures/binary-tree/avl-tree.js +110 -47
  89. package/dist/esm/data-structures/binary-tree/avl-tree.js.map +1 -0
  90. package/dist/{mjs → esm}/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
  91. package/dist/{mjs → esm}/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  92. package/dist/esm/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  93. package/dist/{mjs → esm}/data-structures/binary-tree/binary-tree.d.ts +240 -190
  94. package/dist/{mjs → esm}/data-structures/binary-tree/binary-tree.js +272 -245
  95. package/dist/esm/data-structures/binary-tree/binary-tree.js.map +1 -0
  96. package/dist/{mjs → esm}/data-structures/binary-tree/bst.d.ts +145 -112
  97. package/dist/{mjs → esm}/data-structures/binary-tree/bst.js +201 -155
  98. package/dist/esm/data-structures/binary-tree/bst.js.map +1 -0
  99. package/dist/{mjs → esm}/data-structures/binary-tree/index.d.ts +2 -0
  100. package/dist/{mjs → esm}/data-structures/binary-tree/index.js +2 -0
  101. package/dist/{mjs → esm}/data-structures/binary-tree/index.js.map +1 -1
  102. package/dist/{mjs → esm}/data-structures/binary-tree/red-black-tree.d.ts +100 -82
  103. package/dist/{mjs → esm}/data-structures/binary-tree/red-black-tree.js +115 -79
  104. package/dist/esm/data-structures/binary-tree/red-black-tree.js.map +1 -0
  105. package/dist/esm/data-structures/binary-tree/tree-counter.d.ts +212 -0
  106. package/dist/{mjs/data-structures/binary-tree/tree-multi-map.js → esm/data-structures/binary-tree/tree-counter.js} +111 -96
  107. package/dist/esm/data-structures/binary-tree/tree-counter.js.map +1 -0
  108. package/dist/esm/data-structures/binary-tree/tree-multi-map.d.ts +106 -0
  109. package/dist/esm/data-structures/binary-tree/tree-multi-map.js +196 -0
  110. package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +1 -0
  111. package/dist/{mjs → esm}/data-structures/graph/directed-graph.d.ts +3 -0
  112. package/dist/{mjs → esm}/data-structures/graph/directed-graph.js +3 -0
  113. package/dist/esm/data-structures/graph/directed-graph.js.map +1 -0
  114. package/dist/{mjs → esm}/data-structures/graph/map-graph.d.ts +3 -0
  115. package/dist/{mjs → esm}/data-structures/graph/map-graph.js +3 -0
  116. package/dist/esm/data-structures/graph/map-graph.js.map +1 -0
  117. package/dist/{mjs → esm}/data-structures/graph/undirected-graph.d.ts +3 -0
  118. package/dist/{mjs → esm}/data-structures/graph/undirected-graph.js +3 -0
  119. package/dist/esm/data-structures/graph/undirected-graph.js.map +1 -0
  120. package/dist/{mjs → esm}/data-structures/linked-list/singly-linked-list.d.ts +3 -0
  121. package/dist/{mjs → esm}/data-structures/linked-list/singly-linked-list.js +3 -0
  122. package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -0
  123. package/dist/{mjs → esm}/data-structures/linked-list/skip-linked-list.d.ts +3 -0
  124. package/dist/{mjs → esm}/data-structures/linked-list/skip-linked-list.js +3 -0
  125. package/dist/esm/data-structures/linked-list/skip-linked-list.js.map +1 -0
  126. package/dist/{mjs → esm}/data-structures/matrix/matrix.d.ts +3 -0
  127. package/dist/{mjs → esm}/data-structures/matrix/matrix.js +3 -0
  128. package/dist/esm/data-structures/matrix/matrix.js.map +1 -0
  129. package/dist/{mjs → esm}/data-structures/matrix/navigator.d.ts +3 -0
  130. package/dist/{mjs → esm}/data-structures/matrix/navigator.js +3 -0
  131. package/dist/esm/data-structures/matrix/navigator.js.map +1 -0
  132. package/dist/{mjs → esm}/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
  133. package/dist/{mjs → esm}/data-structures/priority-queue/max-priority-queue.js +3 -0
  134. package/dist/esm/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  135. package/dist/{mjs → esm}/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
  136. package/dist/{mjs → esm}/data-structures/priority-queue/min-priority-queue.js +3 -0
  137. package/dist/esm/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  138. package/dist/{mjs → esm}/data-structures/trie/trie.d.ts +0 -4
  139. package/dist/{mjs → esm}/data-structures/trie/trie.js +0 -4
  140. package/dist/esm/data-structures/trie/trie.js.map +1 -0
  141. package/dist/esm/interfaces/binary-tree.d.ts +9 -0
  142. package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  143. package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js +2 -0
  144. package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
  145. package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -0
  146. package/dist/esm/types/data-structures/binary-tree/avl-tree.d.ts +2 -0
  147. package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.d.ts +0 -3
  148. package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.d.ts +3 -3
  149. package/dist/{mjs → esm}/types/data-structures/binary-tree/index.d.ts +2 -0
  150. package/dist/{mjs → esm}/types/data-structures/binary-tree/index.js +2 -0
  151. package/dist/{mjs → esm}/types/data-structures/binary-tree/index.js.map +1 -1
  152. package/dist/esm/types/data-structures/binary-tree/rb-tree.d.ts +3 -0
  153. package/dist/esm/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  154. package/dist/esm/types/data-structures/binary-tree/tree-counter.js +2 -0
  155. package/dist/esm/types/data-structures/binary-tree/tree-counter.js.map +1 -0
  156. package/dist/esm/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -0
  157. package/dist/umd/data-structure-typed.js +1464 -895
  158. package/dist/umd/data-structure-typed.min.js +5 -5
  159. package/dist/umd/data-structure-typed.min.js.map +1 -1
  160. package/package.json +14 -14
  161. package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
  162. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +155 -393
  163. package/src/data-structures/binary-tree/avl-tree.ts +144 -93
  164. package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
  165. package/src/data-structures/binary-tree/binary-tree.ts +433 -405
  166. package/src/data-structures/binary-tree/bst.ts +261 -239
  167. package/src/data-structures/binary-tree/index.ts +2 -0
  168. package/src/data-structures/binary-tree/red-black-tree.ts +163 -134
  169. package/src/data-structures/binary-tree/tree-counter.ts +504 -0
  170. package/src/data-structures/binary-tree/tree-multi-map.ts +161 -429
  171. package/src/data-structures/graph/directed-graph.ts +3 -0
  172. package/src/data-structures/graph/map-graph.ts +3 -0
  173. package/src/data-structures/graph/undirected-graph.ts +3 -0
  174. package/src/data-structures/linked-list/singly-linked-list.ts +3 -0
  175. package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
  176. package/src/data-structures/matrix/matrix.ts +3 -0
  177. package/src/data-structures/matrix/navigator.ts +3 -0
  178. package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
  179. package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
  180. package/src/data-structures/trie/trie.ts +0 -4
  181. package/src/interfaces/binary-tree.ts +10 -24
  182. package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
  183. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -6
  184. package/src/types/data-structures/binary-tree/avl-tree.ts +0 -5
  185. package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
  186. package/src/types/data-structures/binary-tree/bst.ts +5 -5
  187. package/src/types/data-structures/binary-tree/index.ts +2 -0
  188. package/src/types/data-structures/binary-tree/rb-tree.ts +1 -6
  189. package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
  190. package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -6
  191. package/test/integration/all-in-one.test.ts +1 -1
  192. package/test/integration/avl-tree.test.ts +1 -1
  193. package/test/integration/bst.test.ts +2 -2
  194. package/test/integration/compile.js +144 -0
  195. package/test/integration/compile.ts +171 -0
  196. package/test/integration/index.html +48 -48
  197. package/test/performance/data-structures/binary-tree/avl-tree.test.ts +4 -4
  198. package/test/performance/data-structures/binary-tree/rb-tree.test.ts +5 -4
  199. package/test/performance/data-structures/comparison/comparison.test.ts +2 -2
  200. package/test/performance/reportor.ts +5 -3
  201. package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +877 -0
  202. package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +459 -761
  203. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +223 -223
  204. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +474 -492
  205. package/test/unit/data-structures/binary-tree/bst.test.ts +1 -1
  206. package/test/unit/data-structures/binary-tree/overall.test.ts +0 -3
  207. package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +87 -90
  208. package/test/unit/data-structures/binary-tree/tree-counter.test.ts +975 -0
  209. package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +729 -857
  210. package/test/unit/data-structures/hash/hash-map.test.ts +1 -1
  211. package/{tsconfig-mjs.json → tsconfig-esm.json} +1 -1
  212. package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
  213. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +0 -189
  214. package/dist/mjs/data-structures/binary-tree/avl-tree.js.map +0 -1
  215. package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  216. package/dist/mjs/data-structures/binary-tree/binary-tree.js.map +0 -1
  217. package/dist/mjs/data-structures/binary-tree/bst.js.map +0 -1
  218. package/dist/mjs/data-structures/binary-tree/red-black-tree.js.map +0 -1
  219. package/dist/mjs/data-structures/binary-tree/tree-multi-map.js.map +0 -1
  220. package/dist/mjs/data-structures/graph/directed-graph.js.map +0 -1
  221. package/dist/mjs/data-structures/graph/map-graph.js.map +0 -1
  222. package/dist/mjs/data-structures/graph/undirected-graph.js.map +0 -1
  223. package/dist/mjs/data-structures/linked-list/singly-linked-list.js.map +0 -1
  224. package/dist/mjs/data-structures/linked-list/skip-linked-list.js.map +0 -1
  225. package/dist/mjs/data-structures/matrix/matrix.js.map +0 -1
  226. package/dist/mjs/data-structures/matrix/navigator.js.map +0 -1
  227. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  228. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  229. package/dist/mjs/data-structures/trie/trie.js.map +0 -1
  230. package/dist/mjs/interfaces/binary-tree.d.ts +0 -9
  231. package/dist/mjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -5
  232. package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +0 -5
  233. package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +0 -6
  234. package/dist/mjs/types/data-structures/binary-tree/tree-multi-map.d.ts +0 -5
  235. /package/dist/{mjs → esm}/common/index.d.ts +0 -0
  236. /package/dist/{mjs → esm}/common/index.js +0 -0
  237. /package/dist/{mjs → esm}/common/index.js.map +0 -0
  238. /package/dist/{mjs → esm}/data-structures/base/index.d.ts +0 -0
  239. /package/dist/{mjs → esm}/data-structures/base/index.js +0 -0
  240. /package/dist/{mjs → esm}/data-structures/base/index.js.map +0 -0
  241. /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.d.ts +0 -0
  242. /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.js +0 -0
  243. /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.js.map +0 -0
  244. /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.d.ts +0 -0
  245. /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.js +0 -0
  246. /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.js.map +0 -0
  247. /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  248. /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.js +0 -0
  249. /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.js.map +0 -0
  250. /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.d.ts +0 -0
  251. /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.js +0 -0
  252. /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.js.map +0 -0
  253. /package/dist/{mjs → esm}/data-structures/graph/index.d.ts +0 -0
  254. /package/dist/{mjs → esm}/data-structures/graph/index.js +0 -0
  255. /package/dist/{mjs → esm}/data-structures/graph/index.js.map +0 -0
  256. /package/dist/{mjs → esm}/data-structures/hash/hash-map.d.ts +0 -0
  257. /package/dist/{mjs → esm}/data-structures/hash/hash-map.js +0 -0
  258. /package/dist/{mjs → esm}/data-structures/hash/hash-map.js.map +0 -0
  259. /package/dist/{mjs → esm}/data-structures/hash/index.d.ts +0 -0
  260. /package/dist/{mjs → esm}/data-structures/hash/index.js +0 -0
  261. /package/dist/{mjs → esm}/data-structures/hash/index.js.map +0 -0
  262. /package/dist/{mjs → esm}/data-structures/heap/heap.d.ts +0 -0
  263. /package/dist/{mjs → esm}/data-structures/heap/heap.js +0 -0
  264. /package/dist/{mjs → esm}/data-structures/heap/heap.js.map +0 -0
  265. /package/dist/{mjs → esm}/data-structures/heap/index.d.ts +0 -0
  266. /package/dist/{mjs → esm}/data-structures/heap/index.js +0 -0
  267. /package/dist/{mjs → esm}/data-structures/heap/index.js.map +0 -0
  268. /package/dist/{mjs → esm}/data-structures/heap/max-heap.d.ts +0 -0
  269. /package/dist/{mjs → esm}/data-structures/heap/max-heap.js +0 -0
  270. /package/dist/{mjs → esm}/data-structures/heap/max-heap.js.map +0 -0
  271. /package/dist/{mjs → esm}/data-structures/heap/min-heap.d.ts +0 -0
  272. /package/dist/{mjs → esm}/data-structures/heap/min-heap.js +0 -0
  273. /package/dist/{mjs → esm}/data-structures/heap/min-heap.js.map +0 -0
  274. /package/dist/{mjs → esm}/data-structures/index.d.ts +0 -0
  275. /package/dist/{mjs → esm}/data-structures/index.js +0 -0
  276. /package/dist/{mjs → esm}/data-structures/index.js.map +0 -0
  277. /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  278. /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.js +0 -0
  279. /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.js.map +0 -0
  280. /package/dist/{mjs → esm}/data-structures/linked-list/index.d.ts +0 -0
  281. /package/dist/{mjs → esm}/data-structures/linked-list/index.js +0 -0
  282. /package/dist/{mjs → esm}/data-structures/linked-list/index.js.map +0 -0
  283. /package/dist/{mjs → esm}/data-structures/matrix/index.d.ts +0 -0
  284. /package/dist/{mjs → esm}/data-structures/matrix/index.js +0 -0
  285. /package/dist/{mjs → esm}/data-structures/matrix/index.js.map +0 -0
  286. /package/dist/{mjs → esm}/data-structures/priority-queue/index.d.ts +0 -0
  287. /package/dist/{mjs → esm}/data-structures/priority-queue/index.js +0 -0
  288. /package/dist/{mjs → esm}/data-structures/priority-queue/index.js.map +0 -0
  289. /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  290. /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.js +0 -0
  291. /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.js.map +0 -0
  292. /package/dist/{mjs → esm}/data-structures/queue/deque.d.ts +0 -0
  293. /package/dist/{mjs → esm}/data-structures/queue/deque.js +0 -0
  294. /package/dist/{mjs → esm}/data-structures/queue/deque.js.map +0 -0
  295. /package/dist/{mjs → esm}/data-structures/queue/index.d.ts +0 -0
  296. /package/dist/{mjs → esm}/data-structures/queue/index.js +0 -0
  297. /package/dist/{mjs → esm}/data-structures/queue/index.js.map +0 -0
  298. /package/dist/{mjs → esm}/data-structures/queue/queue.d.ts +0 -0
  299. /package/dist/{mjs → esm}/data-structures/queue/queue.js +0 -0
  300. /package/dist/{mjs → esm}/data-structures/queue/queue.js.map +0 -0
  301. /package/dist/{mjs → esm}/data-structures/stack/index.d.ts +0 -0
  302. /package/dist/{mjs → esm}/data-structures/stack/index.js +0 -0
  303. /package/dist/{mjs → esm}/data-structures/stack/index.js.map +0 -0
  304. /package/dist/{mjs → esm}/data-structures/stack/stack.d.ts +0 -0
  305. /package/dist/{mjs → esm}/data-structures/stack/stack.js +0 -0
  306. /package/dist/{mjs → esm}/data-structures/stack/stack.js.map +0 -0
  307. /package/dist/{mjs → esm}/data-structures/tree/index.d.ts +0 -0
  308. /package/dist/{mjs → esm}/data-structures/tree/index.js +0 -0
  309. /package/dist/{mjs → esm}/data-structures/tree/index.js.map +0 -0
  310. /package/dist/{mjs → esm}/data-structures/tree/tree.d.ts +0 -0
  311. /package/dist/{mjs → esm}/data-structures/tree/tree.js +0 -0
  312. /package/dist/{mjs → esm}/data-structures/tree/tree.js.map +0 -0
  313. /package/dist/{mjs → esm}/data-structures/trie/index.d.ts +0 -0
  314. /package/dist/{mjs → esm}/data-structures/trie/index.js +0 -0
  315. /package/dist/{mjs → esm}/data-structures/trie/index.js.map +0 -0
  316. /package/dist/{mjs → esm}/index.d.ts +0 -0
  317. /package/dist/{mjs → esm}/index.js +0 -0
  318. /package/dist/{mjs → esm}/index.js.map +0 -0
  319. /package/dist/{mjs → esm}/interfaces/binary-tree.js +0 -0
  320. /package/dist/{mjs → esm}/interfaces/binary-tree.js.map +0 -0
  321. /package/dist/{mjs → esm}/interfaces/doubly-linked-list.d.ts +0 -0
  322. /package/dist/{mjs → esm}/interfaces/doubly-linked-list.js +0 -0
  323. /package/dist/{mjs → esm}/interfaces/doubly-linked-list.js.map +0 -0
  324. /package/dist/{mjs → esm}/interfaces/graph.d.ts +0 -0
  325. /package/dist/{mjs → esm}/interfaces/graph.js +0 -0
  326. /package/dist/{mjs → esm}/interfaces/graph.js.map +0 -0
  327. /package/dist/{mjs → esm}/interfaces/heap.d.ts +0 -0
  328. /package/dist/{mjs → esm}/interfaces/heap.js +0 -0
  329. /package/dist/{mjs → esm}/interfaces/heap.js.map +0 -0
  330. /package/dist/{mjs → esm}/interfaces/index.d.ts +0 -0
  331. /package/dist/{mjs → esm}/interfaces/index.js +0 -0
  332. /package/dist/{mjs → esm}/interfaces/index.js.map +0 -0
  333. /package/dist/{mjs → esm}/interfaces/navigator.d.ts +0 -0
  334. /package/dist/{mjs → esm}/interfaces/navigator.js +0 -0
  335. /package/dist/{mjs → esm}/interfaces/navigator.js.map +0 -0
  336. /package/dist/{mjs → esm}/interfaces/priority-queue.d.ts +0 -0
  337. /package/dist/{mjs → esm}/interfaces/priority-queue.js +0 -0
  338. /package/dist/{mjs → esm}/interfaces/priority-queue.js.map +0 -0
  339. /package/dist/{mjs → esm}/interfaces/segment-tree.d.ts +0 -0
  340. /package/dist/{mjs → esm}/interfaces/segment-tree.js +0 -0
  341. /package/dist/{mjs → esm}/interfaces/segment-tree.js.map +0 -0
  342. /package/dist/{mjs → esm}/interfaces/singly-linked-list.d.ts +0 -0
  343. /package/dist/{mjs → esm}/interfaces/singly-linked-list.js +0 -0
  344. /package/dist/{mjs → esm}/interfaces/singly-linked-list.js.map +0 -0
  345. /package/dist/{mjs → esm}/types/common.d.ts +0 -0
  346. /package/dist/{mjs → esm}/types/common.js +0 -0
  347. /package/dist/{mjs → esm}/types/common.js.map +0 -0
  348. /package/dist/{mjs → esm}/types/data-structures/base/base.d.ts +0 -0
  349. /package/dist/{mjs → esm}/types/data-structures/base/base.js +0 -0
  350. /package/dist/{mjs → esm}/types/data-structures/base/base.js.map +0 -0
  351. /package/dist/{mjs → esm}/types/data-structures/base/index.d.ts +0 -0
  352. /package/dist/{mjs → esm}/types/data-structures/base/index.js +0 -0
  353. /package/dist/{mjs → esm}/types/data-structures/base/index.js.map +0 -0
  354. /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree-multi-map.js +0 -0
  355. /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -0
  356. /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree.js +0 -0
  357. /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree.js.map +0 -0
  358. /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  359. /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  360. /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -0
  361. /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.js +0 -0
  362. /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.js.map +0 -0
  363. /package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.js +0 -0
  364. /package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.js.map +0 -0
  365. /package/dist/{mjs → esm}/types/data-structures/binary-tree/rb-tree.js +0 -0
  366. /package/dist/{mjs → esm}/types/data-structures/binary-tree/rb-tree.js.map +0 -0
  367. /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
  368. /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.js +0 -0
  369. /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.js.map +0 -0
  370. /package/dist/{mjs → esm}/types/data-structures/binary-tree/tree-multi-map.js +0 -0
  371. /package/dist/{mjs → esm}/types/data-structures/binary-tree/tree-multi-map.js.map +0 -0
  372. /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.d.ts +0 -0
  373. /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.js +0 -0
  374. /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.js.map +0 -0
  375. /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.d.ts +0 -0
  376. /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.js +0 -0
  377. /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.js.map +0 -0
  378. /package/dist/{mjs → esm}/types/data-structures/graph/index.d.ts +0 -0
  379. /package/dist/{mjs → esm}/types/data-structures/graph/index.js +0 -0
  380. /package/dist/{mjs → esm}/types/data-structures/graph/index.js.map +0 -0
  381. /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.d.ts +0 -0
  382. /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.js +0 -0
  383. /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.js.map +0 -0
  384. /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.d.ts +0 -0
  385. /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.js +0 -0
  386. /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.js.map +0 -0
  387. /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.d.ts +0 -0
  388. /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.js +0 -0
  389. /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.js.map +0 -0
  390. /package/dist/{mjs → esm}/types/data-structures/hash/index.d.ts +0 -0
  391. /package/dist/{mjs → esm}/types/data-structures/hash/index.js +0 -0
  392. /package/dist/{mjs → esm}/types/data-structures/hash/index.js.map +0 -0
  393. /package/dist/{mjs → esm}/types/data-structures/heap/heap.d.ts +0 -0
  394. /package/dist/{mjs → esm}/types/data-structures/heap/heap.js +0 -0
  395. /package/dist/{mjs → esm}/types/data-structures/heap/heap.js.map +0 -0
  396. /package/dist/{mjs → esm}/types/data-structures/heap/index.d.ts +0 -0
  397. /package/dist/{mjs → esm}/types/data-structures/heap/index.js +0 -0
  398. /package/dist/{mjs → esm}/types/data-structures/heap/index.js.map +0 -0
  399. /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.d.ts +0 -0
  400. /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.js +0 -0
  401. /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.js.map +0 -0
  402. /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.d.ts +0 -0
  403. /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.js +0 -0
  404. /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.js.map +0 -0
  405. /package/dist/{mjs → esm}/types/data-structures/index.d.ts +0 -0
  406. /package/dist/{mjs → esm}/types/data-structures/index.js +0 -0
  407. /package/dist/{mjs → esm}/types/data-structures/index.js.map +0 -0
  408. /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  409. /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.js +0 -0
  410. /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.js.map +0 -0
  411. /package/dist/{mjs → esm}/types/data-structures/linked-list/index.d.ts +0 -0
  412. /package/dist/{mjs → esm}/types/data-structures/linked-list/index.js +0 -0
  413. /package/dist/{mjs → esm}/types/data-structures/linked-list/index.js.map +0 -0
  414. /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  415. /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.js +0 -0
  416. /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.js.map +0 -0
  417. /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  418. /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.js +0 -0
  419. /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.js.map +0 -0
  420. /package/dist/{mjs → esm}/types/data-structures/matrix/index.d.ts +0 -0
  421. /package/dist/{mjs → esm}/types/data-structures/matrix/index.js +0 -0
  422. /package/dist/{mjs → esm}/types/data-structures/matrix/index.js.map +0 -0
  423. /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.d.ts +0 -0
  424. /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.js +0 -0
  425. /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.js.map +0 -0
  426. /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.d.ts +0 -0
  427. /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.js +0 -0
  428. /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.js.map +0 -0
  429. /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.d.ts +0 -0
  430. /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.js +0 -0
  431. /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.js.map +0 -0
  432. /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  433. /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.js +0 -0
  434. /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.js.map +0 -0
  435. /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  436. /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.js +0 -0
  437. /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.js.map +0 -0
  438. /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
  439. /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.js +0 -0
  440. /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.js.map +0 -0
  441. /package/dist/{mjs → esm}/types/data-structures/queue/deque.d.ts +0 -0
  442. /package/dist/{mjs → esm}/types/data-structures/queue/deque.js +0 -0
  443. /package/dist/{mjs → esm}/types/data-structures/queue/deque.js.map +0 -0
  444. /package/dist/{mjs → esm}/types/data-structures/queue/index.d.ts +0 -0
  445. /package/dist/{mjs → esm}/types/data-structures/queue/index.js +0 -0
  446. /package/dist/{mjs → esm}/types/data-structures/queue/index.js.map +0 -0
  447. /package/dist/{mjs → esm}/types/data-structures/queue/queue.d.ts +0 -0
  448. /package/dist/{mjs → esm}/types/data-structures/queue/queue.js +0 -0
  449. /package/dist/{mjs → esm}/types/data-structures/queue/queue.js.map +0 -0
  450. /package/dist/{mjs → esm}/types/data-structures/stack/index.d.ts +0 -0
  451. /package/dist/{mjs → esm}/types/data-structures/stack/index.js +0 -0
  452. /package/dist/{mjs → esm}/types/data-structures/stack/index.js.map +0 -0
  453. /package/dist/{mjs → esm}/types/data-structures/stack/stack.d.ts +0 -0
  454. /package/dist/{mjs → esm}/types/data-structures/stack/stack.js +0 -0
  455. /package/dist/{mjs → esm}/types/data-structures/stack/stack.js.map +0 -0
  456. /package/dist/{mjs → esm}/types/data-structures/tree/index.d.ts +0 -0
  457. /package/dist/{mjs → esm}/types/data-structures/tree/index.js +0 -0
  458. /package/dist/{mjs → esm}/types/data-structures/tree/index.js.map +0 -0
  459. /package/dist/{mjs → esm}/types/data-structures/tree/tree.d.ts +0 -0
  460. /package/dist/{mjs → esm}/types/data-structures/tree/tree.js +0 -0
  461. /package/dist/{mjs → esm}/types/data-structures/tree/tree.js.map +0 -0
  462. /package/dist/{mjs → esm}/types/data-structures/trie/index.d.ts +0 -0
  463. /package/dist/{mjs → esm}/types/data-structures/trie/index.js +0 -0
  464. /package/dist/{mjs → esm}/types/data-structures/trie/index.js.map +0 -0
  465. /package/dist/{mjs → esm}/types/data-structures/trie/trie.d.ts +0 -0
  466. /package/dist/{mjs → esm}/types/data-structures/trie/trie.js +0 -0
  467. /package/dist/{mjs → esm}/types/data-structures/trie/trie.js.map +0 -0
  468. /package/dist/{mjs → esm}/types/index.d.ts +0 -0
  469. /package/dist/{mjs → esm}/types/index.js +0 -0
  470. /package/dist/{mjs → esm}/types/index.js.map +0 -0
  471. /package/dist/{mjs → esm}/types/utils/index.d.ts +0 -0
  472. /package/dist/{mjs → esm}/types/utils/index.js +0 -0
  473. /package/dist/{mjs → esm}/types/utils/index.js.map +0 -0
  474. /package/dist/{mjs → esm}/types/utils/utils.d.ts +0 -0
  475. /package/dist/{mjs → esm}/types/utils/utils.js +0 -0
  476. /package/dist/{mjs → esm}/types/utils/utils.js.map +0 -0
  477. /package/dist/{mjs → esm}/types/utils/validate-type.d.ts +0 -0
  478. /package/dist/{mjs → esm}/types/utils/validate-type.js +0 -0
  479. /package/dist/{mjs → esm}/types/utils/validate-type.js.map +0 -0
  480. /package/dist/{mjs → esm}/utils/index.d.ts +0 -0
  481. /package/dist/{mjs → esm}/utils/index.js +0 -0
  482. /package/dist/{mjs → esm}/utils/index.js.map +0 -0
  483. /package/dist/{mjs → esm}/utils/number.d.ts +0 -0
  484. /package/dist/{mjs → esm}/utils/number.js +0 -0
  485. /package/dist/{mjs → esm}/utils/number.js.map +0 -0
  486. /package/dist/{mjs → esm}/utils/utils.d.ts +0 -0
  487. /package/dist/{mjs → esm}/utils/utils.js +0 -0
  488. /package/dist/{mjs → esm}/utils/utils.js.map +0 -0
@@ -45,6 +45,9 @@ export class DirectedEdge<E = any> extends AbstractEdge<E> {
45
45
  }
46
46
  }
47
47
 
48
+ /**
49
+ *
50
+ */
48
51
  export class DirectedGraph<
49
52
  V = any,
50
53
  E = any,
@@ -40,6 +40,9 @@ export class MapEdge<E = any> extends DirectedEdge<E> {
40
40
  }
41
41
  }
42
42
 
43
+ /**
44
+ *
45
+ */
43
46
  export class MapGraph<
44
47
  V = any,
45
48
  E = any,
@@ -42,6 +42,9 @@ export class UndirectedEdge<E = number> extends AbstractEdge<E> {
42
42
  }
43
43
  }
44
44
 
45
+ /**
46
+ *
47
+ */
45
48
  export class UndirectedGraph<
46
49
  V = any,
47
50
  E = any,
@@ -59,6 +59,9 @@ export class SinglyLinkedListNode<E = any> {
59
59
  }
60
60
  }
61
61
 
62
+ /**
63
+ *
64
+ */
62
65
  export class SinglyLinkedList<E = any, R = any> extends IterableElementBase<E, R, SinglyLinkedList<E, R>> {
63
66
  constructor(
64
67
  elements: Iterable<E> | Iterable<R> | Iterable<SinglyLinkedListNode<E>> = [],
@@ -19,6 +19,9 @@ export class SkipListNode<K, V> {
19
19
  }
20
20
  }
21
21
 
22
+ /**
23
+ *
24
+ */
22
25
  export class SkipList<K, V> {
23
26
  /**
24
27
  * The constructor function initializes a SkipLinkedList object with optional options and elements.
@@ -7,6 +7,9 @@
7
7
  */
8
8
  import type { MatrixOptions } from '../../types';
9
9
 
10
+ /**
11
+ *
12
+ */
10
13
  export class Matrix {
11
14
  /**
12
15
  * The constructor function initializes a matrix object with the provided data and options, or with
@@ -25,6 +25,9 @@ export class Character {
25
25
  }
26
26
  }
27
27
 
28
+ /**
29
+ *
30
+ */
28
31
  export class Navigator<T = number> {
29
32
  onMove: (cur: [number, number]) => void;
30
33
  protected readonly _matrix: T[][];
@@ -8,6 +8,9 @@
8
8
  import type { Comparator, ElementCallback, PriorityQueueOptions } from '../../types';
9
9
  import { PriorityQueue } from './priority-queue';
10
10
 
11
+ /**
12
+ *
13
+ */
11
14
  export class MaxPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
12
15
  /**
13
16
  * The constructor initializes a PriorityQueue with optional elements and options, including a
@@ -8,6 +8,9 @@
8
8
  import type { Comparator, ElementCallback, PriorityQueueOptions } from '../../types';
9
9
  import { PriorityQueue } from './priority-queue';
10
10
 
11
+ /**
12
+ *
13
+ */
11
14
  export class MinPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
12
15
  /**
13
16
  * The constructor initializes a PriorityQueue with optional elements and options, including a
@@ -8,10 +8,6 @@
8
8
  import type { ElementCallback, TrieOptions } from '../../types';
9
9
  import { IterableElementBase } from '../base';
10
10
 
11
- /**
12
- * TrieNode represents a node in the Trie data structure. It holds a character key, a map of children nodes,
13
- * and a flag indicating whether it's the end of a word.
14
- */
15
11
  export class TrieNode {
16
12
  constructor(key: string) {
17
13
  this._key = key;
@@ -1,30 +1,16 @@
1
- import { BinaryTree, BinaryTreeNode } from '../data-structures';
2
- import type {
3
- BinaryTreeDeleteResult,
4
- BinaryTreeNested,
5
- BinaryTreeNodeNested,
6
- BinaryTreeOptions,
7
- BTNRep,
8
- NodePredicate
9
- } from '../types';
1
+ import { BinaryTreeNode } from '../data-structures';
2
+ import type { BinaryTreeDeleteResult, BinaryTreeOptions, BTNRep, NodePredicate } from '../types';
10
3
 
11
- export interface IBinaryTree<
12
- K = any,
13
- V = any,
14
- R = object,
15
- MK = any,
16
- MV = any,
17
- MR = object,
18
- NODE extends BinaryTreeNode<K, V, NODE> = BinaryTreeNodeNested<K, V>,
19
- TREE extends BinaryTree<K, V, R, MK, MV, MR, NODE, TREE> = BinaryTreeNested<K, V, R, MK, MV, MR, NODE>
20
- > {
21
- createNode(key: K, value?: NODE['value']): NODE;
4
+ export interface IBinaryTree<K = any, V = any, R = object, MK = any, MV = any, MR = object> {
5
+ createNode(key: K, value?: BinaryTreeNode['value']): BinaryTreeNode;
22
6
 
23
- createTree(options?: Partial<BinaryTreeOptions<K, V, R>>): TREE;
7
+ createTree(options?: Partial<BinaryTreeOptions<K, V, R>>): IBinaryTree<K, V, R, MK, MV, MR>;
24
8
 
25
- add(keyOrNodeOrEntryOrRawElement: BTNRep<K, V, NODE>, value?: V, count?: number): boolean;
9
+ add(keyOrNodeOrEntryOrRawElement: BTNRep<K, V, BinaryTreeNode<K, V>>, value?: V, count?: number): boolean;
26
10
 
27
- addMany(nodes: Iterable<BTNRep<K, V, NODE>>, values?: Iterable<V | undefined>): boolean[];
11
+ addMany(nodes: Iterable<BTNRep<K, V, BinaryTreeNode<K, V>>>, values?: Iterable<V | undefined>): boolean[];
28
12
 
29
- delete(predicate: R | BTNRep<K, V, NODE> | NodePredicate<NODE>): BinaryTreeDeleteResult<NODE>[];
13
+ delete(
14
+ predicate: R | BTNRep<K, V, BinaryTreeNode<K, V>> | NodePredicate<BinaryTreeNode<K, V>>
15
+ ): BinaryTreeDeleteResult<BinaryTreeNode<K, V>>[];
30
16
  }
@@ -0,0 +1,3 @@
1
+ import { AVLTreeOptions } from './avl-tree';
2
+
3
+ export type AVLTreeCounterOptions<K, V, R> = AVLTreeOptions<K, V, R> & {};
@@ -1,8 +1,3 @@
1
- import { AVLTreeMultiMap, AVLTreeMultiMapNode } from '../../../data-structures';
2
1
  import type { AVLTreeOptions } from './avl-tree';
3
2
 
4
- export type AVLTreeMultiMapNodeNested<K, V> = AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, any>>>
5
-
6
- export type AVLTreeMultiMapNested<K, V, R, MK, MV, MR, NODE extends AVLTreeMultiMapNode<K, V, NODE>> = AVLTreeMultiMap<K, V, R, MK, MV, MR, NODE, AVLTreeMultiMap<K, V, R, MK, MV, MR, NODE, AVLTreeMultiMap<K, V, R, MK, MV, MR, NODE, any>>>
7
-
8
- export type AVLTreeMultiMapOptions<K, V, R> = AVLTreeOptions<K, V, R> & {}
3
+ export type AVLTreeMultiMapOptions<K, V, R> = Omit<AVLTreeOptions<K, V, R>, 'isMapMode'> & {}
@@ -1,8 +1,3 @@
1
- import { AVLTree, AVLTreeNode } from '../../../data-structures';
2
1
  import { BSTOptions } from './bst';
3
2
 
4
- export type AVLTreeNodeNested<K, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, any>>>
5
-
6
- export type AVLTreeNested<K, V, R,MK, MV, MR, NODE extends AVLTreeNode<K, V, NODE>> = AVLTree<K, V, R,MK, MV, MR, NODE, AVLTree<K, V, R,MK, MV, MR, NODE, AVLTree<K, V, R,MK, MV, MR, NODE, any>>>
7
-
8
3
  export type AVLTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
@@ -1,11 +1,6 @@
1
- import { BinaryTree, BinaryTreeNode } from '../../../data-structures';
2
1
  import { IterationType, OptValue } from '../../common';
3
2
  import { DFSOperation } from '../../../common';
4
3
 
5
- export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>
6
-
7
- export type BinaryTreeNested<K, V, R, MK, MV, MR, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, R, MK, MV, MR, NODE,BinaryTree<K, V, R, MK, MV, MR, NODE,BinaryTree<K, V, R, MK, MV, MR, NODE,any>>>
8
-
9
4
  export type ToEntryFn<K, V, R> = (rawElement: R) => BTNEntry<K, V>;
10
5
 
11
6
  export type BinaryTreeOptions<K, V, R> = {
@@ -1,10 +1,6 @@
1
- import { BST, BSTNode } from '../../../data-structures';
2
1
  import type { BinaryTreeOptions } from './binary-tree';
3
2
  import { Comparable } from '../../utils';
4
-
5
- export type BSTNodeNested<K, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, any>>>
6
-
7
- export type BSTNested<K, V, R,MK, MV, MR, NODE extends BSTNode<K, V, NODE>> = BST<K, V, R,MK, MV, MR, NODE,BST<K, V, R,MK, MV, MR, NODE,BST<K, V, R,MK, MV, MR, NODE, any>>>
3
+ import { OptValue } from '../../common';
8
4
 
9
5
  export type BSTOptions<K, V, R> = BinaryTreeOptions<K, V, R> & {
10
6
  specifyComparable?: (key: K) => Comparable
@@ -15,5 +11,9 @@ export type BSTNOptKey<K> = K | undefined;
15
11
 
16
12
  export type OptNode<NODE> = NODE | undefined;
17
13
 
14
+ export type BSTNEntry<K, V> = [BSTNOptKey<K>, OptValue<V>];
15
+
18
16
  export type BSTNOptKeyOrNode<K, NODE> = BSTNOptKey<K> | NODE;
19
17
 
18
+ export type BSTNRep<K, V, NODE> = BSTNEntry<K, V> | BSTNOptKeyOrNode<K, NODE>;
19
+
@@ -5,3 +5,5 @@ export * from './segment-tree';
5
5
  export * from './avl-tree-multi-map';
6
6
  export * from './rb-tree';
7
7
  export * from './tree-multi-map';
8
+ export * from './tree-counter';
9
+ export * from './avl-tree-counter';
@@ -1,10 +1,5 @@
1
- import { RedBlackTree, RedBlackTreeNode } from '../../../data-structures';
2
- import type { BSTOptions } from "./bst";
1
+ import type { BSTOptions } from './bst';
3
2
 
4
3
  export type RBTNColor = 'RED' | 'BLACK';
5
4
 
6
- export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, any>>>
7
-
8
- export type RedBlackTreeNested<K, V, R, MK, MV, MR, NODE extends RedBlackTreeNode<K, V, NODE>> = RedBlackTree<K, V, R, MK, MV, MR, NODE, RedBlackTree<K, V, R, MK, MV, MR, NODE, RedBlackTree<K, V, R, MK, MV, MR, NODE, any>>>
9
-
10
5
  export type RedBlackTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
@@ -0,0 +1,3 @@
1
+ import type { RedBlackTreeOptions } from './rb-tree';
2
+
3
+ export type TreeCounterOptions<K, V, R> = RedBlackTreeOptions<K, V, R> & {};
@@ -1,8 +1,3 @@
1
- import { TreeMultiMap, TreeMultiMapNode } from '../../../data-structures';
2
1
  import type { RedBlackTreeOptions } from './rb-tree';
3
2
 
4
- export type TreeMultiMapNodeNested<K, V> = TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, any>>>
5
-
6
- export type TreeMultiMapNested<K, V, R, MK, MV, MR, NODE extends TreeMultiMapNode<K, V, NODE>> = TreeMultiMap<K, V, R, MK, MV, MR, NODE, TreeMultiMap<K, V, R, MK, MV, MR, NODE,TreeMultiMap<K, V, R, MK, MV, MR, NODE, any>>>
7
-
8
- export type TreeMultiMapOptions<K, V, R> = RedBlackTreeOptions<K, V, R> & {}
3
+ export type TreeMultiMapOptions<K, V, R> = Omit<RedBlackTreeOptions<K, V, R>, 'isMapMode'> & {}
@@ -3,7 +3,7 @@ import { AVLTree } from 'data-structure-typed';
3
3
  describe('AVL Tree Test from data-structure-typed', () => {
4
4
  it('should perform various operations on a AVL Tree from data-structure-typed', () => {
5
5
  const keys = [11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5];
6
- const tree = new AVLTree<number>();
6
+ const tree = new AVLTree<number>([], { isMapMode: false });
7
7
 
8
8
  for (const i of keys) tree.add([i, i]);
9
9
 
@@ -48,7 +48,7 @@ describe('AVL Tree Test', () => {
48
48
  expect(lesserSum).toBe(45);
49
49
 
50
50
  // node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
51
- expect(node15?.value).toBe(15);
51
+ expect(node15?.value).toBe(undefined);
52
52
 
53
53
  const dfs = tree.dfs(node => node, 'IN');
54
54
  expect(dfs[0].key).toBe(1);
@@ -27,7 +27,7 @@ describe('Individual package BST operations test', () => {
27
27
  expect(nodeVal9?.key).toBe(undefined);
28
28
 
29
29
  const nodeVal11 = bst.getNode(node => node.value === 11);
30
- expect(nodeVal11?.key).toBe(11);
30
+ expect(nodeVal11?.key).toBe(undefined);
31
31
 
32
32
  const leftMost = bst.getLeftMost(node => node);
33
33
  expect(leftMost?.key).toBe(1);
@@ -186,7 +186,7 @@ describe('Individual package BST operations test', () => {
186
186
  });
187
187
 
188
188
  it('should perform various operations on a Binary Search Tree with object values', () => {
189
- const objBST = new BST<number, { key: number; keyA: number }>();
189
+ const objBST = new BST<number, { key: number; keyA: number }>([], { isMapMode: false });
190
190
  expect(objBST).toBeInstanceOf(BST);
191
191
  objBST.add([11, { key: 11, keyA: 11 }]);
192
192
  objBST.add([3, { key: 3, keyA: 3 }]);
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ var data_structure_typed_1 = require('data-structure-typed');
4
+
5
+ var orgArr = [6, 1, 2, 7, 5, 3, 4, 9, 8];
6
+ var orgStrArr = ['trie', 'trial', 'trick', 'trip', 'tree', 'trend', 'triangle', 'track', 'trace', 'transmit'];
7
+ var entries = [
8
+ [6, '6'],
9
+ [1, '1'],
10
+ [2, '2'],
11
+ [7, '7'],
12
+ [5, '5'],
13
+ [3, '3'],
14
+ [4, '4'],
15
+ [9, '9'],
16
+ [8, '8']
17
+ ];
18
+ var queue = new data_structure_typed_1.Queue(orgArr);
19
+ queue.print();
20
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
21
+ var deque = new data_structure_typed_1.Deque(orgArr);
22
+ deque.print();
23
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
24
+ var sList = new data_structure_typed_1.SinglyLinkedList(orgArr);
25
+ sList.print();
26
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
27
+ var dList = new data_structure_typed_1.DoublyLinkedList(orgArr);
28
+ dList.print();
29
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
30
+ var stack = new data_structure_typed_1.Stack(orgArr);
31
+ stack.print();
32
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
33
+ var minHeap = new data_structure_typed_1.MinHeap(orgArr);
34
+ minHeap.print();
35
+ // [1, 5, 2, 7, 6, 3, 4, 9, 8]
36
+ var maxPQ = new data_structure_typed_1.MaxPriorityQueue(orgArr);
37
+ maxPQ.print();
38
+ // [9, 8, 4, 7, 5, 2, 3, 1, 6]
39
+ var biTree = new data_structure_typed_1.BinaryTree(entries);
40
+ biTree.print();
41
+ // ___6___
42
+ // / \
43
+ // ___1_ _2_
44
+ // / \ / \
45
+ // _7_ 5 3 4
46
+ // / \
47
+ // 9 8
48
+ var bst = new data_structure_typed_1.BST(entries);
49
+ bst.print();
50
+ // _____5___
51
+ // / \
52
+ // _2_ _7_
53
+ // / \ / \
54
+ // 1 3_ 6 8_
55
+ // \ \
56
+ // 4 9
57
+ var rbTree = new data_structure_typed_1.RedBlackTree(entries);
58
+ rbTree.print();
59
+ // ___4___
60
+ // / \
61
+ // _2_ _6___
62
+ // / \ / \
63
+ // 1 3 5 _8_
64
+ // / \
65
+ // 7 9
66
+ var avl = new data_structure_typed_1.AVLTree(entries);
67
+ avl.print();
68
+ // ___4___
69
+ // / \
70
+ // _2_ _6___
71
+ // / \ / \
72
+ // 1 3 5 _8_
73
+ // / \
74
+ // 7 9
75
+ var treeMulti = new data_structure_typed_1.TreeMultiMap(entries);
76
+ treeMulti.print();
77
+ // ___4___
78
+ // / \
79
+ // _2_ _6___
80
+ // / \ / \
81
+ // 1 3 5 _8_
82
+ // / \
83
+ // 7 9
84
+ var hm = new data_structure_typed_1.HashMap(entries);
85
+ hm.print();
86
+ // [[6, "6"], [1, "1"], [2, "2"], [7, "7"], [5, "5"], [3, "3"], [4, "4"], [9, "9"], [8, "8"]]
87
+ var rbTreeH = new data_structure_typed_1.RedBlackTree(hm);
88
+ rbTreeH.print();
89
+ // ___4___
90
+ // / \
91
+ // _2_ _6___
92
+ // / \ / \
93
+ // 1 3 5 _8_
94
+ // / \
95
+ // 7 9
96
+ var pq = new data_structure_typed_1.MinPriorityQueue(orgArr);
97
+ pq.print();
98
+ // [1, 5, 2, 7, 6, 3, 4, 9, 8]
99
+ var bst1 = new data_structure_typed_1.BST(pq);
100
+ bst1.print();
101
+ // _____5___
102
+ // / \
103
+ // _2_ _7_
104
+ // / \ / \
105
+ // 1 3_ 6 8_
106
+ // \ \
107
+ // 4 9
108
+ var dq1 = new data_structure_typed_1.Deque(orgArr);
109
+ dq1.print();
110
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
111
+ var rbTree1 = new data_structure_typed_1.RedBlackTree(dq1);
112
+ rbTree1.print();
113
+ // _____5___
114
+ // / \
115
+ // _2___ _7___
116
+ // / \ / \
117
+ // 1 _4 6 _9
118
+ // / /
119
+ // 3 8
120
+ var trie2 = new data_structure_typed_1.Trie(orgStrArr);
121
+ trie2.print();
122
+ // ['trie', 'trial', 'triangle', 'trick', 'trip', 'tree', 'trend', 'track', 'trace', 'transmit']
123
+ var heap2 = new data_structure_typed_1.Heap(trie2, {
124
+ comparator: function (a, b) {
125
+ return Number(a) - Number(b);
126
+ }
127
+ });
128
+ heap2.print();
129
+ // ['transmit', 'trace', 'tree', 'trend', 'track', 'trial', 'trip', 'trie', 'trick', 'triangle']
130
+ var dq2 = new data_structure_typed_1.Deque(heap2);
131
+ dq2.print();
132
+ // ['transmit', 'trace', 'tree', 'trend', 'track', 'trial', 'trip', 'trie', 'trick', 'triangle']
133
+ var entries2 = dq2.map(function (el, i) {
134
+ return [i, el];
135
+ });
136
+ var avl2 = new data_structure_typed_1.AVLTree(entries2);
137
+ avl2.print();
138
+ // ___3_______
139
+ // / \
140
+ // _1_ ___7_
141
+ // / \ / \
142
+ // 0 2 _5_ 8_
143
+ // / \ \
144
+ // 4 6 9
@@ -0,0 +1,171 @@
1
+ import {
2
+ AVLTree,
3
+ BinaryTree,
4
+ BST,
5
+ Deque,
6
+ DoublyLinkedList,
7
+ HashMap,
8
+ Heap,
9
+ MaxPriorityQueue,
10
+ MinHeap,
11
+ MinPriorityQueue,
12
+ Queue,
13
+ RedBlackTree,
14
+ SinglyLinkedList,
15
+ Stack,
16
+ TreeMultiMap,
17
+ Trie
18
+ } from 'data-structure-typed';
19
+
20
+ const orgArr = [6, 1, 2, 7, 5, 3, 4, 9, 8];
21
+ const orgStrArr = ['trie', 'trial', 'trick', 'trip', 'tree', 'trend', 'triangle', 'track', 'trace', 'transmit'];
22
+ const entries: [number, string][] = [
23
+ [6, '6'],
24
+ [1, '1'],
25
+ [2, '2'],
26
+ [7, '7'],
27
+ [5, '5'],
28
+ [3, '3'],
29
+ [4, '4'],
30
+ [9, '9'],
31
+ [8, '8']
32
+ ];
33
+
34
+ const queue = new Queue(orgArr);
35
+ queue.print();
36
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
37
+
38
+ const deque = new Deque(orgArr);
39
+ deque.print();
40
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
41
+
42
+ const sList = new SinglyLinkedList(orgArr);
43
+ sList.print();
44
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
45
+
46
+ const dList = new DoublyLinkedList(orgArr);
47
+ dList.print();
48
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
49
+
50
+ const stack = new Stack(orgArr);
51
+ stack.print();
52
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
53
+
54
+ const minHeap = new MinHeap(orgArr);
55
+ minHeap.print();
56
+ // [1, 5, 2, 7, 6, 3, 4, 9, 8]
57
+
58
+ const maxPQ = new MaxPriorityQueue(orgArr);
59
+ maxPQ.print();
60
+ // [9, 8, 4, 7, 5, 2, 3, 1, 6]
61
+
62
+ const biTree = new BinaryTree(entries);
63
+ biTree.print();
64
+ // ___6___
65
+ // / \
66
+ // ___1_ _2_
67
+ // / \ / \
68
+ // _7_ 5 3 4
69
+ // / \
70
+ // 9 8
71
+
72
+ const bst = new BST(entries);
73
+ bst.print();
74
+ // _____5___
75
+ // / \
76
+ // _2_ _7_
77
+ // / \ / \
78
+ // 1 3_ 6 8_
79
+ // \ \
80
+ // 4 9
81
+
82
+ const rbTree = new RedBlackTree(entries);
83
+ rbTree.print();
84
+ // ___4___
85
+ // / \
86
+ // _2_ _6___
87
+ // / \ / \
88
+ // 1 3 5 _8_
89
+ // / \
90
+ // 7 9
91
+
92
+ const avl = new AVLTree(entries);
93
+ avl.print();
94
+ // ___4___
95
+ // / \
96
+ // _2_ _6___
97
+ // / \ / \
98
+ // 1 3 5 _8_
99
+ // / \
100
+ // 7 9
101
+
102
+ const treeMulti = new TreeMultiMap(entries);
103
+ treeMulti.print();
104
+ // ___4___
105
+ // / \
106
+ // _2_ _6___
107
+ // / \ / \
108
+ // 1 3 5 _8_
109
+ // / \
110
+ // 7 9
111
+
112
+ const hm = new HashMap(entries);
113
+ hm.print();
114
+ // [[6, "6"], [1, "1"], [2, "2"], [7, "7"], [5, "5"], [3, "3"], [4, "4"], [9, "9"], [8, "8"]]
115
+
116
+ const rbTreeH = new RedBlackTree(hm);
117
+ rbTreeH.print();
118
+ // ___4___
119
+ // / \
120
+ // _2_ _6___
121
+ // / \ / \
122
+ // 1 3 5 _8_
123
+ // / \
124
+ // 7 9
125
+
126
+ const pq = new MinPriorityQueue(orgArr);
127
+ pq.print();
128
+ // [1, 5, 2, 7, 6, 3, 4, 9, 8]
129
+
130
+ const bst1 = new BST(pq);
131
+ bst1.print();
132
+ // _____5___
133
+ // / \
134
+ // _2_ _7_
135
+ // / \ / \
136
+ // 1 3_ 6 8_
137
+ // \ \
138
+ // 4 9
139
+
140
+ const dq1 = new Deque(orgArr);
141
+ dq1.print();
142
+ // [6, 1, 2, 7, 5, 3, 4, 9, 8]
143
+ const rbTree1 = new RedBlackTree(dq1);
144
+ rbTree1.print();
145
+ // _____5___
146
+ // / \
147
+ // _2___ _7___
148
+ // / \ / \
149
+ // 1 _4 6 _9
150
+ // / /
151
+ // 3 8
152
+
153
+ const trie2 = new Trie(orgStrArr);
154
+ trie2.print();
155
+ // ['trie', 'trial', 'triangle', 'trick', 'trip', 'tree', 'trend', 'track', 'trace', 'transmit']
156
+ const heap2 = new Heap(trie2, { comparator: (a, b) => Number(a) - Number(b) });
157
+ heap2.print();
158
+ // ['transmit', 'trace', 'tree', 'trend', 'track', 'trial', 'trip', 'trie', 'trick', 'triangle']
159
+ const dq2 = new Deque(heap2);
160
+ dq2.print();
161
+ // ['transmit', 'trace', 'tree', 'trend', 'track', 'trial', 'trip', 'trie', 'trick', 'triangle']
162
+ const entries2 = dq2.map((el, i) => [i, el]);
163
+ const avl2 = new AVLTree(entries2);
164
+ avl2.print();
165
+ // ___3_______
166
+ // / \
167
+ // _1_ ___7_
168
+ // / \ / \
169
+ // 0 2 _5_ 8_
170
+ // / \ \
171
+ // 4 6 9