data-structure-typed 1.40.0-rc → 1.41.0

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 (1066) hide show
  1. package/.eslintrc.js +7 -5
  2. package/.github/workflows/ci.yml +2 -20
  3. package/.travis.yml +3 -4
  4. package/CHANGELOG.md +23 -1
  5. package/CONTRIBUTING.md +13 -0
  6. package/README.md +20 -11
  7. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +106 -0
  8. package/dist/cjs/data-structures/binary-tree/avl-tree.js +348 -0
  9. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
  10. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
  11. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +270 -0
  12. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  13. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +363 -0
  14. package/dist/cjs/data-structures/binary-tree/binary-tree.js +1136 -0
  15. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
  16. package/dist/cjs/data-structures/binary-tree/bst.d.ts +167 -0
  17. package/dist/cjs/data-structures/binary-tree/bst.js +513 -0
  18. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
  19. package/dist/cjs/data-structures/binary-tree/index.d.ts +7 -0
  20. package/dist/cjs/data-structures/binary-tree/index.js +24 -0
  21. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
  22. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +97 -0
  23. package/dist/cjs/data-structures/binary-tree/rb-tree.js +389 -0
  24. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
  25. package/dist/cjs/data-structures/binary-tree/segment-tree.d.ts +67 -0
  26. package/dist/cjs/data-structures/binary-tree/segment-tree.js +181 -0
  27. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
  28. package/dist/cjs/data-structures/binary-tree/tree-multiset.d.ts +126 -0
  29. package/dist/cjs/data-structures/binary-tree/tree-multiset.js +356 -0
  30. package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
  31. package/dist/cjs/data-structures/graph/abstract-graph.d.ts +313 -0
  32. package/dist/cjs/data-structures/graph/abstract-graph.js +885 -0
  33. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
  34. package/dist/cjs/data-structures/graph/directed-graph.d.ts +194 -0
  35. package/dist/cjs/data-structures/graph/directed-graph.js +405 -0
  36. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
  37. package/dist/cjs/data-structures/graph/index.js.map +1 -0
  38. package/dist/cjs/data-structures/graph/map-graph.d.ts +73 -0
  39. package/dist/cjs/data-structures/graph/map-graph.js +94 -0
  40. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
  41. package/dist/cjs/data-structures/graph/undirected-graph.d.ts +120 -0
  42. package/dist/cjs/data-structures/graph/undirected-graph.js +240 -0
  43. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
  44. package/dist/cjs/data-structures/hash/coordinate-map.d.ts +44 -0
  45. package/dist/cjs/data-structures/hash/coordinate-map.js +63 -0
  46. package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
  47. package/dist/cjs/data-structures/hash/coordinate-set.d.ts +36 -0
  48. package/dist/cjs/data-structures/hash/coordinate-set.js +53 -0
  49. package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
  50. package/dist/cjs/data-structures/hash/hash-map.d.ts +50 -0
  51. package/dist/cjs/data-structures/hash/hash-map.js +154 -0
  52. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
  53. package/dist/cjs/data-structures/hash/hash-table.d.ts +103 -0
  54. package/dist/cjs/data-structures/hash/hash-table.js +237 -0
  55. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
  56. package/dist/cjs/data-structures/hash/index.d.ts +6 -0
  57. package/dist/cjs/data-structures/hash/index.js +23 -0
  58. package/dist/cjs/data-structures/hash/index.js.map +1 -0
  59. package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
  60. package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
  61. package/dist/cjs/data-structures/heap/heap.d.ts +235 -0
  62. package/dist/cjs/data-structures/heap/heap.js +516 -0
  63. package/dist/cjs/data-structures/heap/heap.js.map +1 -0
  64. package/dist/cjs/data-structures/heap/index.js.map +1 -0
  65. package/dist/cjs/data-structures/heap/max-heap.d.ts +15 -0
  66. package/dist/cjs/data-structures/heap/max-heap.js +27 -0
  67. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
  68. package/dist/cjs/data-structures/heap/min-heap.d.ts +15 -0
  69. package/dist/cjs/data-structures/heap/min-heap.js +27 -0
  70. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
  71. package/dist/cjs/data-structures/index.js.map +1 -0
  72. package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
  73. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +570 -0
  74. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  75. package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
  76. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +232 -0
  77. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +534 -0
  78. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
  79. package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +80 -0
  80. package/dist/cjs/data-structures/linked-list/skip-linked-list.js +188 -0
  81. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
  82. package/dist/cjs/data-structures/matrix/index.js.map +1 -0
  83. package/dist/cjs/data-structures/matrix/matrix.d.ts +21 -0
  84. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
  85. package/dist/cjs/data-structures/matrix/matrix2d.d.ts +107 -0
  86. package/dist/cjs/data-structures/matrix/matrix2d.js +200 -0
  87. package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
  88. package/dist/cjs/data-structures/matrix/navigator.d.ts +52 -0
  89. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
  90. package/dist/cjs/data-structures/matrix/vector2d.d.ts +200 -0
  91. package/dist/cjs/data-structures/matrix/vector2d.js +291 -0
  92. package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
  93. package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
  94. package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
  95. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +27 -0
  96. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  97. package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
  98. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +27 -0
  99. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  100. package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +15 -0
  101. package/dist/cjs/data-structures/priority-queue/priority-queue.js +18 -0
  102. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
  103. package/dist/cjs/data-structures/queue/deque.d.ts +161 -0
  104. package/dist/cjs/data-structures/queue/deque.js +265 -0
  105. package/dist/cjs/data-structures/queue/deque.js.map +1 -0
  106. package/dist/cjs/data-structures/queue/index.js.map +1 -0
  107. package/dist/cjs/data-structures/queue/queue.d.ts +122 -0
  108. package/dist/cjs/data-structures/queue/queue.js +188 -0
  109. package/dist/cjs/data-structures/queue/queue.js.map +1 -0
  110. package/dist/cjs/data-structures/stack/index.js.map +1 -0
  111. package/dist/cjs/data-structures/stack/stack.d.ts +64 -0
  112. package/dist/cjs/data-structures/stack/stack.js +95 -0
  113. package/dist/cjs/data-structures/stack/stack.js.map +1 -0
  114. package/dist/cjs/data-structures/tree/index.js.map +1 -0
  115. package/dist/cjs/data-structures/tree/tree.d.ts +8 -0
  116. package/dist/cjs/data-structures/tree/tree.js +41 -0
  117. package/dist/cjs/data-structures/tree/tree.js.map +1 -0
  118. package/dist/cjs/data-structures/trie/index.js.map +1 -0
  119. package/dist/cjs/data-structures/trie/trie.d.ts +79 -0
  120. package/dist/cjs/data-structures/trie/trie.js +252 -0
  121. package/dist/cjs/data-structures/trie/trie.js.map +1 -0
  122. package/dist/cjs/index.js.map +1 -0
  123. package/dist/cjs/interfaces/binary-tree.d.ts +7 -0
  124. package/dist/cjs/interfaces/binary-tree.js.map +1 -0
  125. package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
  126. package/dist/cjs/interfaces/graph.d.ts +5 -0
  127. package/dist/cjs/interfaces/graph.js +3 -0
  128. package/dist/cjs/interfaces/graph.js.map +1 -0
  129. package/dist/cjs/interfaces/heap.js.map +1 -0
  130. package/dist/cjs/interfaces/index.d.ts +8 -0
  131. package/dist/cjs/interfaces/index.js +25 -0
  132. package/dist/cjs/interfaces/index.js.map +1 -0
  133. package/dist/cjs/interfaces/navigator.js.map +1 -0
  134. package/dist/cjs/interfaces/priority-queue.js.map +1 -0
  135. package/dist/cjs/interfaces/segment-tree.js.map +1 -0
  136. package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
  137. package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
  138. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  139. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  140. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  141. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
  142. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js +25 -0
  143. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  144. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +7 -0
  145. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
  146. package/dist/cjs/types/data-structures/binary-tree/index.d.ts +6 -0
  147. package/dist/cjs/types/data-structures/binary-tree/index.js +23 -0
  148. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
  149. package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +4 -0
  150. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js +14 -0
  151. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  152. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  153. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
  154. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  155. package/dist/cjs/types/data-structures/graph/abstract-graph.d.ts +10 -0
  156. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
  157. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
  158. package/dist/cjs/types/data-structures/graph/index.d.ts +3 -0
  159. package/dist/cjs/types/data-structures/graph/index.js +20 -0
  160. package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
  161. package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
  162. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
  163. package/dist/cjs/types/data-structures/hash/coordinate-map.js +3 -0
  164. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
  165. package/dist/cjs/types/data-structures/hash/coordinate-set.js +3 -0
  166. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
  167. package/dist/cjs/types/data-structures/hash/hash-map.js +3 -0
  168. package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
  169. package/dist/cjs/types/data-structures/hash/hash-table.js +3 -0
  170. package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
  171. package/dist/cjs/types/data-structures/hash/index.js +3 -0
  172. package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
  173. package/dist/cjs/types/data-structures/hash/tree-map.js +3 -0
  174. package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
  175. package/dist/cjs/types/data-structures/hash/tree-set.js +3 -0
  176. package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
  177. package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
  178. package/dist/cjs/types/data-structures/heap/index.d.ts +1 -0
  179. package/dist/cjs/types/data-structures/heap/index.js +18 -0
  180. package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
  181. package/dist/cjs/types/data-structures/heap/max-heap.js +3 -0
  182. package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
  183. package/dist/cjs/types/data-structures/heap/min-heap.js +3 -0
  184. package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
  185. package/dist/cjs/types/data-structures/index.d.ts +11 -0
  186. package/dist/cjs/types/data-structures/index.js +28 -0
  187. package/dist/cjs/types/data-structures/index.js.map +1 -0
  188. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  189. package/dist/cjs/types/data-structures/linked-list/index.d.ts +2 -0
  190. package/dist/cjs/types/data-structures/linked-list/index.js +19 -0
  191. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
  192. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  193. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js +3 -0
  194. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  195. package/dist/cjs/types/data-structures/matrix/index.d.ts +1 -0
  196. package/dist/cjs/types/data-structures/matrix/index.js +18 -0
  197. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
  198. package/dist/cjs/types/data-structures/matrix/matrix.js +3 -0
  199. package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
  200. package/dist/cjs/types/data-structures/matrix/matrix2d.js +3 -0
  201. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
  202. package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
  203. package/dist/cjs/types/data-structures/matrix/vector2d.js +3 -0
  204. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
  205. package/dist/cjs/types/data-structures/priority-queue/index.js +20 -0
  206. package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
  207. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js +3 -0
  208. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  209. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js +3 -0
  210. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  211. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  212. package/dist/cjs/types/data-structures/queue/deque.js +3 -0
  213. package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
  214. package/dist/cjs/types/data-structures/queue/index.js +19 -0
  215. package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
  216. package/dist/cjs/types/data-structures/queue/queue.js +3 -0
  217. package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
  218. package/dist/cjs/types/data-structures/stack/index.js +18 -0
  219. package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
  220. package/dist/cjs/types/data-structures/stack/stack.js +3 -0
  221. package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
  222. package/dist/cjs/types/data-structures/tree/index.js +18 -0
  223. package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
  224. package/dist/cjs/types/data-structures/tree/tree.js +3 -0
  225. package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
  226. package/dist/cjs/types/data-structures/trie/index.js +18 -0
  227. package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
  228. package/dist/cjs/types/data-structures/trie/trie.js +3 -0
  229. package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
  230. package/dist/cjs/types/helpers.d.ts +8 -0
  231. package/dist/cjs/types/helpers.js +10 -0
  232. package/dist/cjs/types/helpers.js.map +1 -0
  233. package/dist/cjs/types/index.js.map +1 -0
  234. package/dist/cjs/types/utils/index.js.map +1 -0
  235. package/dist/cjs/types/utils/utils.js.map +1 -0
  236. package/dist/cjs/types/utils/validate-type.js.map +1 -0
  237. package/dist/cjs/utils/index.js.map +1 -0
  238. package/dist/cjs/utils/utils.d.ts +20 -0
  239. package/dist/cjs/utils/utils.js +74 -0
  240. package/dist/cjs/utils/utils.js.map +1 -0
  241. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +106 -0
  242. package/dist/mjs/data-structures/binary-tree/avl-tree.js +348 -0
  243. package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
  244. package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.js +274 -0
  245. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +363 -0
  246. package/dist/mjs/data-structures/binary-tree/binary-tree.js +1147 -0
  247. package/dist/mjs/data-structures/binary-tree/bst.d.ts +167 -0
  248. package/dist/mjs/data-structures/binary-tree/bst.js +509 -0
  249. package/dist/mjs/data-structures/binary-tree/index.d.ts +7 -0
  250. package/dist/mjs/data-structures/binary-tree/index.js +23 -0
  251. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +97 -0
  252. package/dist/mjs/data-structures/binary-tree/rb-tree.js +393 -0
  253. package/dist/mjs/data-structures/binary-tree/segment-tree.d.ts +67 -0
  254. package/dist/mjs/data-structures/binary-tree/segment-tree.js +182 -0
  255. package/dist/mjs/data-structures/binary-tree/tree-multiset.d.ts +126 -0
  256. package/dist/mjs/data-structures/binary-tree/tree-multiset.js +356 -0
  257. package/dist/mjs/data-structures/graph/abstract-graph.d.ts +313 -0
  258. package/dist/mjs/data-structures/graph/abstract-graph.js +883 -0
  259. package/dist/mjs/data-structures/graph/directed-graph.d.ts +194 -0
  260. package/dist/mjs/data-structures/graph/directed-graph.js +406 -0
  261. package/dist/mjs/data-structures/graph/index.js +20 -0
  262. package/dist/mjs/data-structures/graph/map-graph.d.ts +73 -0
  263. package/dist/mjs/data-structures/graph/map-graph.js +96 -0
  264. package/dist/mjs/data-structures/graph/undirected-graph.d.ts +120 -0
  265. package/dist/mjs/data-structures/graph/undirected-graph.js +239 -0
  266. package/dist/mjs/data-structures/hash/coordinate-map.d.ts +44 -0
  267. package/dist/mjs/data-structures/hash/coordinate-map.js +62 -0
  268. package/dist/mjs/data-structures/hash/coordinate-set.d.ts +36 -0
  269. package/dist/mjs/data-structures/hash/coordinate-set.js +52 -0
  270. package/dist/mjs/data-structures/hash/hash-map.d.ts +50 -0
  271. package/dist/mjs/data-structures/hash/hash-map.js +159 -0
  272. package/dist/mjs/data-structures/hash/hash-table.d.ts +103 -0
  273. package/dist/mjs/data-structures/hash/hash-table.js +243 -0
  274. package/dist/mjs/data-structures/hash/index.d.ts +6 -0
  275. package/dist/mjs/data-structures/hash/index.js +22 -0
  276. package/dist/mjs/data-structures/hash/tree-map.js +6 -0
  277. package/dist/mjs/data-structures/hash/tree-set.js +6 -0
  278. package/dist/mjs/data-structures/heap/heap.d.ts +235 -0
  279. package/dist/mjs/data-structures/heap/heap.js +525 -0
  280. package/dist/mjs/data-structures/heap/index.js +19 -0
  281. package/dist/mjs/data-structures/heap/max-heap.d.ts +15 -0
  282. package/dist/mjs/data-structures/heap/max-heap.js +26 -0
  283. package/dist/mjs/data-structures/heap/min-heap.d.ts +15 -0
  284. package/dist/mjs/data-structures/heap/min-heap.js +26 -0
  285. package/dist/mjs/data-structures/index.js +27 -0
  286. package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
  287. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +573 -0
  288. package/dist/mjs/data-structures/linked-list/index.js +19 -0
  289. package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +232 -0
  290. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +538 -0
  291. package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +80 -0
  292. package/dist/mjs/data-structures/linked-list/skip-linked-list.js +194 -0
  293. package/dist/mjs/data-structures/matrix/index.js +20 -0
  294. package/dist/mjs/data-structures/matrix/matrix.d.ts +21 -0
  295. package/dist/mjs/data-structures/matrix/matrix.js +29 -0
  296. package/dist/mjs/data-structures/matrix/matrix2d.d.ts +107 -0
  297. package/dist/mjs/data-structures/matrix/matrix2d.js +200 -0
  298. package/dist/mjs/data-structures/matrix/navigator.d.ts +52 -0
  299. package/dist/mjs/data-structures/matrix/navigator.js +113 -0
  300. package/dist/mjs/data-structures/matrix/vector2d.d.ts +200 -0
  301. package/dist/mjs/data-structures/matrix/vector2d.js +293 -0
  302. package/dist/mjs/data-structures/priority-queue/index.js +19 -0
  303. package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
  304. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +26 -0
  305. package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
  306. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +26 -0
  307. package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +15 -0
  308. package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
  309. package/dist/mjs/data-structures/queue/deque.d.ts +161 -0
  310. package/dist/mjs/data-structures/queue/deque.js +257 -0
  311. package/dist/mjs/data-structures/queue/index.js +18 -0
  312. package/dist/mjs/data-structures/queue/queue.d.ts +122 -0
  313. package/dist/mjs/data-structures/queue/queue.js +188 -0
  314. package/dist/mjs/data-structures/stack/index.js +17 -0
  315. package/dist/mjs/data-structures/stack/stack.d.ts +64 -0
  316. package/dist/mjs/data-structures/stack/stack.js +95 -0
  317. package/dist/mjs/data-structures/tree/index.js +17 -0
  318. package/dist/mjs/data-structures/tree/tree.d.ts +8 -0
  319. package/dist/mjs/data-structures/tree/tree.js +43 -0
  320. package/dist/mjs/data-structures/trie/index.js +17 -0
  321. package/dist/mjs/data-structures/trie/trie.d.ts +79 -0
  322. package/dist/mjs/data-structures/trie/trie.js +256 -0
  323. package/dist/mjs/index.js +20 -0
  324. package/dist/mjs/interfaces/binary-tree.d.ts +7 -0
  325. package/dist/mjs/interfaces/binary-tree.js +2 -0
  326. package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
  327. package/dist/mjs/interfaces/graph.d.ts +5 -0
  328. package/dist/mjs/interfaces/graph.js +2 -0
  329. package/dist/mjs/interfaces/heap.js +2 -0
  330. package/dist/mjs/interfaces/index.d.ts +8 -0
  331. package/dist/mjs/interfaces/index.js +24 -0
  332. package/dist/mjs/interfaces/navigator.js +2 -0
  333. package/dist/mjs/interfaces/priority-queue.js +2 -0
  334. package/dist/mjs/interfaces/segment-tree.js +2 -0
  335. package/dist/mjs/interfaces/singly-linked-list.js +2 -0
  336. package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
  337. package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
  338. package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  339. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
  340. package/dist/mjs/types/data-structures/binary-tree/binary-tree.js +24 -0
  341. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +7 -0
  342. package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
  343. package/dist/mjs/types/data-structures/binary-tree/index.d.ts +6 -0
  344. package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
  345. package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +4 -0
  346. package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +13 -0
  347. package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
  348. package/dist/mjs/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
  349. package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
  350. package/dist/mjs/types/data-structures/graph/abstract-graph.d.ts +10 -0
  351. package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
  352. package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
  353. package/dist/mjs/types/data-structures/graph/index.d.ts +3 -0
  354. package/dist/mjs/types/data-structures/graph/index.js +19 -0
  355. package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
  356. package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
  357. package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
  358. package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
  359. package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
  360. package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
  361. package/dist/mjs/types/data-structures/hash/index.js +2 -0
  362. package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
  363. package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
  364. package/dist/mjs/types/data-structures/heap/heap.js +2 -0
  365. package/dist/mjs/types/data-structures/heap/index.d.ts +1 -0
  366. package/dist/mjs/types/data-structures/heap/index.js +17 -0
  367. package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
  368. package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
  369. package/dist/mjs/types/data-structures/index.d.ts +11 -0
  370. package/dist/mjs/types/data-structures/index.js +27 -0
  371. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  372. package/dist/mjs/types/data-structures/linked-list/index.d.ts +2 -0
  373. package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
  374. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
  375. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  376. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
  377. package/dist/mjs/types/data-structures/matrix/index.d.ts +1 -0
  378. package/dist/mjs/types/data-structures/matrix/index.js +17 -0
  379. package/dist/mjs/types/data-structures/matrix/matrix.d.ts +1 -0
  380. package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
  381. package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +1 -0
  382. package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
  383. package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
  384. package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +1 -0
  385. package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
  386. package/dist/mjs/types/data-structures/priority-queue/index.d.ts +3 -0
  387. package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
  388. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  389. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  390. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  391. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  392. package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  393. package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
  394. package/dist/mjs/types/data-structures/queue/deque.d.ts +1 -0
  395. package/dist/mjs/types/data-structures/queue/deque.js +2 -0
  396. package/dist/mjs/types/data-structures/queue/index.d.ts +2 -0
  397. package/dist/mjs/types/data-structures/queue/index.js +18 -0
  398. package/dist/mjs/types/data-structures/queue/queue.d.ts +1 -0
  399. package/dist/mjs/types/data-structures/queue/queue.js +2 -0
  400. package/dist/mjs/types/data-structures/stack/index.d.ts +1 -0
  401. package/dist/mjs/types/data-structures/stack/index.js +17 -0
  402. package/dist/mjs/types/data-structures/stack/stack.d.ts +1 -0
  403. package/dist/mjs/types/data-structures/stack/stack.js +2 -0
  404. package/dist/mjs/types/data-structures/tree/index.d.ts +1 -0
  405. package/dist/mjs/types/data-structures/tree/index.js +17 -0
  406. package/dist/mjs/types/data-structures/tree/tree.d.ts +1 -0
  407. package/dist/mjs/types/data-structures/tree/tree.js +2 -0
  408. package/dist/mjs/types/data-structures/trie/index.d.ts +1 -0
  409. package/dist/mjs/types/data-structures/trie/index.js +17 -0
  410. package/dist/mjs/types/data-structures/trie/trie.d.ts +1 -0
  411. package/dist/mjs/types/data-structures/trie/trie.js +2 -0
  412. package/dist/mjs/types/helpers.d.ts +8 -0
  413. package/dist/mjs/types/helpers.js +9 -0
  414. package/dist/mjs/types/index.js +19 -0
  415. package/dist/mjs/types/utils/index.js +18 -0
  416. package/dist/mjs/types/utils/utils.js +2 -0
  417. package/dist/mjs/types/utils/validate-type.js +2 -0
  418. package/dist/mjs/utils/index.js +17 -0
  419. package/dist/mjs/utils/utils.d.ts +20 -0
  420. package/dist/mjs/utils/utils.js +64 -0
  421. package/dist/umd/data-structure-typed.min.js +27 -0
  422. package/dist/umd/data-structure-typed.min.js.map +1 -0
  423. package/package.json +28 -22
  424. package/src/data-structures/binary-tree/avl-tree.ts +88 -74
  425. package/src/data-structures/binary-tree/binary-indexed-tree.ts +265 -35
  426. package/src/data-structures/binary-tree/binary-tree.ts +1263 -26
  427. package/src/data-structures/binary-tree/bst.ts +217 -237
  428. package/src/data-structures/binary-tree/index.ts +0 -5
  429. package/src/data-structures/binary-tree/rb-tree.ts +416 -356
  430. package/src/data-structures/binary-tree/segment-tree.ts +25 -92
  431. package/src/data-structures/binary-tree/tree-multiset.ts +113 -422
  432. package/src/data-structures/graph/abstract-graph.ts +169 -214
  433. package/src/data-structures/graph/directed-graph.ts +105 -126
  434. package/src/data-structures/graph/map-graph.ts +29 -57
  435. package/src/data-structures/graph/undirected-graph.ts +67 -82
  436. package/src/data-structures/hash/coordinate-map.ts +0 -4
  437. package/src/data-structures/hash/coordinate-set.ts +0 -4
  438. package/src/data-structures/hash/hash-map.ts +65 -83
  439. package/src/data-structures/hash/hash-table.ts +109 -118
  440. package/src/data-structures/hash/index.ts +0 -1
  441. package/src/data-structures/hash/tree-map.ts +2 -1
  442. package/src/data-structures/hash/tree-set.ts +2 -1
  443. package/src/data-structures/heap/heap.ts +505 -128
  444. package/src/data-structures/heap/max-heap.ts +16 -21
  445. package/src/data-structures/heap/min-heap.ts +16 -22
  446. package/src/data-structures/linked-list/doubly-linked-list.ts +143 -174
  447. package/src/data-structures/linked-list/singly-linked-list.ts +174 -99
  448. package/src/data-structures/linked-list/skip-linked-list.ts +104 -49
  449. package/src/data-structures/matrix/matrix.ts +2 -2
  450. package/src/data-structures/matrix/matrix2d.ts +12 -14
  451. package/src/data-structures/matrix/navigator.ts +4 -4
  452. package/src/data-structures/matrix/vector2d.ts +2 -3
  453. package/src/data-structures/priority-queue/max-priority-queue.ts +15 -46
  454. package/src/data-structures/priority-queue/min-priority-queue.ts +15 -47
  455. package/src/data-structures/priority-queue/priority-queue.ts +7 -350
  456. package/src/data-structures/queue/deque.ts +62 -77
  457. package/src/data-structures/queue/queue.ts +39 -21
  458. package/src/data-structures/stack/stack.ts +13 -9
  459. package/src/data-structures/tree/tree.ts +10 -38
  460. package/src/data-structures/trie/trie.ts +108 -71
  461. package/src/interfaces/binary-tree.ts +7 -4
  462. package/src/interfaces/graph.ts +7 -0
  463. package/src/interfaces/index.ts +1 -8
  464. package/src/types/data-structures/binary-tree/avl-tree.ts +5 -0
  465. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  466. package/src/types/data-structures/binary-tree/binary-tree.ts +31 -0
  467. package/src/types/data-structures/binary-tree/bst.ts +11 -0
  468. package/src/types/data-structures/binary-tree/index.ts +6 -0
  469. package/src/types/data-structures/binary-tree/rb-tree.ts +8 -0
  470. package/src/types/data-structures/binary-tree/tree-multiset.ts +6 -0
  471. package/src/types/data-structures/graph/abstract-graph.ts +11 -0
  472. package/src/types/data-structures/graph/index.ts +3 -0
  473. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  474. package/src/types/data-structures/hash/coordinate-map.ts +1 -0
  475. package/src/types/data-structures/hash/coordinate-set.ts +1 -0
  476. package/src/types/data-structures/hash/hash-map.ts +1 -0
  477. package/src/types/data-structures/hash/hash-table.ts +1 -0
  478. package/src/types/data-structures/hash/tree-map.ts +1 -0
  479. package/src/types/data-structures/hash/tree-set.ts +1 -0
  480. package/src/types/data-structures/heap/heap.ts +1 -0
  481. package/src/types/data-structures/heap/index.ts +1 -0
  482. package/src/types/data-structures/heap/max-heap.ts +1 -0
  483. package/src/types/data-structures/heap/min-heap.ts +1 -0
  484. package/src/types/data-structures/index.ts +8 -13
  485. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
  486. package/src/types/data-structures/linked-list/index.ts +2 -0
  487. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
  488. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  489. package/src/types/data-structures/matrix/index.ts +1 -0
  490. package/src/types/data-structures/matrix/matrix.ts +1 -0
  491. package/src/types/data-structures/matrix/matrix2d.ts +1 -0
  492. package/src/types/data-structures/matrix/navigator.ts +14 -0
  493. package/src/types/data-structures/matrix/vector2d.ts +1 -0
  494. package/src/types/data-structures/priority-queue/index.ts +3 -0
  495. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  496. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  497. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  498. package/src/types/data-structures/queue/deque.ts +1 -0
  499. package/src/types/data-structures/queue/index.ts +2 -0
  500. package/src/types/data-structures/queue/queue.ts +1 -0
  501. package/src/types/data-structures/stack/index.ts +1 -0
  502. package/src/types/data-structures/stack/stack.ts +1 -0
  503. package/src/types/data-structures/tree/index.ts +1 -0
  504. package/src/types/data-structures/tree/tree.ts +1 -0
  505. package/src/types/data-structures/trie/index.ts +1 -0
  506. package/src/types/data-structures/trie/trie.ts +1 -0
  507. package/src/types/helpers.ts +11 -1
  508. package/src/types/utils/utils.ts +1 -1
  509. package/src/types/utils/validate-type.ts +2 -2
  510. package/src/utils/utils.ts +7 -0
  511. package/test/config.js +4 -0
  512. package/test/config.ts +1 -0
  513. package/test/integration/avl-tree.test.ts +24 -22
  514. package/test/integration/bst.test.ts +52 -47
  515. package/test/integration/index.html +3 -4
  516. package/test/types/index.js +29 -0
  517. package/test/types/utils/big-o.js +2 -0
  518. package/test/types/utils/big-o.ts +1 -0
  519. package/test/types/utils/index.js +29 -0
  520. package/test/types/utils/index.ts +1 -0
  521. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +184 -23
  522. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +320 -0
  523. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +393 -40
  524. package/test/unit/data-structures/binary-tree/bst.test.ts +506 -48
  525. package/test/unit/data-structures/binary-tree/overall.test.ts +8 -7
  526. package/test/unit/data-structures/binary-tree/rb-tree.test.ts +240 -41
  527. package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +296 -215
  528. package/test/unit/data-structures/graph/abstract-graph.test.ts +97 -2
  529. package/test/unit/data-structures/graph/directed-graph.test.ts +76 -31
  530. package/test/unit/data-structures/graph/map-graph.test.ts +93 -12
  531. package/test/unit/data-structures/graph/overall.test.ts +2 -2
  532. package/test/unit/data-structures/graph/undirected-graph.test.ts +93 -3
  533. package/test/unit/data-structures/hash/coordinate-map.test.ts +20 -0
  534. package/test/unit/data-structures/hash/coordinate-set.test.ts +25 -0
  535. package/test/unit/data-structures/hash/hash-map.test.ts +2 -3
  536. package/test/unit/data-structures/hash/hash-table.test.ts +10 -8
  537. package/test/unit/data-structures/heap/heap.test.ts +218 -20
  538. package/test/unit/data-structures/heap/max-heap.test.ts +50 -42
  539. package/test/unit/data-structures/heap/min-heap.test.ts +38 -68
  540. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +86 -27
  541. package/test/unit/data-structures/linked-list/linked-list.test.ts +4 -4
  542. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +71 -27
  543. package/test/unit/data-structures/linked-list/skip-list.test.ts +33 -2
  544. package/test/unit/data-structures/matrix/matrix2d.test.ts +207 -0
  545. package/test/unit/data-structures/matrix/navigator.test.ts +167 -2
  546. package/test/unit/data-structures/matrix/vector2d.test.ts +171 -0
  547. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +10 -11
  548. package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -1
  549. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +14 -30
  550. package/test/unit/data-structures/queue/deque.test.ts +303 -23
  551. package/test/unit/data-structures/queue/queue.test.ts +52 -8
  552. package/test/unit/data-structures/tree/tree.test.ts +2 -2
  553. package/test/unit/data-structures/trie/trie.test.ts +743 -13
  554. package/test/utils/big-o.js +212 -0
  555. package/test/utils/big-o.ts +201 -0
  556. package/test/utils/index.js +30 -0
  557. package/test/utils/index.ts +1 -1
  558. package/test/utils/number.js +14 -0
  559. package/tsconfig-base.json +27 -0
  560. package/tsconfig-cjs.json +9 -0
  561. package/tsup.config.js +18 -0
  562. package/umd/bundle.min.js +1 -1
  563. package/umd/bundle.min.js.LICENSE.txt +15 -0
  564. package/umd/bundle.min.js.map +1 -1
  565. package/dist/data-structures/binary-tree/aa-tree.d.ts +0 -2
  566. package/dist/data-structures/binary-tree/aa-tree.js +0 -7
  567. package/dist/data-structures/binary-tree/aa-tree.js.map +0 -1
  568. package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
  569. package/dist/data-structures/binary-tree/abstract-binary-tree.js +0 -1199
  570. package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +0 -1
  571. package/dist/data-structures/binary-tree/avl-tree.d.ts +0 -94
  572. package/dist/data-structures/binary-tree/avl-tree.js +0 -336
  573. package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
  574. package/dist/data-structures/binary-tree/b-tree.d.ts +0 -2
  575. package/dist/data-structures/binary-tree/b-tree.js +0 -7
  576. package/dist/data-structures/binary-tree/b-tree.js.map +0 -1
  577. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -46
  578. package/dist/data-structures/binary-tree/binary-indexed-tree.js +0 -74
  579. package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  580. package/dist/data-structures/binary-tree/binary-tree.d.ts +0 -31
  581. package/dist/data-structures/binary-tree/binary-tree.js +0 -41
  582. package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
  583. package/dist/data-structures/binary-tree/bst.d.ts +0 -133
  584. package/dist/data-structures/binary-tree/bst.js +0 -554
  585. package/dist/data-structures/binary-tree/bst.js.map +0 -1
  586. package/dist/data-structures/binary-tree/index.d.ts +0 -12
  587. package/dist/data-structures/binary-tree/index.js +0 -29
  588. package/dist/data-structures/binary-tree/index.js.map +0 -1
  589. package/dist/data-structures/binary-tree/rb-tree.d.ts +0 -13
  590. package/dist/data-structures/binary-tree/rb-tree.js +0 -28
  591. package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
  592. package/dist/data-structures/binary-tree/segment-tree.d.ts +0 -83
  593. package/dist/data-structures/binary-tree/segment-tree.js +0 -229
  594. package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
  595. package/dist/data-structures/binary-tree/splay-tree.d.ts +0 -2
  596. package/dist/data-structures/binary-tree/splay-tree.js +0 -7
  597. package/dist/data-structures/binary-tree/splay-tree.js.map +0 -1
  598. package/dist/data-structures/binary-tree/tree-multiset.d.ts +0 -209
  599. package/dist/data-structures/binary-tree/tree-multiset.js +0 -669
  600. package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
  601. package/dist/data-structures/binary-tree/two-three-tree.d.ts +0 -2
  602. package/dist/data-structures/binary-tree/two-three-tree.js +0 -7
  603. package/dist/data-structures/binary-tree/two-three-tree.js.map +0 -1
  604. package/dist/data-structures/graph/abstract-graph.d.ts +0 -332
  605. package/dist/data-structures/graph/abstract-graph.js +0 -925
  606. package/dist/data-structures/graph/abstract-graph.js.map +0 -1
  607. package/dist/data-structures/graph/directed-graph.d.ts +0 -200
  608. package/dist/data-structures/graph/directed-graph.js +0 -423
  609. package/dist/data-structures/graph/directed-graph.js.map +0 -1
  610. package/dist/data-structures/graph/index.js.map +0 -1
  611. package/dist/data-structures/graph/map-graph.d.ts +0 -79
  612. package/dist/data-structures/graph/map-graph.js +0 -112
  613. package/dist/data-structures/graph/map-graph.js.map +0 -1
  614. package/dist/data-structures/graph/undirected-graph.d.ts +0 -127
  615. package/dist/data-structures/graph/undirected-graph.js +0 -253
  616. package/dist/data-structures/graph/undirected-graph.js.map +0 -1
  617. package/dist/data-structures/hash/coordinate-map.d.ts +0 -45
  618. package/dist/data-structures/hash/coordinate-map.js +0 -66
  619. package/dist/data-structures/hash/coordinate-map.js.map +0 -1
  620. package/dist/data-structures/hash/coordinate-set.d.ts +0 -37
  621. package/dist/data-structures/hash/coordinate-set.js +0 -56
  622. package/dist/data-structures/hash/coordinate-set.js.map +0 -1
  623. package/dist/data-structures/hash/hash-map.d.ts +0 -56
  624. package/dist/data-structures/hash/hash-map.js +0 -172
  625. package/dist/data-structures/hash/hash-map.js.map +0 -1
  626. package/dist/data-structures/hash/hash-table.d.ts +0 -106
  627. package/dist/data-structures/hash/hash-table.js +0 -246
  628. package/dist/data-structures/hash/hash-table.js.map +0 -1
  629. package/dist/data-structures/hash/index.d.ts +0 -7
  630. package/dist/data-structures/hash/index.js +0 -24
  631. package/dist/data-structures/hash/index.js.map +0 -1
  632. package/dist/data-structures/hash/pair.d.ts +0 -2
  633. package/dist/data-structures/hash/pair.js +0 -7
  634. package/dist/data-structures/hash/pair.js.map +0 -1
  635. package/dist/data-structures/hash/tree-map.js.map +0 -1
  636. package/dist/data-structures/hash/tree-set.js.map +0 -1
  637. package/dist/data-structures/heap/heap.d.ts +0 -83
  638. package/dist/data-structures/heap/heap.js +0 -158
  639. package/dist/data-structures/heap/heap.js.map +0 -1
  640. package/dist/data-structures/heap/index.js.map +0 -1
  641. package/dist/data-structures/heap/max-heap.d.ts +0 -23
  642. package/dist/data-structures/heap/max-heap.js +0 -31
  643. package/dist/data-structures/heap/max-heap.js.map +0 -1
  644. package/dist/data-structures/heap/min-heap.d.ts +0 -24
  645. package/dist/data-structures/heap/min-heap.js +0 -32
  646. package/dist/data-structures/heap/min-heap.js.map +0 -1
  647. package/dist/data-structures/index.js.map +0 -1
  648. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +0 -234
  649. package/dist/data-structures/linked-list/doubly-linked-list.js +0 -584
  650. package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  651. package/dist/data-structures/linked-list/index.js.map +0 -1
  652. package/dist/data-structures/linked-list/singly-linked-list.d.ts +0 -157
  653. package/dist/data-structures/linked-list/singly-linked-list.js +0 -449
  654. package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
  655. package/dist/data-structures/linked-list/skip-linked-list.d.ts +0 -61
  656. package/dist/data-structures/linked-list/skip-linked-list.js +0 -143
  657. package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
  658. package/dist/data-structures/matrix/index.js.map +0 -1
  659. package/dist/data-structures/matrix/matrix.d.ts +0 -21
  660. package/dist/data-structures/matrix/matrix.js.map +0 -1
  661. package/dist/data-structures/matrix/matrix2d.d.ts +0 -108
  662. package/dist/data-structures/matrix/matrix2d.js +0 -201
  663. package/dist/data-structures/matrix/matrix2d.js.map +0 -1
  664. package/dist/data-structures/matrix/navigator.d.ts +0 -52
  665. package/dist/data-structures/matrix/navigator.js.map +0 -1
  666. package/dist/data-structures/matrix/vector2d.d.ts +0 -201
  667. package/dist/data-structures/matrix/vector2d.js +0 -292
  668. package/dist/data-structures/matrix/vector2d.js.map +0 -1
  669. package/dist/data-structures/priority-queue/index.js.map +0 -1
  670. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +0 -15
  671. package/dist/data-structures/priority-queue/max-priority-queue.js +0 -44
  672. package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  673. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +0 -15
  674. package/dist/data-structures/priority-queue/min-priority-queue.js +0 -45
  675. package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  676. package/dist/data-structures/priority-queue/priority-queue.d.ts +0 -180
  677. package/dist/data-structures/priority-queue/priority-queue.js +0 -322
  678. package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
  679. package/dist/data-structures/queue/deque.d.ts +0 -165
  680. package/dist/data-structures/queue/deque.js +0 -277
  681. package/dist/data-structures/queue/deque.js.map +0 -1
  682. package/dist/data-structures/queue/index.js.map +0 -1
  683. package/dist/data-structures/queue/queue.d.ts +0 -107
  684. package/dist/data-structures/queue/queue.js +0 -171
  685. package/dist/data-structures/queue/queue.js.map +0 -1
  686. package/dist/data-structures/stack/index.js.map +0 -1
  687. package/dist/data-structures/stack/stack.d.ts +0 -63
  688. package/dist/data-structures/stack/stack.js +0 -92
  689. package/dist/data-structures/stack/stack.js.map +0 -1
  690. package/dist/data-structures/tree/index.js.map +0 -1
  691. package/dist/data-structures/tree/tree.d.ts +0 -14
  692. package/dist/data-structures/tree/tree.js +0 -61
  693. package/dist/data-structures/tree/tree.js.map +0 -1
  694. package/dist/data-structures/trie/index.js.map +0 -1
  695. package/dist/data-structures/trie/trie.d.ts +0 -61
  696. package/dist/data-structures/trie/trie.js +0 -211
  697. package/dist/data-structures/trie/trie.js.map +0 -1
  698. package/dist/index.js.map +0 -1
  699. package/dist/interfaces/abstract-binary-tree.d.ts +0 -7
  700. package/dist/interfaces/abstract-binary-tree.js +0 -3
  701. package/dist/interfaces/abstract-binary-tree.js.map +0 -1
  702. package/dist/interfaces/abstract-graph.d.ts +0 -5
  703. package/dist/interfaces/abstract-graph.js.map +0 -1
  704. package/dist/interfaces/avl-tree.d.ts +0 -7
  705. package/dist/interfaces/avl-tree.js.map +0 -1
  706. package/dist/interfaces/binary-tree.d.ts +0 -6
  707. package/dist/interfaces/binary-tree.js.map +0 -1
  708. package/dist/interfaces/bst.d.ts +0 -6
  709. package/dist/interfaces/bst.js.map +0 -1
  710. package/dist/interfaces/directed-graph.d.ts +0 -3
  711. package/dist/interfaces/directed-graph.js +0 -3
  712. package/dist/interfaces/directed-graph.js.map +0 -1
  713. package/dist/interfaces/doubly-linked-list.js.map +0 -1
  714. package/dist/interfaces/heap.js.map +0 -1
  715. package/dist/interfaces/index.d.ts +0 -15
  716. package/dist/interfaces/index.js +0 -32
  717. package/dist/interfaces/index.js.map +0 -1
  718. package/dist/interfaces/navigator.js.map +0 -1
  719. package/dist/interfaces/priority-queue.js.map +0 -1
  720. package/dist/interfaces/rb-tree.d.ts +0 -6
  721. package/dist/interfaces/rb-tree.js +0 -3
  722. package/dist/interfaces/rb-tree.js.map +0 -1
  723. package/dist/interfaces/segment-tree.js.map +0 -1
  724. package/dist/interfaces/singly-linked-list.js.map +0 -1
  725. package/dist/interfaces/tree-multiset.d.ts +0 -6
  726. package/dist/interfaces/tree-multiset.js.map +0 -1
  727. package/dist/interfaces/undirected-graph.d.ts +0 -3
  728. package/dist/interfaces/undirected-graph.js.map +0 -1
  729. package/dist/types/data-structures/abstract-binary-tree.d.ts +0 -34
  730. package/dist/types/data-structures/abstract-binary-tree.js +0 -25
  731. package/dist/types/data-structures/abstract-binary-tree.js.map +0 -1
  732. package/dist/types/data-structures/abstract-graph.d.ts +0 -11
  733. package/dist/types/data-structures/abstract-graph.js +0 -3
  734. package/dist/types/data-structures/abstract-graph.js.map +0 -1
  735. package/dist/types/data-structures/avl-tree.d.ts +0 -4
  736. package/dist/types/data-structures/avl-tree.js +0 -3
  737. package/dist/types/data-structures/avl-tree.js.map +0 -1
  738. package/dist/types/data-structures/binary-tree.d.ts +0 -4
  739. package/dist/types/data-structures/binary-tree.js +0 -3
  740. package/dist/types/data-structures/binary-tree.js.map +0 -1
  741. package/dist/types/data-structures/bst.d.ts +0 -13
  742. package/dist/types/data-structures/bst.js +0 -10
  743. package/dist/types/data-structures/bst.js.map +0 -1
  744. package/dist/types/data-structures/directed-graph.js.map +0 -1
  745. package/dist/types/data-structures/doubly-linked-list.js.map +0 -1
  746. package/dist/types/data-structures/hash.js +0 -3
  747. package/dist/types/data-structures/hash.js.map +0 -1
  748. package/dist/types/data-structures/heap.d.ts +0 -3
  749. package/dist/types/data-structures/heap.js.map +0 -1
  750. package/dist/types/data-structures/index.d.ts +0 -16
  751. package/dist/types/data-structures/index.js +0 -33
  752. package/dist/types/data-structures/index.js.map +0 -1
  753. package/dist/types/data-structures/map-graph.js.map +0 -1
  754. package/dist/types/data-structures/navigator.js.map +0 -1
  755. package/dist/types/data-structures/priority-queue.d.ts +0 -7
  756. package/dist/types/data-structures/priority-queue.js.map +0 -1
  757. package/dist/types/data-structures/rb-tree.d.ts +0 -8
  758. package/dist/types/data-structures/rb-tree.js +0 -9
  759. package/dist/types/data-structures/rb-tree.js.map +0 -1
  760. package/dist/types/data-structures/segment-tree.js.map +0 -1
  761. package/dist/types/data-structures/singly-linked-list.js.map +0 -1
  762. package/dist/types/data-structures/tree-multiset.d.ts +0 -4
  763. package/dist/types/data-structures/tree-multiset.js +0 -3
  764. package/dist/types/data-structures/tree-multiset.js.map +0 -1
  765. package/dist/types/helpers.js +0 -3
  766. package/dist/types/helpers.js.map +0 -1
  767. package/dist/types/index.js.map +0 -1
  768. package/dist/types/utils/index.js.map +0 -1
  769. package/dist/types/utils/utils.js.map +0 -1
  770. package/dist/types/utils/validate-type.js.map +0 -1
  771. package/dist/utils/index.js.map +0 -1
  772. package/dist/utils/utils.d.ts +0 -19
  773. package/dist/utils/utils.js +0 -67
  774. package/dist/utils/utils.js.map +0 -1
  775. package/lib/data-structures/binary-tree/aa-tree.d.ts +0 -2
  776. package/lib/data-structures/binary-tree/aa-tree.js +0 -2
  777. package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
  778. package/lib/data-structures/binary-tree/abstract-binary-tree.js +0 -1193
  779. package/lib/data-structures/binary-tree/avl-tree.d.ts +0 -94
  780. package/lib/data-structures/binary-tree/avl-tree.js +0 -330
  781. package/lib/data-structures/binary-tree/b-tree.d.ts +0 -2
  782. package/lib/data-structures/binary-tree/b-tree.js +0 -2
  783. package/lib/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -46
  784. package/lib/data-structures/binary-tree/binary-indexed-tree.js +0 -69
  785. package/lib/data-structures/binary-tree/binary-tree.d.ts +0 -31
  786. package/lib/data-structures/binary-tree/binary-tree.js +0 -35
  787. package/lib/data-structures/binary-tree/bst.d.ts +0 -133
  788. package/lib/data-structures/binary-tree/bst.js +0 -548
  789. package/lib/data-structures/binary-tree/index.d.ts +0 -12
  790. package/lib/data-structures/binary-tree/index.js +0 -12
  791. package/lib/data-structures/binary-tree/rb-tree.d.ts +0 -13
  792. package/lib/data-structures/binary-tree/rb-tree.js +0 -22
  793. package/lib/data-structures/binary-tree/segment-tree.d.ts +0 -83
  794. package/lib/data-structures/binary-tree/segment-tree.js +0 -223
  795. package/lib/data-structures/binary-tree/splay-tree.d.ts +0 -2
  796. package/lib/data-structures/binary-tree/splay-tree.js +0 -2
  797. package/lib/data-structures/binary-tree/tree-multiset.d.ts +0 -209
  798. package/lib/data-structures/binary-tree/tree-multiset.js +0 -663
  799. package/lib/data-structures/binary-tree/two-three-tree.d.ts +0 -2
  800. package/lib/data-structures/binary-tree/two-three-tree.js +0 -2
  801. package/lib/data-structures/graph/abstract-graph.d.ts +0 -332
  802. package/lib/data-structures/graph/abstract-graph.js +0 -918
  803. package/lib/data-structures/graph/directed-graph.d.ts +0 -200
  804. package/lib/data-structures/graph/directed-graph.js +0 -416
  805. package/lib/data-structures/graph/index.js +0 -4
  806. package/lib/data-structures/graph/map-graph.d.ts +0 -79
  807. package/lib/data-structures/graph/map-graph.js +0 -105
  808. package/lib/data-structures/graph/undirected-graph.d.ts +0 -127
  809. package/lib/data-structures/graph/undirected-graph.js +0 -246
  810. package/lib/data-structures/hash/coordinate-map.d.ts +0 -45
  811. package/lib/data-structures/hash/coordinate-map.js +0 -61
  812. package/lib/data-structures/hash/coordinate-set.d.ts +0 -37
  813. package/lib/data-structures/hash/coordinate-set.js +0 -51
  814. package/lib/data-structures/hash/hash-map.d.ts +0 -56
  815. package/lib/data-structures/hash/hash-map.js +0 -167
  816. package/lib/data-structures/hash/hash-table.d.ts +0 -106
  817. package/lib/data-structures/hash/hash-table.js +0 -240
  818. package/lib/data-structures/hash/index.d.ts +0 -7
  819. package/lib/data-structures/hash/index.js +0 -7
  820. package/lib/data-structures/hash/pair.d.ts +0 -2
  821. package/lib/data-structures/hash/pair.js +0 -2
  822. package/lib/data-structures/hash/tree-map.js +0 -2
  823. package/lib/data-structures/hash/tree-set.js +0 -2
  824. package/lib/data-structures/heap/heap.d.ts +0 -83
  825. package/lib/data-structures/heap/heap.js +0 -152
  826. package/lib/data-structures/heap/index.js +0 -3
  827. package/lib/data-structures/heap/max-heap.d.ts +0 -23
  828. package/lib/data-structures/heap/max-heap.js +0 -26
  829. package/lib/data-structures/heap/min-heap.d.ts +0 -24
  830. package/lib/data-structures/heap/min-heap.js +0 -27
  831. package/lib/data-structures/index.js +0 -11
  832. package/lib/data-structures/linked-list/doubly-linked-list.d.ts +0 -234
  833. package/lib/data-structures/linked-list/doubly-linked-list.js +0 -578
  834. package/lib/data-structures/linked-list/index.js +0 -3
  835. package/lib/data-structures/linked-list/singly-linked-list.d.ts +0 -157
  836. package/lib/data-structures/linked-list/singly-linked-list.js +0 -443
  837. package/lib/data-structures/linked-list/skip-linked-list.d.ts +0 -61
  838. package/lib/data-structures/linked-list/skip-linked-list.js +0 -137
  839. package/lib/data-structures/matrix/index.js +0 -4
  840. package/lib/data-structures/matrix/matrix.d.ts +0 -21
  841. package/lib/data-structures/matrix/matrix.js +0 -24
  842. package/lib/data-structures/matrix/matrix2d.d.ts +0 -108
  843. package/lib/data-structures/matrix/matrix2d.js +0 -196
  844. package/lib/data-structures/matrix/navigator.d.ts +0 -52
  845. package/lib/data-structures/matrix/navigator.js +0 -101
  846. package/lib/data-structures/matrix/vector2d.d.ts +0 -201
  847. package/lib/data-structures/matrix/vector2d.js +0 -287
  848. package/lib/data-structures/priority-queue/max-priority-queue.d.ts +0 -15
  849. package/lib/data-structures/priority-queue/max-priority-queue.js +0 -39
  850. package/lib/data-structures/priority-queue/min-priority-queue.d.ts +0 -15
  851. package/lib/data-structures/priority-queue/min-priority-queue.js +0 -40
  852. package/lib/data-structures/priority-queue/priority-queue.d.ts +0 -180
  853. package/lib/data-structures/priority-queue/priority-queue.js +0 -317
  854. package/lib/data-structures/queue/deque.d.ts +0 -165
  855. package/lib/data-structures/queue/deque.js +0 -270
  856. package/lib/data-structures/queue/queue.d.ts +0 -107
  857. package/lib/data-structures/queue/queue.js +0 -165
  858. package/lib/data-structures/stack/stack.d.ts +0 -63
  859. package/lib/data-structures/stack/stack.js +0 -87
  860. package/lib/data-structures/tree/tree.d.ts +0 -14
  861. package/lib/data-structures/tree/tree.js +0 -56
  862. package/lib/data-structures/trie/trie.d.ts +0 -61
  863. package/lib/data-structures/trie/trie.js +0 -205
  864. package/lib/index.js +0 -4
  865. package/lib/interfaces/abstract-binary-tree.d.ts +0 -7
  866. package/lib/interfaces/abstract-graph.d.ts +0 -5
  867. package/lib/interfaces/avl-tree.d.ts +0 -7
  868. package/lib/interfaces/binary-tree.d.ts +0 -6
  869. package/lib/interfaces/bst.d.ts +0 -6
  870. package/lib/interfaces/directed-graph.d.ts +0 -3
  871. package/lib/interfaces/index.d.ts +0 -15
  872. package/lib/interfaces/index.js +0 -15
  873. package/lib/interfaces/rb-tree.d.ts +0 -6
  874. package/lib/interfaces/tree-multiset.d.ts +0 -6
  875. package/lib/interfaces/undirected-graph.d.ts +0 -3
  876. package/lib/types/data-structures/abstract-binary-tree.d.ts +0 -34
  877. package/lib/types/data-structures/abstract-binary-tree.js +0 -21
  878. package/lib/types/data-structures/abstract-graph.d.ts +0 -11
  879. package/lib/types/data-structures/avl-tree.d.ts +0 -4
  880. package/lib/types/data-structures/binary-tree.d.ts +0 -4
  881. package/lib/types/data-structures/bst.d.ts +0 -13
  882. package/lib/types/data-structures/bst.js +0 -6
  883. package/lib/types/data-structures/directed-graph.js +0 -6
  884. package/lib/types/data-structures/heap.d.ts +0 -3
  885. package/lib/types/data-structures/index.d.ts +0 -16
  886. package/lib/types/data-structures/index.js +0 -16
  887. package/lib/types/data-structures/priority-queue.d.ts +0 -7
  888. package/lib/types/data-structures/rb-tree.d.ts +0 -8
  889. package/lib/types/data-structures/rb-tree.js +0 -5
  890. package/lib/types/data-structures/tree-multiset.d.ts +0 -4
  891. package/lib/types/index.js +0 -3
  892. package/lib/types/utils/index.js +0 -2
  893. package/lib/utils/utils.d.ts +0 -19
  894. package/lib/utils/utils.js +0 -57
  895. package/scripts/rename_clear_files.sh +0 -29
  896. package/src/data-structures/binary-tree/aa-tree.ts +0 -1
  897. package/src/data-structures/binary-tree/abstract-binary-tree.ts +0 -1556
  898. package/src/data-structures/binary-tree/b-tree.ts +0 -1
  899. package/src/data-structures/binary-tree/splay-tree.ts +0 -1
  900. package/src/data-structures/binary-tree/two-three-tree.ts +0 -1
  901. package/src/data-structures/hash/pair.ts +0 -1
  902. package/src/interfaces/abstract-binary-tree.ts +0 -8
  903. package/src/interfaces/abstract-graph.ts +0 -7
  904. package/src/interfaces/avl-tree.ts +0 -8
  905. package/src/interfaces/bst.ts +0 -6
  906. package/src/interfaces/directed-graph.ts +0 -3
  907. package/src/interfaces/rb-tree.ts +0 -6
  908. package/src/interfaces/tree-multiset.ts +0 -7
  909. package/src/interfaces/undirected-graph.ts +0 -3
  910. package/src/types/data-structures/abstract-binary-tree.ts +0 -49
  911. package/src/types/data-structures/abstract-graph.ts +0 -11
  912. package/src/types/data-structures/avl-tree.ts +0 -5
  913. package/src/types/data-structures/binary-tree.ts +0 -5
  914. package/src/types/data-structures/bst.ts +0 -13
  915. package/src/types/data-structures/heap.ts +0 -5
  916. package/src/types/data-structures/navigator.ts +0 -13
  917. package/src/types/data-structures/priority-queue.ts +0 -9
  918. package/src/types/data-structures/rb-tree.ts +0 -8
  919. package/src/types/data-structures/tree-multiset.ts +0 -6
  920. package/test/utils/magnitude.ts +0 -21
  921. /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
  922. /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
  923. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
  924. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
  925. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
  926. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
  927. /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
  928. /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
  929. /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
  930. /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
  931. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
  932. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
  933. /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
  934. /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
  935. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
  936. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
  937. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
  938. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
  939. /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
  940. /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
  941. /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
  942. /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
  943. /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
  944. /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
  945. /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
  946. /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
  947. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  948. /package/dist/{index.js → cjs/index.js} +0 -0
  949. /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
  950. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
  951. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
  952. /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
  953. /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
  954. /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
  955. /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
  956. /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
  957. /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
  958. /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
  959. /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
  960. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
  961. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
  962. /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/avl-tree.js +0 -0
  963. /package/dist/{types/data-structures/doubly-linked-list.d.ts → cjs/types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
  964. /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/bst.js +0 -0
  965. /package/dist/{types/data-structures → cjs/types/data-structures/binary-tree}/segment-tree.d.ts +0 -0
  966. /package/dist/{types/data-structures → cjs/types/data-structures/binary-tree}/segment-tree.js +0 -0
  967. /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/tree-multiset.js +0 -0
  968. /package/dist/{interfaces → cjs/types/data-structures/graph}/abstract-graph.js +0 -0
  969. /package/dist/{types/data-structures → cjs/types/data-structures/graph}/directed-graph.d.ts +0 -0
  970. /package/dist/{types/data-structures → cjs/types/data-structures/graph}/directed-graph.js +0 -0
  971. /package/dist/{types/data-structures → cjs/types/data-structures/graph}/map-graph.d.ts +0 -0
  972. /package/dist/{types/data-structures → cjs/types/data-structures/graph}/map-graph.js +0 -0
  973. /package/dist/{types/data-structures/singly-linked-list.d.ts → cjs/types/data-structures/graph/undirected-graph.d.ts} +0 -0
  974. /package/dist/{interfaces → cjs/types/data-structures/graph}/undirected-graph.js +0 -0
  975. /package/dist/{types/helpers.d.ts → cjs/types/data-structures/hash/coordinate-map.d.ts} +0 -0
  976. /package/{lib/interfaces/abstract-binary-tree.js → dist/cjs/types/data-structures/hash/coordinate-set.d.ts} +0 -0
  977. /package/{lib/interfaces/abstract-graph.js → dist/cjs/types/data-structures/hash/hash-map.d.ts} +0 -0
  978. /package/{lib/interfaces/avl-tree.js → dist/cjs/types/data-structures/hash/hash-table.d.ts} +0 -0
  979. /package/dist/{types/data-structures/hash.d.ts → cjs/types/data-structures/hash/index.d.ts} +0 -0
  980. /package/{lib/interfaces/binary-tree.js → dist/cjs/types/data-structures/hash/tree-map.d.ts} +0 -0
  981. /package/{lib/interfaces/bst.js → dist/cjs/types/data-structures/hash/tree-set.d.ts} +0 -0
  982. /package/{lib/interfaces → dist/cjs/types/data-structures/heap}/heap.d.ts +0 -0
  983. /package/dist/{types/data-structures → cjs/types/data-structures/heap}/heap.js +0 -0
  984. /package/{lib/interfaces/directed-graph.js → dist/cjs/types/data-structures/heap/max-heap.d.ts} +0 -0
  985. /package/{lib/interfaces/doubly-linked-list.d.ts → dist/cjs/types/data-structures/heap/min-heap.d.ts} +0 -0
  986. /package/{lib/types/data-structures → dist/cjs/types/data-structures/linked-list}/doubly-linked-list.d.ts +0 -0
  987. /package/dist/{types/data-structures → cjs/types/data-structures/linked-list}/doubly-linked-list.js +0 -0
  988. /package/{lib/interfaces → dist/cjs/types/data-structures/linked-list}/singly-linked-list.d.ts +0 -0
  989. /package/dist/{types/data-structures → cjs/types/data-structures/linked-list}/singly-linked-list.js +0 -0
  990. /package/{lib/interfaces/doubly-linked-list.js → dist/cjs/types/data-structures/linked-list/skip-linked-list.d.ts} +0 -0
  991. /package/{lib/interfaces/heap.js → dist/cjs/types/data-structures/matrix/matrix.d.ts} +0 -0
  992. /package/{lib/interfaces/navigator.d.ts → dist/cjs/types/data-structures/matrix/matrix2d.d.ts} +0 -0
  993. /package/dist/{types/data-structures → cjs/types/data-structures/matrix}/navigator.d.ts +0 -0
  994. /package/dist/{types/data-structures → cjs/types/data-structures/matrix}/navigator.js +0 -0
  995. /package/{lib/interfaces/navigator.js → dist/cjs/types/data-structures/matrix/vector2d.d.ts} +0 -0
  996. /package/{lib → dist/cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
  997. /package/{lib/interfaces/priority-queue.d.ts → dist/cjs/types/data-structures/priority-queue/max-priority-queue.d.ts} +0 -0
  998. /package/{lib/interfaces/priority-queue.js → dist/cjs/types/data-structures/priority-queue/min-priority-queue.d.ts} +0 -0
  999. /package/{lib/interfaces/rb-tree.js → dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts} +0 -0
  1000. /package/dist/{types/data-structures → cjs/types/data-structures/priority-queue}/priority-queue.js +0 -0
  1001. /package/{lib/interfaces/segment-tree.d.ts → dist/cjs/types/data-structures/queue/deque.d.ts} +0 -0
  1002. /package/{lib → dist/cjs/types}/data-structures/queue/index.d.ts +0 -0
  1003. /package/{lib/interfaces/segment-tree.js → dist/cjs/types/data-structures/queue/queue.d.ts} +0 -0
  1004. /package/{lib → dist/cjs/types}/data-structures/stack/index.d.ts +0 -0
  1005. /package/{lib/interfaces/singly-linked-list.js → dist/cjs/types/data-structures/stack/stack.d.ts} +0 -0
  1006. /package/{lib → dist/cjs/types}/data-structures/tree/index.d.ts +0 -0
  1007. /package/{lib/interfaces/tree-multiset.js → dist/cjs/types/data-structures/tree/tree.d.ts} +0 -0
  1008. /package/{lib → dist/cjs/types}/data-structures/trie/index.d.ts +0 -0
  1009. /package/{lib/interfaces/undirected-graph.js → dist/cjs/types/data-structures/trie/trie.d.ts} +0 -0
  1010. /package/dist/{types → cjs/types}/index.d.ts +0 -0
  1011. /package/dist/{types → cjs/types}/index.js +0 -0
  1012. /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
  1013. /package/dist/{types → cjs/types}/utils/index.js +0 -0
  1014. /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
  1015. /package/dist/{types → cjs/types}/utils/utils.js +0 -0
  1016. /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
  1017. /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
  1018. /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
  1019. /package/dist/{utils → cjs/utils}/index.js +0 -0
  1020. /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
  1021. /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
  1022. /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
  1023. /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
  1024. /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
  1025. /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
  1026. /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
  1027. /package/{lib/data-structures/priority-queue/index.js → dist/mjs/data-structures/priority-queue/index.d.ts} +0 -0
  1028. /package/{lib/data-structures/queue/index.js → dist/mjs/data-structures/queue/index.d.ts} +0 -0
  1029. /package/{lib/data-structures/stack/index.js → dist/mjs/data-structures/stack/index.d.ts} +0 -0
  1030. /package/{lib/data-structures/tree/index.js → dist/mjs/data-structures/tree/index.d.ts} +0 -0
  1031. /package/{lib/data-structures/trie/index.js → dist/mjs/data-structures/trie/index.d.ts} +0 -0
  1032. /package/{lib → dist/mjs}/index.d.ts +0 -0
  1033. /package/{lib/types/data-structures/abstract-graph.js → dist/mjs/interfaces/doubly-linked-list.d.ts} +0 -0
  1034. /package/{lib/types/data-structures/avl-tree.js → dist/mjs/interfaces/heap.d.ts} +0 -0
  1035. /package/{lib/types/data-structures/binary-tree.js → dist/mjs/interfaces/navigator.d.ts} +0 -0
  1036. /package/{lib/types/data-structures/doubly-linked-list.js → dist/mjs/interfaces/priority-queue.d.ts} +0 -0
  1037. /package/{lib/types/data-structures/hash.js → dist/mjs/interfaces/segment-tree.d.ts} +0 -0
  1038. /package/{lib/types/data-structures → dist/mjs/interfaces}/singly-linked-list.d.ts +0 -0
  1039. /package/{lib/types/data-structures/heap.js → dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
  1040. /package/{lib/types/data-structures → dist/mjs/types/data-structures/binary-tree}/segment-tree.d.ts +0 -0
  1041. /package/{lib/types/data-structures → dist/mjs/types/data-structures/graph}/directed-graph.d.ts +0 -0
  1042. /package/{lib/types/data-structures → dist/mjs/types/data-structures/graph}/map-graph.d.ts +0 -0
  1043. /package/{lib/types/data-structures/map-graph.js → dist/mjs/types/data-structures/graph/undirected-graph.d.ts} +0 -0
  1044. /package/{lib/types/data-structures/navigator.js → dist/mjs/types/data-structures/hash/coordinate-map.d.ts} +0 -0
  1045. /package/{lib/types/data-structures/priority-queue.js → dist/mjs/types/data-structures/hash/coordinate-set.d.ts} +0 -0
  1046. /package/{lib/types/data-structures/segment-tree.js → dist/mjs/types/data-structures/hash/hash-map.d.ts} +0 -0
  1047. /package/{lib/types/data-structures/singly-linked-list.js → dist/mjs/types/data-structures/hash/hash-table.d.ts} +0 -0
  1048. /package/{lib/types/data-structures/hash.d.ts → dist/mjs/types/data-structures/hash/index.d.ts} +0 -0
  1049. /package/{lib/types/data-structures/tree-multiset.js → dist/mjs/types/data-structures/hash/tree-map.d.ts} +0 -0
  1050. /package/{lib/types/helpers.d.ts → dist/mjs/types/data-structures/hash/tree-set.d.ts} +0 -0
  1051. /package/{lib/types/helpers.js → dist/mjs/types/data-structures/heap/heap.d.ts} +0 -0
  1052. /package/{lib/types/utils/utils.js → dist/mjs/types/data-structures/heap/max-heap.d.ts} +0 -0
  1053. /package/{lib/types/utils/validate-type.js → dist/mjs/types/data-structures/heap/min-heap.d.ts} +0 -0
  1054. /package/{src/types/data-structures/doubly-linked-list.ts → dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts} +0 -0
  1055. /package/{src/types/data-structures/singly-linked-list.ts → dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts} +0 -0
  1056. /package/{lib/types/data-structures → dist/mjs/types/data-structures/matrix}/navigator.d.ts +0 -0
  1057. /package/{lib → dist/mjs}/types/index.d.ts +0 -0
  1058. /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
  1059. /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
  1060. /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
  1061. /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
  1062. /package/src/types/data-structures/{segment-tree.ts → binary-tree/segment-tree.ts} +0 -0
  1063. /package/src/types/data-structures/{directed-graph.ts → graph/directed-graph.ts} +0 -0
  1064. /package/src/types/data-structures/{map-graph.ts → graph/map-graph.ts} +0 -0
  1065. /package/src/types/data-structures/{hash.ts → hash/index.ts} +0 -0
  1066. /package/{lib/utils/index.js → test/types/index.ts} +0 -0
@@ -1,143 +0,0 @@
1
- "use strict";
2
- /**
3
- * data-structure-typed
4
- *
5
- * @author Tyler Zeng
6
- * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
7
- * @license MIT License
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SkipList = exports.SkipListNode = void 0;
11
- class SkipListNode {
12
- constructor(key, value, level) {
13
- this.key = key;
14
- this.value = value;
15
- this.forward = new Array(level);
16
- }
17
- }
18
- exports.SkipListNode = SkipListNode;
19
- class SkipList {
20
- get probability() {
21
- return this._probability;
22
- }
23
- set probability(value) {
24
- this._probability = value;
25
- }
26
- get maxLevel() {
27
- return this._maxLevel;
28
- }
29
- set maxLevel(value) {
30
- this._maxLevel = value;
31
- }
32
- get level() {
33
- return this._level;
34
- }
35
- set level(value) {
36
- this._level = value;
37
- }
38
- get head() {
39
- return this._head;
40
- }
41
- set head(value) {
42
- this._head = value;
43
- }
44
- /**
45
- * The constructor initializes a SkipList with a specified maximum level and probability.
46
- * @param [maxLevel=16] - The `maxLevel` parameter represents the maximum level that a skip list can have. It determines
47
- * the maximum number of levels that can be created in the skip list.
48
- * @param [probability=0.5] - The probability parameter represents the probability of a node being promoted to a higher
49
- * level in the skip list. It is used to determine the height of each node in the skip list.
50
- */
51
- constructor(maxLevel = 16, probability = 0.5) {
52
- this._head = new SkipListNode(null, null, maxLevel);
53
- this._level = 0;
54
- this._maxLevel = maxLevel;
55
- this._probability = probability;
56
- }
57
- /**
58
- * The function "randomLevel" generates a random level based on a given probability and maximum level.
59
- * @returns the level, which is a number.
60
- */
61
- randomLevel() {
62
- let level = 1;
63
- while (Math.random() < this.probability && level < this.maxLevel) {
64
- level++;
65
- }
66
- return level;
67
- }
68
- /**
69
- * The add function adds a new node with a given key and value to a Skip List data structure.
70
- * @param {K} key - The key parameter represents the key of the node that needs to be added to the skip list.
71
- * @param {V} value - The "value" parameter represents the value associated with the key that is being added to the Skip
72
- * List.
73
- */
74
- add(key, value) {
75
- const newNode = new SkipListNode(key, value, this.randomLevel());
76
- const update = new Array(this.maxLevel).fill(this.head);
77
- let current = this.head;
78
- for (let i = this.level - 1; i >= 0; i--) {
79
- while (current.forward[i] && current.forward[i].key < key) {
80
- current = current.forward[i];
81
- }
82
- update[i] = current;
83
- }
84
- for (let i = 0; i < newNode.forward.length; i++) {
85
- newNode.forward[i] = update[i].forward[i];
86
- update[i].forward[i] = newNode;
87
- }
88
- if (newNode.forward[0] !== null) {
89
- this.level = Math.max(this.level, newNode.forward.length);
90
- }
91
- }
92
- /**
93
- * The function `get` retrieves the value associated with a given key from a skip list data structure.
94
- * @param {K} key - The `key` parameter is the key of the element that we want to retrieve from the data structure.
95
- * @returns The method `get(key: K)` returns the value associated with the given key if it exists in the data structure,
96
- * otherwise it returns `undefined`.
97
- */
98
- get(key) {
99
- let current = this.head;
100
- for (let i = this.level - 1; i >= 0; i--) {
101
- while (current.forward[i] && current.forward[i].key < key) {
102
- current = current.forward[i];
103
- }
104
- }
105
- current = current.forward[0];
106
- if (current && current.key === key) {
107
- return current.value;
108
- }
109
- return undefined;
110
- }
111
- /**
112
- * The `remove` function removes a node with a specific key from a Skip List data structure.
113
- * @param {K} key - The key parameter represents the key of the node that needs to be removed from the skip list.
114
- * @returns The `remove` method returns a boolean value. It returns `true` if the key was successfully removed from the
115
- * skip list, and `false` if the key was not found in the skip list.
116
- */
117
- remove(key) {
118
- const update = new Array(this.maxLevel).fill(this.head);
119
- let current = this.head;
120
- for (let i = this.level - 1; i >= 0; i--) {
121
- while (current.forward[i] && current.forward[i].key < key) {
122
- current = current.forward[i];
123
- }
124
- update[i] = current;
125
- }
126
- current = current.forward[0];
127
- if (current && current.key === key) {
128
- for (let i = 0; i < this.level; i++) {
129
- if (update[i].forward[i] !== current) {
130
- break;
131
- }
132
- update[i].forward[i] = current.forward[i];
133
- }
134
- while (this.level > 0 && this.head.forward[this.level - 1] === null) {
135
- this.level--;
136
- }
137
- return true;
138
- }
139
- return false;
140
- }
141
- }
142
- exports.SkipList = SkipList;
143
- //# sourceMappingURL=skip-linked-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skip-linked-list.js","sourceRoot":"","sources":["../../../src/data-structures/linked-list/skip-linked-list.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAa,YAAY;IAKvB,YAAY,GAAM,EAAE,KAAQ,EAAE,KAAa;QACzC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF;AAVD,oCAUC;AAED,MAAa,QAAQ;IACnB,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,QAAQ,CAAC,KAAa;QACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IACD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,IAAI,IAAI;QACN,O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3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-structures/matrix/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B"}
@@ -1,21 +0,0 @@
1
- /**
2
- * data-structure-typed
3
- *
4
- * @author Tyler Zeng
5
- * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
- * @license MIT License
7
- */
8
- export declare class MatrixNTI2D<V = any> {
9
- private readonly _matrix;
10
- /**
11
- * The constructor creates a matrix with the specified number of rows and columns, and initializes all elements to a
12
- * given initial value or 0 if not provided.
13
- * @param options - An object containing the following properties:
14
- */
15
- constructor(options: {
16
- row: number;
17
- col: number;
18
- initialVal?: V;
19
- });
20
- toArray(): Array<Array<V>>;
21
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"matrix.js","sourceRoot":"","sources":["../../../src/data-structures/matrix/matrix.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,2BAA2B;AAC3B,MAAa,WAAW;IAGtB;;;;OAIG;IACH,YAAY,OAAmD;QAC7D,MAAM,EAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC;IAED;mGAC+F;IAC/F,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAlBD,kCAkBC"}
@@ -1,108 +0,0 @@
1
- /**
2
- * data-structure-typed
3
- *
4
- * @author Tyler Zeng
5
- * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
- * @license MIT License
7
- */
8
- import Vector2D from './vector2d';
9
- export declare class Matrix2D {
10
- private readonly _matrix;
11
- /**
12
- * The constructor function initializes a Matrix2D object with either a default identity matrix, or a provided matrix
13
- * or Vector2D object.
14
- * @param {number[][] | Vector2D} [value] - The `value` parameter can be either a 2D array of numbers (`number[][]`) or
15
- * an instance of the `Vector2D` class.
16
- */
17
- constructor(value?: number[][] | Vector2D);
18
- /**
19
- * The function returns a 2D array with three empty arrays.
20
- * @returns An empty 2-dimensional array with 3 empty arrays inside.
21
- */
22
- static get empty(): number[][];
23
- /**
24
- * The above function returns a 3x3 identity matrix.
25
- * @returns The method is returning a 2-dimensional array of numbers representing the identity matrix.
26
- */
27
- static get identity(): number[][];
28
- /**
29
- * The function returns a two-dimensional array of numbers.
30
- * @returns The getter method is returning the value of the private variable `_matrix`, which is a two-dimensional
31
- * array of numbers.
32
- */
33
- get m(): number[][];
34
- /**
35
- * The function "toVector" returns a new Vector2D object with the values from the first and second elements of the
36
- * _matrix array.
37
- * @returns A new instance of the Vector2D class is being returned. The values of the returned vector are taken from
38
- * the first column of the matrix.
39
- */
40
- toVector(): Vector2D;
41
- /**
42
- * The function takes two 2D matrices as input and returns their sum as a new 2D matrix.
43
- * @param {Matrix2D} matrix1 - Matrix2D - The first matrix to be added.
44
- * @param {Matrix2D} matrix2 - The parameter `matrix2` is a Matrix2D object.
45
- * @returns a new instance of the Matrix2D class, which is created using the result array.
46
- */
47
- static add(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
48
- /**
49
- * The function subtracts two 2D matrices and returns the result as a new Matrix2D object.
50
- * @param {Matrix2D} matrix1 - Matrix2D - The first matrix to subtract from.
51
- * @param {Matrix2D} matrix2 - Matrix2D is a class representing a 2D matrix. It has a property `m` which is a 2D array
52
- * representing the matrix elements.
53
- * @returns a new instance of the Matrix2D class, which is created using the result array.
54
- */
55
- static subtract(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
56
- /**
57
- * The function multiplies two 2D matrices and returns the result as a new Matrix2D object.
58
- * @param {Matrix2D} matrix1 - A 2D matrix represented by the Matrix2D class.
59
- * @param {Matrix2D} matrix2 - The parameter `matrix2` is a 2D matrix of size 3x3.
60
- * @returns a new instance of the Matrix2D class, created using the result array.
61
- */
62
- static multiply(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
63
- /**
64
- * The function multiplies each element of a 2D matrix by a given value and returns the resulting matrix.
65
- * @param {Matrix2D} matrix - The `matrix` parameter is an instance of the `Matrix2D` class, which represents a 2D
66
- * matrix. It contains a property `m` that is a 2D array representing the matrix elements.
67
- * @param {number} value - The `value` parameter is a number that you want to multiply each element of the `matrix` by.
68
- * @returns a new instance of the Matrix2D class, which is created using the result array.
69
- */
70
- static multiplyByValue(matrix: Matrix2D, value: number): Matrix2D;
71
- /**
72
- * The function multiplies a 2D matrix by a 2D vector and returns the result as a 2D vector.
73
- * @param {Matrix2D} matrix - The parameter "matrix" is of type Matrix2D. It represents a 2-dimensional matrix.
74
- * @param {Vector2D} vector - The "vector" parameter is a 2D vector, represented by an object of type Vector2D.
75
- * @returns a Vector2D.
76
- */
77
- static multiplyByVector(matrix: Matrix2D, vector: Vector2D): Vector2D;
78
- /**
79
- * The function returns a 2D matrix that scales and flips a vector around the center of a given width and height.
80
- * @param {number} width - The width parameter represents the width of the view or the canvas. It is a number that
81
- * specifies the width in pixels or any other unit of measurement.
82
- * @param {number} height - The height parameter represents the height of the view or the canvas. It is used to
83
- * calculate the centerY value, which is the vertical center of the view.
84
- * @returns a Matrix2D object.
85
- */
86
- static view(width: number, height: number): Matrix2D;
87
- /**
88
- * The function scales a matrix by a given factor.
89
- * @param {number} factor - The factor parameter is a number that represents the scaling factor by which the matrix
90
- * should be scaled.
91
- * @returns the result of multiplying a new instance of Matrix2D by the given factor.
92
- */
93
- static scale(factor: number): Matrix2D;
94
- /**
95
- * The function "rotate" takes an angle in radians and returns a 2D transformation matrix for rotating objects.
96
- * @param {number} radians - The "radians" parameter is the angle in radians by which you want to rotate an object.
97
- * @returns The code is returning a new instance of a Matrix2D object.
98
- */
99
- static rotate(radians: number): Matrix2D;
100
- /**
101
- * The translate function takes a 2D vector and returns a 2D matrix that represents a translation transformation.
102
- * @param {Vector2D} vector - The parameter "vector" is of type Vector2D. It represents a 2D vector with components x
103
- * and y, and an optional w component.
104
- * @returns The method is returning a new instance of the Matrix2D class.
105
- */
106
- static translate(vector: Vector2D): Matrix2D;
107
- }
108
- export default Matrix2D;
@@ -1,201 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Matrix2D = void 0;
4
- /**
5
- * data-structure-typed
6
- *
7
- * @author Tyler Zeng
8
- * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
9
- * @license MIT License
10
- */
11
- const vector2d_1 = require("./vector2d");
12
- class Matrix2D {
13
- /**
14
- * The constructor function initializes a Matrix2D object with either a default identity matrix, or a provided matrix
15
- * or Vector2D object.
16
- * @param {number[][] | Vector2D} [value] - The `value` parameter can be either a 2D array of numbers (`number[][]`) or
17
- * an instance of the `Vector2D` class.
18
- */
19
- constructor(value) {
20
- if (typeof value === 'undefined') {
21
- this._matrix = Matrix2D.identity;
22
- }
23
- else if (value instanceof vector2d_1.default) {
24
- this._matrix = Matrix2D.identity;
25
- this._matrix[0][0] = value.x;
26
- this._matrix[1][0] = value.y;
27
- this._matrix[2][0] = value.w;
28
- }
29
- else {
30
- this._matrix = value;
31
- }
32
- }
33
- /**
34
- * The function returns a 2D array with three empty arrays.
35
- * @returns An empty 2-dimensional array with 3 empty arrays inside.
36
- */
37
- static get empty() {
38
- return [[], [], []];
39
- }
40
- /**
41
- * The above function returns a 3x3 identity matrix.
42
- * @returns The method is returning a 2-dimensional array of numbers representing the identity matrix.
43
- */
44
- static get identity() {
45
- return [
46
- [1, 0, 0],
47
- [0, 1, 0],
48
- [0, 0, 1]
49
- ];
50
- }
51
- /**
52
- * The function returns a two-dimensional array of numbers.
53
- * @returns The getter method is returning the value of the private variable `_matrix`, which is a two-dimensional
54
- * array of numbers.
55
- */
56
- get m() {
57
- return this._matrix;
58
- }
59
- /**
60
- * The function "toVector" returns a new Vector2D object with the values from the first and second elements of the
61
- * _matrix array.
62
- * @returns A new instance of the Vector2D class is being returned. The values of the returned vector are taken from
63
- * the first column of the matrix.
64
- */
65
- toVector() {
66
- return new vector2d_1.default(this._matrix[0][0], this._matrix[1][0]);
67
- }
68
- /**
69
- * The function takes two 2D matrices as input and returns their sum as a new 2D matrix.
70
- * @param {Matrix2D} matrix1 - Matrix2D - The first matrix to be added.
71
- * @param {Matrix2D} matrix2 - The parameter `matrix2` is a Matrix2D object.
72
- * @returns a new instance of the Matrix2D class, which is created using the result array.
73
- */
74
- static add(matrix1, matrix2) {
75
- const result = Matrix2D.empty;
76
- for (let i = 0; i < 3; i++) {
77
- for (let j = 0; j < 3; j++) {
78
- result[i][j] = matrix1.m[i][j] + matrix2.m[i][j];
79
- }
80
- }
81
- return new Matrix2D(result);
82
- }
83
- /**
84
- * The function subtracts two 2D matrices and returns the result as a new Matrix2D object.
85
- * @param {Matrix2D} matrix1 - Matrix2D - The first matrix to subtract from.
86
- * @param {Matrix2D} matrix2 - Matrix2D is a class representing a 2D matrix. It has a property `m` which is a 2D array
87
- * representing the matrix elements.
88
- * @returns a new instance of the Matrix2D class, which is created using the result array.
89
- */
90
- static subtract(matrix1, matrix2) {
91
- const result = Matrix2D.empty;
92
- for (let i = 0; i < 3; i++) {
93
- for (let j = 0; j < 3; j++) {
94
- result[i][j] = matrix1.m[i][j] - matrix2.m[i][j];
95
- }
96
- }
97
- return new Matrix2D(result);
98
- }
99
- /**
100
- * The function multiplies two 2D matrices and returns the result as a new Matrix2D object.
101
- * @param {Matrix2D} matrix1 - A 2D matrix represented by the Matrix2D class.
102
- * @param {Matrix2D} matrix2 - The parameter `matrix2` is a 2D matrix of size 3x3.
103
- * @returns a new instance of the Matrix2D class, created using the result array.
104
- */
105
- static multiply(matrix1, matrix2) {
106
- const result = Matrix2D.empty;
107
- for (let i = 0; i < 3; i++) {
108
- for (let j = 0; j < 3; j++) {
109
- result[i][j] = 0;
110
- for (let k = 0; k < 3; k++) {
111
- result[i][j] += matrix1.m[i][k] * matrix2.m[k][j];
112
- }
113
- }
114
- }
115
- return new Matrix2D(result);
116
- }
117
- /**
118
- * The function multiplies each element of a 2D matrix by a given value and returns the resulting matrix.
119
- * @param {Matrix2D} matrix - The `matrix` parameter is an instance of the `Matrix2D` class, which represents a 2D
120
- * matrix. It contains a property `m` that is a 2D array representing the matrix elements.
121
- * @param {number} value - The `value` parameter is a number that you want to multiply each element of the `matrix` by.
122
- * @returns a new instance of the Matrix2D class, which is created using the result array.
123
- */
124
- static multiplyByValue(matrix, value) {
125
- const result = Matrix2D.empty;
126
- for (let i = 0; i < 3; i++) {
127
- for (let j = 0; j < 3; j++) {
128
- result[i][j] = matrix.m[i][j] * value;
129
- }
130
- }
131
- return new Matrix2D(result);
132
- }
133
- /**
134
- * The function multiplies a 2D matrix by a 2D vector and returns the result as a 2D vector.
135
- * @param {Matrix2D} matrix - The parameter "matrix" is of type Matrix2D. It represents a 2-dimensional matrix.
136
- * @param {Vector2D} vector - The "vector" parameter is a 2D vector, represented by an object of type Vector2D.
137
- * @returns a Vector2D.
138
- */
139
- static multiplyByVector(matrix, vector) {
140
- const resultMatrix = Matrix2D.multiply(matrix, new Matrix2D(vector));
141
- return resultMatrix.toVector();
142
- }
143
- /**
144
- * The function returns a 2D matrix that scales and flips a vector around the center of a given width and height.
145
- * @param {number} width - The width parameter represents the width of the view or the canvas. It is a number that
146
- * specifies the width in pixels or any other unit of measurement.
147
- * @param {number} height - The height parameter represents the height of the view or the canvas. It is used to
148
- * calculate the centerY value, which is the vertical center of the view.
149
- * @returns a Matrix2D object.
150
- */
151
- static view(width, height) {
152
- const scaleStep = 1; // Scale every vector * scaleStep
153
- const centerX = width / 2;
154
- const centerY = height / 2;
155
- const flipX = Math.cos(Math.PI); // rotate 180deg / 3.14radian around X-axis
156
- return new Matrix2D([
157
- [scaleStep, 0, centerX],
158
- [0, flipX * scaleStep, centerY],
159
- [0, 0, 1]
160
- ]);
161
- }
162
- /**
163
- * The function scales a matrix by a given factor.
164
- * @param {number} factor - The factor parameter is a number that represents the scaling factor by which the matrix
165
- * should be scaled.
166
- * @returns the result of multiplying a new instance of Matrix2D by the given factor.
167
- */
168
- static scale(factor) {
169
- return Matrix2D.multiplyByValue(new Matrix2D(), factor);
170
- }
171
- /**
172
- * The function "rotate" takes an angle in radians and returns a 2D transformation matrix for rotating objects.
173
- * @param {number} radians - The "radians" parameter is the angle in radians by which you want to rotate an object.
174
- * @returns The code is returning a new instance of a Matrix2D object.
175
- */
176
- static rotate(radians) {
177
- const cos = Math.cos(radians);
178
- const sin = Math.sin(radians);
179
- return new Matrix2D([
180
- [cos, -sin, 0],
181
- [sin, cos, 0],
182
- [0, 0, 1]
183
- ]);
184
- }
185
- /**
186
- * The translate function takes a 2D vector and returns a 2D matrix that represents a translation transformation.
187
- * @param {Vector2D} vector - The parameter "vector" is of type Vector2D. It represents a 2D vector with components x
188
- * and y, and an optional w component.
189
- * @returns The method is returning a new instance of the Matrix2D class.
190
- */
191
- static translate(vector) {
192
- return new Matrix2D([
193
- [1, 0, vector.x],
194
- [0, 1, vector.y],
195
- [0, 0, vector.w]
196
- ]);
197
- }
198
- }
199
- exports.Matrix2D = Matrix2D;
200
- exports.default = Matrix2D;
201
- //# sourceMappingURL=matrix2d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matrix2d.js","sourceRoot":"","sources":["../../../src/data-structures/matrix/matrix2d.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,yCAAkC;AAElC,MAAa,QAAQ;IAGnB;;;;;OAKG;IACH,YAAY,KAA6B;QACvC,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC;SAClC;aAAM,IAAI,KAAK,YAAY,kBAAQ,EAAE;YACpC,IAAI,CAAC,OAAO,GAAG,QAA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(c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
- * @license MIT License
7
- */
8
- import type { Direction, NavigatorParams, Turning } from '../../types';
9
- export declare class Character {
10
- direction: Direction;
11
- turn: () => Character;
12
- /**
13
- * The constructor function takes in a direction and turning object and sets the direction and turn properties of the
14
- * Character class.
15
- * @param {Direction} direction - The direction parameter is used to specify the current direction of the character. It
16
- * can be any value that represents a direction, such as "north", "south", "east", or "west".
17
- * @param {Turning} turning - The `turning` parameter is an object that maps each direction to the corresponding
18
- * turning direction. It is used to determine the new direction when the character turns.
19
- */
20
- constructor(direction: Direction, turning: Turning);
21
- }
22
- export declare class Navigator<T = number> {
23
- onMove: (cur: [number, number]) => void;
24
- private readonly _matrix;
25
- private readonly _cur;
26
- private _character;
27
- private readonly _VISITED;
28
- /**
29
- * The constructor initializes the Navigator object with the given parameters and sets the current position as visited
30
- * in the matrix.
31
- * @param - - `matrix`: a 2D array representing the grid or map
32
- */
33
- constructor({ matrix, turning, onMove, init: { cur, charDir, VISITED } }: NavigatorParams<T>);
34
- /**
35
- * The "start" function moves the character in its current direction until it encounters an obstacle, then it turns the
36
- * character and repeats the process.
37
- */
38
- start(): void;
39
- /**
40
- * The function checks if there is a valid move in the specified direction in a matrix.
41
- * @param {Direction} direction - The direction parameter is a string that represents the direction in which to check.
42
- * It can be one of the following values: 'up', 'right', 'down', or 'left'.
43
- * @returns a boolean value.
44
- */
45
- check(direction: Direction): boolean;
46
- /**
47
- * The `move` function updates the current position based on the given direction and updates the matrix accordingly.
48
- * @param {Direction} direction - The `direction` parameter is a string that represents the direction in which to move.
49
- * It can have one of the following values: 'up', 'right', 'down', or 'left'.
50
- */
51
- move(direction: Direction): void;
52
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigator.js","sourceRoot":"","sources":["../../../src/data-structures/matrix/navigator.ts"],"names":[],"mappings":";;;AASA,MAAa,SAAS;IAIpB;;;;;;;OAOG;IACH,YAAY,SAAoB,EAAE,OAAgB;QAChD,IAAI,CAAC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