data-structure-typed 1.38.1 → 1.38.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (763) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
  4. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  5. package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.d.ts +9 -9
  6. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
  7. package/{lib → dist/cjs}/data-structures/binary-tree/bst.d.ts +4 -4
  8. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
  9. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
  10. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
  11. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
  12. package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
  13. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
  14. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
  15. package/dist/cjs/data-structures/graph/index.js.map +1 -0
  16. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
  17. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
  18. package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
  19. package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
  20. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
  21. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
  22. package/dist/cjs/data-structures/hash/index.js.map +1 -0
  23. package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
  24. package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
  25. package/dist/cjs/data-structures/heap/heap.js.map +1 -0
  26. package/dist/cjs/data-structures/heap/index.js.map +1 -0
  27. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
  28. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
  29. package/dist/cjs/data-structures/index.js.map +1 -0
  30. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  31. package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
  32. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
  33. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
  34. package/dist/cjs/data-structures/matrix/index.js.map +1 -0
  35. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
  36. package/{lib → dist/cjs}/data-structures/matrix/matrix2d.js +13 -5
  37. package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
  38. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
  39. package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
  40. package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
  41. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  42. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  43. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
  44. package/dist/cjs/data-structures/queue/deque.js.map +1 -0
  45. package/dist/cjs/data-structures/queue/index.js.map +1 -0
  46. package/dist/cjs/data-structures/queue/queue.js.map +1 -0
  47. package/dist/cjs/data-structures/stack/index.js.map +1 -0
  48. package/dist/cjs/data-structures/stack/stack.js.map +1 -0
  49. package/dist/cjs/data-structures/tree/index.js.map +1 -0
  50. package/dist/cjs/data-structures/tree/tree.js.map +1 -0
  51. package/dist/cjs/data-structures/trie/index.js.map +1 -0
  52. package/dist/cjs/data-structures/trie/trie.js.map +1 -0
  53. package/dist/cjs/index.js.map +1 -0
  54. package/dist/cjs/interfaces/binary-tree.js.map +1 -0
  55. package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
  56. package/dist/{interfaces → cjs/interfaces}/graph.js.map +1 -1
  57. package/dist/{interfaces → cjs/interfaces}/heap.js.map +1 -1
  58. package/dist/cjs/interfaces/index.js.map +1 -0
  59. package/dist/{interfaces → cjs/interfaces}/navigator.js.map +1 -1
  60. package/dist/cjs/interfaces/priority-queue.js.map +1 -0
  61. package/dist/cjs/interfaces/segment-tree.js.map +1 -0
  62. package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
  63. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  64. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  65. package/{lib → dist/cjs}/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  66. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  67. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
  68. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
  69. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  70. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  71. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  72. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
  73. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
  74. package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
  75. package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
  76. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
  77. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
  78. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
  79. package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
  80. package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
  81. package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
  82. package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
  83. package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
  84. package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
  85. package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
  86. package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
  87. package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
  88. package/dist/cjs/types/data-structures/index.js.map +1 -0
  89. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  90. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
  91. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  92. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  93. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
  94. package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
  95. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
  96. package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
  97. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
  98. package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
  99. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  100. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  101. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  102. package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
  103. package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
  104. package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
  105. package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
  106. package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
  107. package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
  108. package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
  109. package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
  110. package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
  111. package/{lib → dist/cjs}/types/helpers.d.ts +1 -1
  112. package/dist/cjs/types/helpers.js.map +1 -0
  113. package/dist/cjs/types/index.js.map +1 -0
  114. package/dist/cjs/types/utils/index.js.map +1 -0
  115. package/dist/{types → cjs/types}/utils/utils.js.map +1 -1
  116. package/dist/cjs/types/utils/validate-type.js.map +1 -0
  117. package/dist/cjs/utils/index.js.map +1 -0
  118. package/dist/cjs/utils/utils.js.map +1 -0
  119. package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.js +10 -4
  120. package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.js +12 -3
  121. package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.d.ts +9 -9
  122. package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.js +66 -49
  123. package/dist/{data-structures → mjs/data-structures}/binary-tree/bst.d.ts +4 -4
  124. package/{lib → dist/mjs}/data-structures/binary-tree/bst.js +42 -40
  125. package/dist/mjs/data-structures/binary-tree/index.js +23 -0
  126. package/dist/mjs/data-structures/binary-tree/rb-tree.js +28 -0
  127. package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.js +17 -10
  128. package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.js +19 -13
  129. package/{lib → dist/mjs}/data-structures/graph/abstract-graph.js +29 -24
  130. package/{lib → dist/mjs}/data-structures/graph/directed-graph.js +22 -14
  131. package/dist/mjs/data-structures/graph/index.js +20 -0
  132. package/{lib → dist/mjs}/data-structures/graph/map-graph.js +14 -5
  133. package/{lib → dist/mjs}/data-structures/graph/undirected-graph.js +19 -13
  134. package/{lib → dist/mjs}/data-structures/hash/coordinate-map.js +6 -2
  135. package/{lib → dist/mjs}/data-structures/hash/coordinate-set.js +6 -2
  136. package/{lib → dist/mjs}/data-structures/hash/hash-map.js +11 -1
  137. package/{lib → dist/mjs}/data-structures/hash/hash-table.js +16 -4
  138. package/dist/mjs/data-structures/hash/index.js +22 -0
  139. package/dist/mjs/data-structures/hash/tree-map.js +6 -0
  140. package/dist/mjs/data-structures/hash/tree-set.js +6 -0
  141. package/{lib → dist/mjs}/data-structures/heap/heap.js +23 -7
  142. package/dist/mjs/data-structures/heap/index.js +19 -0
  143. package/{lib → dist/mjs}/data-structures/heap/max-heap.js +6 -2
  144. package/{lib → dist/mjs}/data-structures/heap/min-heap.js +6 -2
  145. package/dist/mjs/data-structures/index.js +27 -0
  146. package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.js +15 -6
  147. package/dist/mjs/data-structures/linked-list/index.js +19 -0
  148. package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.js +12 -2
  149. package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.js +14 -2
  150. package/dist/mjs/data-structures/matrix/index.js +20 -0
  151. package/{lib → dist/mjs}/data-structures/matrix/matrix.js +6 -1
  152. package/dist/{data-structures → mjs/data-structures}/matrix/matrix2d.js +5 -2
  153. package/{lib → dist/mjs}/data-structures/matrix/navigator.js +14 -2
  154. package/{lib → dist/mjs}/data-structures/matrix/vector2d.js +9 -2
  155. package/dist/mjs/data-structures/priority-queue/index.js +19 -0
  156. package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.js +6 -2
  157. package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.js +6 -2
  158. package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
  159. package/{lib → dist/mjs}/data-structures/queue/deque.js +21 -22
  160. package/dist/mjs/data-structures/queue/index.js +18 -0
  161. package/{lib → dist/mjs}/data-structures/queue/queue.js +11 -5
  162. package/dist/mjs/data-structures/stack/index.js +17 -0
  163. package/{lib → dist/mjs}/data-structures/stack/stack.js +6 -1
  164. package/dist/mjs/data-structures/tree/index.js +17 -0
  165. package/{lib → dist/mjs}/data-structures/tree/tree.js +8 -1
  166. package/dist/mjs/data-structures/trie/index.js +17 -0
  167. package/{lib → dist/mjs}/data-structures/trie/trie.js +12 -2
  168. package/dist/mjs/index.js +20 -0
  169. package/dist/mjs/interfaces/binary-tree.js +2 -0
  170. package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
  171. package/dist/mjs/interfaces/graph.js +2 -0
  172. package/dist/mjs/interfaces/heap.js +2 -0
  173. package/dist/mjs/interfaces/index.js +24 -0
  174. package/dist/mjs/interfaces/navigator.js +2 -0
  175. package/dist/mjs/interfaces/priority-queue.js +2 -0
  176. package/dist/mjs/interfaces/segment-tree.js +2 -0
  177. package/dist/mjs/interfaces/singly-linked-list.js +2 -0
  178. package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
  179. package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  180. package/dist/{types → mjs/types}/data-structures/binary-tree/binary-tree.d.ts +1 -1
  181. package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-tree.js +7 -4
  182. package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
  183. package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
  184. package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +8 -0
  185. package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
  186. package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
  187. package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
  188. package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
  189. package/dist/mjs/types/data-structures/graph/index.js +19 -0
  190. package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
  191. package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
  192. package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
  193. package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
  194. package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
  195. package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
  196. package/dist/mjs/types/data-structures/hash/index.js +2 -0
  197. package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
  198. package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
  199. package/dist/mjs/types/data-structures/heap/heap.js +2 -0
  200. package/dist/mjs/types/data-structures/heap/index.js +17 -0
  201. package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
  202. package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
  203. package/dist/mjs/types/data-structures/index.js +27 -0
  204. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  205. package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
  206. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
  207. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
  208. package/dist/mjs/types/data-structures/matrix/index.js +17 -0
  209. package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
  210. package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
  211. package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
  212. package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
  213. package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
  214. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  215. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  216. package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
  217. package/dist/mjs/types/data-structures/queue/deque.js +2 -0
  218. package/dist/mjs/types/data-structures/queue/index.js +18 -0
  219. package/dist/mjs/types/data-structures/queue/queue.js +2 -0
  220. package/dist/mjs/types/data-structures/stack/index.js +17 -0
  221. package/dist/mjs/types/data-structures/stack/stack.js +2 -0
  222. package/dist/mjs/types/data-structures/tree/index.js +17 -0
  223. package/dist/mjs/types/data-structures/tree/tree.js +2 -0
  224. package/dist/mjs/types/data-structures/trie/index.js +17 -0
  225. package/dist/mjs/types/data-structures/trie/trie.js +2 -0
  226. package/dist/{types → mjs/types}/helpers.d.ts +1 -1
  227. package/dist/mjs/types/helpers.js +9 -0
  228. package/dist/mjs/types/index.js +19 -0
  229. package/dist/mjs/types/utils/index.js +18 -0
  230. package/dist/mjs/types/utils/utils.js +2 -0
  231. package/dist/mjs/types/utils/validate-type.js +2 -0
  232. package/dist/mjs/utils/index.js +17 -0
  233. package/dist/mjs/utils/utils.js +64 -0
  234. package/dist/umd/index.global.js +27 -0
  235. package/dist/umd/index.global.js.map +1 -0
  236. package/package.json +21 -23
  237. package/src/data-structures/binary-tree/binary-tree.ts +19 -19
  238. package/src/data-structures/binary-tree/bst.ts +7 -7
  239. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  240. package/src/types/helpers.ts +1 -1
  241. package/test/integration/index.html +3 -4
  242. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +23 -7
  243. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +2 -1
  244. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +20 -1
  245. package/test/unit/data-structures/hash/hash-table.test.ts +1 -1
  246. package/test/unit/data-structures/matrix/navigator.test.ts +1 -1
  247. package/test/unit/data-structures/queue/deque.test.ts +1 -1
  248. package/test/unit/data-structures/queue/queue.test.ts +1 -1
  249. package/tsconfig-base.json +27 -0
  250. package/tsconfig-cjs.json +9 -0
  251. package/tsup.config.js +11 -0
  252. package/umd/bundle.min.js +1 -1
  253. package/umd/bundle.min.js.map +1 -1
  254. package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
  255. package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  256. package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
  257. package/dist/data-structures/binary-tree/bst.js.map +0 -1
  258. package/dist/data-structures/binary-tree/index.js.map +0 -1
  259. package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
  260. package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
  261. package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
  262. package/dist/data-structures/graph/abstract-graph.js.map +0 -1
  263. package/dist/data-structures/graph/directed-graph.js.map +0 -1
  264. package/dist/data-structures/graph/index.js.map +0 -1
  265. package/dist/data-structures/graph/map-graph.js.map +0 -1
  266. package/dist/data-structures/graph/undirected-graph.js.map +0 -1
  267. package/dist/data-structures/hash/coordinate-map.js.map +0 -1
  268. package/dist/data-structures/hash/coordinate-set.js.map +0 -1
  269. package/dist/data-structures/hash/hash-map.js.map +0 -1
  270. package/dist/data-structures/hash/hash-table.js.map +0 -1
  271. package/dist/data-structures/hash/index.js.map +0 -1
  272. package/dist/data-structures/hash/tree-map.js.map +0 -1
  273. package/dist/data-structures/hash/tree-set.js.map +0 -1
  274. package/dist/data-structures/heap/heap.js.map +0 -1
  275. package/dist/data-structures/heap/index.js.map +0 -1
  276. package/dist/data-structures/heap/max-heap.js.map +0 -1
  277. package/dist/data-structures/heap/min-heap.js.map +0 -1
  278. package/dist/data-structures/index.js.map +0 -1
  279. package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  280. package/dist/data-structures/linked-list/index.js.map +0 -1
  281. package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
  282. package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
  283. package/dist/data-structures/matrix/index.js.map +0 -1
  284. package/dist/data-structures/matrix/matrix.js.map +0 -1
  285. package/dist/data-structures/matrix/matrix2d.js.map +0 -1
  286. package/dist/data-structures/matrix/navigator.js.map +0 -1
  287. package/dist/data-structures/matrix/vector2d.js.map +0 -1
  288. package/dist/data-structures/priority-queue/index.js.map +0 -1
  289. package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  290. package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  291. package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
  292. package/dist/data-structures/queue/deque.js.map +0 -1
  293. package/dist/data-structures/queue/index.js.map +0 -1
  294. package/dist/data-structures/queue/queue.js.map +0 -1
  295. package/dist/data-structures/stack/index.js.map +0 -1
  296. package/dist/data-structures/stack/stack.js.map +0 -1
  297. package/dist/data-structures/tree/index.js.map +0 -1
  298. package/dist/data-structures/tree/tree.js.map +0 -1
  299. package/dist/data-structures/trie/index.js.map +0 -1
  300. package/dist/data-structures/trie/trie.js.map +0 -1
  301. package/dist/index.js.map +0 -1
  302. package/dist/interfaces/binary-tree.js.map +0 -1
  303. package/dist/interfaces/doubly-linked-list.js.map +0 -1
  304. package/dist/interfaces/index.js.map +0 -1
  305. package/dist/interfaces/priority-queue.js.map +0 -1
  306. package/dist/interfaces/segment-tree.js.map +0 -1
  307. package/dist/interfaces/singly-linked-list.js.map +0 -1
  308. package/dist/types/data-structures/binary-tree/avl-tree.js.map +0 -1
  309. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  310. package/dist/types/data-structures/binary-tree/binary-tree.js.map +0 -1
  311. package/dist/types/data-structures/binary-tree/bst.js.map +0 -1
  312. package/dist/types/data-structures/binary-tree/index.js.map +0 -1
  313. package/dist/types/data-structures/binary-tree/rb-tree.js.map +0 -1
  314. package/dist/types/data-structures/binary-tree/segment-tree.js.map +0 -1
  315. package/dist/types/data-structures/binary-tree/tree-multiset.js.map +0 -1
  316. package/dist/types/data-structures/graph/abstract-graph.js.map +0 -1
  317. package/dist/types/data-structures/graph/directed-graph.js.map +0 -1
  318. package/dist/types/data-structures/graph/index.js.map +0 -1
  319. package/dist/types/data-structures/graph/map-graph.js.map +0 -1
  320. package/dist/types/data-structures/graph/undirected-graph.js.map +0 -1
  321. package/dist/types/data-structures/hash/coordinate-map.js.map +0 -1
  322. package/dist/types/data-structures/hash/coordinate-set.js.map +0 -1
  323. package/dist/types/data-structures/hash/hash-map.js.map +0 -1
  324. package/dist/types/data-structures/hash/hash-table.js.map +0 -1
  325. package/dist/types/data-structures/hash/index.js.map +0 -1
  326. package/dist/types/data-structures/hash/tree-map.js.map +0 -1
  327. package/dist/types/data-structures/hash/tree-set.js.map +0 -1
  328. package/dist/types/data-structures/heap/heap.js.map +0 -1
  329. package/dist/types/data-structures/heap/index.js.map +0 -1
  330. package/dist/types/data-structures/heap/max-heap.js.map +0 -1
  331. package/dist/types/data-structures/heap/min-heap.js.map +0 -1
  332. package/dist/types/data-structures/index.js.map +0 -1
  333. package/dist/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  334. package/dist/types/data-structures/linked-list/index.js.map +0 -1
  335. package/dist/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
  336. package/dist/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
  337. package/dist/types/data-structures/matrix/index.js.map +0 -1
  338. package/dist/types/data-structures/matrix/matrix.js.map +0 -1
  339. package/dist/types/data-structures/matrix/matrix2d.js.map +0 -1
  340. package/dist/types/data-structures/matrix/navigator.js.map +0 -1
  341. package/dist/types/data-structures/matrix/vector2d.js.map +0 -1
  342. package/dist/types/data-structures/priority-queue/index.js.map +0 -1
  343. package/dist/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  344. package/dist/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  345. package/dist/types/data-structures/priority-queue/priority-queue.js.map +0 -1
  346. package/dist/types/data-structures/queue/deque.js.map +0 -1
  347. package/dist/types/data-structures/queue/index.js.map +0 -1
  348. package/dist/types/data-structures/queue/queue.js.map +0 -1
  349. package/dist/types/data-structures/stack/index.js.map +0 -1
  350. package/dist/types/data-structures/stack/stack.js.map +0 -1
  351. package/dist/types/data-structures/tree/index.js.map +0 -1
  352. package/dist/types/data-structures/tree/tree.js.map +0 -1
  353. package/dist/types/data-structures/trie/index.js.map +0 -1
  354. package/dist/types/data-structures/trie/trie.js.map +0 -1
  355. package/dist/types/helpers.js.map +0 -1
  356. package/dist/types/index.js.map +0 -1
  357. package/dist/types/utils/index.js.map +0 -1
  358. package/dist/types/utils/validate-type.js.map +0 -1
  359. package/dist/utils/index.js.map +0 -1
  360. package/dist/utils/utils.js.map +0 -1
  361. package/lib/data-structures/binary-tree/index.js +0 -7
  362. package/lib/data-structures/binary-tree/rb-tree.js +0 -22
  363. package/lib/data-structures/graph/index.js +0 -4
  364. package/lib/data-structures/hash/index.js +0 -6
  365. package/lib/data-structures/hash/tree-map.js +0 -2
  366. package/lib/data-structures/hash/tree-set.js +0 -2
  367. package/lib/data-structures/heap/index.js +0 -3
  368. package/lib/data-structures/index.js +0 -11
  369. package/lib/data-structures/linked-list/index.js +0 -3
  370. package/lib/data-structures/matrix/index.js +0 -4
  371. package/lib/data-structures/priority-queue/index.js +0 -3
  372. package/lib/data-structures/priority-queue/priority-queue.js +0 -13
  373. package/lib/data-structures/queue/index.js +0 -2
  374. package/lib/data-structures/stack/index.js +0 -1
  375. package/lib/data-structures/tree/index.js +0 -1
  376. package/lib/data-structures/trie/index.js +0 -1
  377. package/lib/index.js +0 -4
  378. package/lib/interfaces/binary-tree.js +0 -1
  379. package/lib/interfaces/doubly-linked-list.js +0 -1
  380. package/lib/interfaces/graph.js +0 -1
  381. package/lib/interfaces/heap.js +0 -1
  382. package/lib/interfaces/index.js +0 -8
  383. package/lib/interfaces/navigator.js +0 -1
  384. package/lib/interfaces/priority-queue.js +0 -1
  385. package/lib/interfaces/segment-tree.js +0 -1
  386. package/lib/interfaces/singly-linked-list.js +0 -1
  387. package/lib/types/data-structures/binary-tree/avl-tree.js +0 -1
  388. package/lib/types/data-structures/binary-tree/binary-indexed-tree.js +0 -1
  389. package/lib/types/data-structures/binary-tree/bst.js +0 -1
  390. package/lib/types/data-structures/binary-tree/index.js +0 -6
  391. package/lib/types/data-structures/binary-tree/rb-tree.js +0 -5
  392. package/lib/types/data-structures/binary-tree/segment-tree.js +0 -1
  393. package/lib/types/data-structures/binary-tree/tree-multiset.js +0 -1
  394. package/lib/types/data-structures/graph/abstract-graph.js +0 -1
  395. package/lib/types/data-structures/graph/directed-graph.js +0 -6
  396. package/lib/types/data-structures/graph/index.js +0 -3
  397. package/lib/types/data-structures/graph/map-graph.js +0 -1
  398. package/lib/types/data-structures/graph/undirected-graph.js +0 -1
  399. package/lib/types/data-structures/hash/coordinate-map.js +0 -1
  400. package/lib/types/data-structures/hash/coordinate-set.js +0 -1
  401. package/lib/types/data-structures/hash/hash-map.js +0 -1
  402. package/lib/types/data-structures/hash/hash-table.js +0 -1
  403. package/lib/types/data-structures/hash/index.js +0 -1
  404. package/lib/types/data-structures/hash/tree-map.js +0 -1
  405. package/lib/types/data-structures/hash/tree-set.js +0 -1
  406. package/lib/types/data-structures/heap/heap.js +0 -1
  407. package/lib/types/data-structures/heap/index.js +0 -1
  408. package/lib/types/data-structures/heap/max-heap.js +0 -1
  409. package/lib/types/data-structures/heap/min-heap.js +0 -1
  410. package/lib/types/data-structures/index.js +0 -11
  411. package/lib/types/data-structures/linked-list/doubly-linked-list.js +0 -1
  412. package/lib/types/data-structures/linked-list/index.js +0 -2
  413. package/lib/types/data-structures/linked-list/singly-linked-list.js +0 -1
  414. package/lib/types/data-structures/linked-list/skip-linked-list.js +0 -1
  415. package/lib/types/data-structures/matrix/index.js +0 -1
  416. package/lib/types/data-structures/matrix/matrix.js +0 -1
  417. package/lib/types/data-structures/matrix/matrix2d.js +0 -1
  418. package/lib/types/data-structures/matrix/navigator.js +0 -1
  419. package/lib/types/data-structures/matrix/vector2d.js +0 -1
  420. package/lib/types/data-structures/priority-queue/index.js +0 -3
  421. package/lib/types/data-structures/priority-queue/max-priority-queue.js +0 -1
  422. package/lib/types/data-structures/priority-queue/min-priority-queue.js +0 -1
  423. package/lib/types/data-structures/priority-queue/priority-queue.js +0 -1
  424. package/lib/types/data-structures/queue/deque.js +0 -1
  425. package/lib/types/data-structures/queue/index.js +0 -2
  426. package/lib/types/data-structures/queue/queue.js +0 -1
  427. package/lib/types/data-structures/stack/index.js +0 -1
  428. package/lib/types/data-structures/stack/stack.js +0 -1
  429. package/lib/types/data-structures/tree/index.js +0 -1
  430. package/lib/types/data-structures/tree/tree.js +0 -1
  431. package/lib/types/data-structures/trie/index.js +0 -1
  432. package/lib/types/data-structures/trie/trie.js +0 -1
  433. package/lib/types/helpers.js +0 -6
  434. package/lib/types/index.js +0 -3
  435. package/lib/types/utils/index.js +0 -2
  436. package/lib/types/utils/utils.js +0 -1
  437. package/lib/types/utils/validate-type.js +0 -1
  438. package/lib/utils/index.js +0 -1
  439. package/lib/utils/utils.js +0 -63
  440. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.d.ts +0 -0
  441. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.js +0 -0
  442. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  443. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  444. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.js +0 -0
  445. /package/dist/{data-structures → cjs/data-structures}/binary-tree/bst.js +0 -0
  446. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.d.ts +0 -0
  447. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.js +0 -0
  448. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.d.ts +0 -0
  449. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.js +0 -0
  450. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.d.ts +0 -0
  451. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.js +0 -0
  452. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.d.ts +0 -0
  453. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.js +0 -0
  454. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.d.ts +0 -0
  455. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.js +0 -0
  456. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.d.ts +0 -0
  457. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.js +0 -0
  458. /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
  459. /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
  460. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.d.ts +0 -0
  461. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.js +0 -0
  462. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.d.ts +0 -0
  463. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.js +0 -0
  464. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.d.ts +0 -0
  465. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.js +0 -0
  466. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.d.ts +0 -0
  467. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.js +0 -0
  468. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.d.ts +0 -0
  469. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.js +0 -0
  470. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.d.ts +0 -0
  471. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.js +0 -0
  472. /package/dist/{data-structures → cjs/data-structures}/hash/index.d.ts +0 -0
  473. /package/dist/{data-structures → cjs/data-structures}/hash/index.js +0 -0
  474. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
  475. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
  476. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
  477. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
  478. /package/dist/{data-structures → cjs/data-structures}/heap/heap.d.ts +0 -0
  479. /package/dist/{data-structures → cjs/data-structures}/heap/heap.js +0 -0
  480. /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
  481. /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
  482. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.d.ts +0 -0
  483. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.js +0 -0
  484. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.d.ts +0 -0
  485. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.js +0 -0
  486. /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
  487. /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
  488. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  489. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.js +0 -0
  490. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
  491. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
  492. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  493. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.js +0 -0
  494. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  495. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.js +0 -0
  496. /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
  497. /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
  498. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.d.ts +0 -0
  499. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
  500. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix2d.d.ts +0 -0
  501. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.d.ts +0 -0
  502. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
  503. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.d.ts +0 -0
  504. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.js +0 -0
  505. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
  506. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
  507. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  508. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.js +0 -0
  509. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  510. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.js +0 -0
  511. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.d.ts +0 -0
  512. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.js +0 -0
  513. /package/dist/{data-structures → cjs/data-structures}/queue/deque.d.ts +0 -0
  514. /package/dist/{data-structures → cjs/data-structures}/queue/deque.js +0 -0
  515. /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
  516. /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
  517. /package/dist/{data-structures → cjs/data-structures}/queue/queue.d.ts +0 -0
  518. /package/dist/{data-structures → cjs/data-structures}/queue/queue.js +0 -0
  519. /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
  520. /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
  521. /package/dist/{data-structures → cjs/data-structures}/stack/stack.d.ts +0 -0
  522. /package/dist/{data-structures → cjs/data-structures}/stack/stack.js +0 -0
  523. /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
  524. /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
  525. /package/dist/{data-structures → cjs/data-structures}/tree/tree.d.ts +0 -0
  526. /package/dist/{data-structures → cjs/data-structures}/tree/tree.js +0 -0
  527. /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
  528. /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
  529. /package/dist/{data-structures → cjs/data-structures}/trie/trie.d.ts +0 -0
  530. /package/dist/{data-structures → cjs/data-structures}/trie/trie.js +0 -0
  531. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  532. /package/dist/{index.js → cjs/index.js} +0 -0
  533. /package/dist/{interfaces → cjs/interfaces}/binary-tree.d.ts +0 -0
  534. /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
  535. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
  536. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
  537. /package/dist/{interfaces → cjs/interfaces}/graph.d.ts +0 -0
  538. /package/dist/{interfaces → cjs/interfaces}/graph.js +0 -0
  539. /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
  540. /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
  541. /package/dist/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  542. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  543. /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
  544. /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
  545. /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
  546. /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
  547. /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
  548. /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
  549. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
  550. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
  551. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  552. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.js +0 -0
  553. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  554. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  555. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-tree.js +0 -0
  556. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.d.ts +0 -0
  557. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.js +0 -0
  558. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.d.ts +0 -0
  559. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.js +0 -0
  560. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  561. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.js +0 -0
  562. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  563. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.js +0 -0
  564. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  565. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.js +0 -0
  566. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.d.ts +0 -0
  567. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.js +0 -0
  568. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.d.ts +0 -0
  569. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.js +0 -0
  570. /package/dist/{types → cjs/types}/data-structures/graph/index.d.ts +0 -0
  571. /package/dist/{types → cjs/types}/data-structures/graph/index.js +0 -0
  572. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.d.ts +0 -0
  573. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.js +0 -0
  574. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.d.ts +0 -0
  575. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.js +0 -0
  576. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.d.ts +0 -0
  577. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.js +0 -0
  578. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.d.ts +0 -0
  579. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.js +0 -0
  580. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.d.ts +0 -0
  581. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.js +0 -0
  582. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.d.ts +0 -0
  583. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.js +0 -0
  584. /package/dist/{types → cjs/types}/data-structures/hash/index.d.ts +0 -0
  585. /package/dist/{types → cjs/types}/data-structures/hash/index.js +0 -0
  586. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.d.ts +0 -0
  587. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.js +0 -0
  588. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.d.ts +0 -0
  589. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.js +0 -0
  590. /package/dist/{types → cjs/types}/data-structures/heap/heap.d.ts +0 -0
  591. /package/dist/{types → cjs/types}/data-structures/heap/heap.js +0 -0
  592. /package/dist/{types → cjs/types}/data-structures/heap/index.d.ts +0 -0
  593. /package/dist/{types → cjs/types}/data-structures/heap/index.js +0 -0
  594. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.d.ts +0 -0
  595. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.js +0 -0
  596. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.d.ts +0 -0
  597. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.js +0 -0
  598. /package/dist/{types → cjs/types}/data-structures/index.d.ts +0 -0
  599. /package/dist/{types → cjs/types}/data-structures/index.js +0 -0
  600. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  601. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  602. /package/dist/{types → cjs/types}/data-structures/linked-list/index.d.ts +0 -0
  603. /package/dist/{types → cjs/types}/data-structures/linked-list/index.js +0 -0
  604. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  605. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.js +0 -0
  606. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  607. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.js +0 -0
  608. /package/dist/{types → cjs/types}/data-structures/matrix/index.d.ts +0 -0
  609. /package/dist/{types → cjs/types}/data-structures/matrix/index.js +0 -0
  610. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.d.ts +0 -0
  611. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.js +0 -0
  612. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.d.ts +0 -0
  613. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.js +0 -0
  614. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.d.ts +0 -0
  615. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.js +0 -0
  616. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.d.ts +0 -0
  617. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.js +0 -0
  618. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
  619. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.js +0 -0
  620. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  621. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  622. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  623. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  624. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  625. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.js +0 -0
  626. /package/dist/{types → cjs/types}/data-structures/queue/deque.d.ts +0 -0
  627. /package/dist/{types → cjs/types}/data-structures/queue/deque.js +0 -0
  628. /package/dist/{types → cjs/types}/data-structures/queue/index.d.ts +0 -0
  629. /package/dist/{types → cjs/types}/data-structures/queue/index.js +0 -0
  630. /package/dist/{types → cjs/types}/data-structures/queue/queue.d.ts +0 -0
  631. /package/dist/{types → cjs/types}/data-structures/queue/queue.js +0 -0
  632. /package/dist/{types → cjs/types}/data-structures/stack/index.d.ts +0 -0
  633. /package/dist/{types → cjs/types}/data-structures/stack/index.js +0 -0
  634. /package/dist/{types → cjs/types}/data-structures/stack/stack.d.ts +0 -0
  635. /package/dist/{types → cjs/types}/data-structures/stack/stack.js +0 -0
  636. /package/dist/{types → cjs/types}/data-structures/tree/index.d.ts +0 -0
  637. /package/dist/{types → cjs/types}/data-structures/tree/index.js +0 -0
  638. /package/dist/{types → cjs/types}/data-structures/tree/tree.d.ts +0 -0
  639. /package/dist/{types → cjs/types}/data-structures/tree/tree.js +0 -0
  640. /package/dist/{types → cjs/types}/data-structures/trie/index.d.ts +0 -0
  641. /package/dist/{types → cjs/types}/data-structures/trie/index.js +0 -0
  642. /package/dist/{types → cjs/types}/data-structures/trie/trie.d.ts +0 -0
  643. /package/dist/{types → cjs/types}/data-structures/trie/trie.js +0 -0
  644. /package/dist/{types → cjs/types}/helpers.js +0 -0
  645. /package/dist/{types → cjs/types}/index.d.ts +0 -0
  646. /package/dist/{types → cjs/types}/index.js +0 -0
  647. /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
  648. /package/dist/{types → cjs/types}/utils/index.js +0 -0
  649. /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
  650. /package/dist/{types → cjs/types}/utils/utils.js +0 -0
  651. /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
  652. /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
  653. /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
  654. /package/dist/{utils → cjs/utils}/index.js +0 -0
  655. /package/dist/{utils → cjs/utils}/utils.d.ts +0 -0
  656. /package/dist/{utils → cjs/utils}/utils.js +0 -0
  657. /package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  658. /package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  659. /package/{lib → dist/mjs}/data-structures/binary-tree/index.d.ts +0 -0
  660. /package/{lib → dist/mjs}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  661. /package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  662. /package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  663. /package/{lib → dist/mjs}/data-structures/graph/abstract-graph.d.ts +0 -0
  664. /package/{lib → dist/mjs}/data-structures/graph/directed-graph.d.ts +0 -0
  665. /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
  666. /package/{lib → dist/mjs}/data-structures/graph/map-graph.d.ts +0 -0
  667. /package/{lib → dist/mjs}/data-structures/graph/undirected-graph.d.ts +0 -0
  668. /package/{lib → dist/mjs}/data-structures/hash/coordinate-map.d.ts +0 -0
  669. /package/{lib → dist/mjs}/data-structures/hash/coordinate-set.d.ts +0 -0
  670. /package/{lib → dist/mjs}/data-structures/hash/hash-map.d.ts +0 -0
  671. /package/{lib → dist/mjs}/data-structures/hash/hash-table.d.ts +0 -0
  672. /package/{lib → dist/mjs}/data-structures/hash/index.d.ts +0 -0
  673. /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
  674. /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
  675. /package/{lib → dist/mjs}/data-structures/heap/heap.d.ts +0 -0
  676. /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
  677. /package/{lib → dist/mjs}/data-structures/heap/max-heap.d.ts +0 -0
  678. /package/{lib → dist/mjs}/data-structures/heap/min-heap.d.ts +0 -0
  679. /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
  680. /package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  681. /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
  682. /package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  683. /package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  684. /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
  685. /package/{lib → dist/mjs}/data-structures/matrix/matrix.d.ts +0 -0
  686. /package/{lib → dist/mjs}/data-structures/matrix/matrix2d.d.ts +0 -0
  687. /package/{lib → dist/mjs}/data-structures/matrix/navigator.d.ts +0 -0
  688. /package/{lib → dist/mjs}/data-structures/matrix/vector2d.d.ts +0 -0
  689. /package/{lib → dist/mjs}/data-structures/priority-queue/index.d.ts +0 -0
  690. /package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  691. /package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  692. /package/{lib → dist/mjs}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  693. /package/{lib → dist/mjs}/data-structures/queue/deque.d.ts +0 -0
  694. /package/{lib → dist/mjs}/data-structures/queue/index.d.ts +0 -0
  695. /package/{lib → dist/mjs}/data-structures/queue/queue.d.ts +0 -0
  696. /package/{lib → dist/mjs}/data-structures/stack/index.d.ts +0 -0
  697. /package/{lib → dist/mjs}/data-structures/stack/stack.d.ts +0 -0
  698. /package/{lib → dist/mjs}/data-structures/tree/index.d.ts +0 -0
  699. /package/{lib → dist/mjs}/data-structures/tree/tree.d.ts +0 -0
  700. /package/{lib → dist/mjs}/data-structures/trie/index.d.ts +0 -0
  701. /package/{lib → dist/mjs}/data-structures/trie/trie.d.ts +0 -0
  702. /package/{lib → dist/mjs}/index.d.ts +0 -0
  703. /package/{lib → dist/mjs}/interfaces/binary-tree.d.ts +0 -0
  704. /package/{lib → dist/mjs}/interfaces/doubly-linked-list.d.ts +0 -0
  705. /package/{lib → dist/mjs}/interfaces/graph.d.ts +0 -0
  706. /package/{lib → dist/mjs}/interfaces/heap.d.ts +0 -0
  707. /package/{lib → dist/mjs}/interfaces/index.d.ts +0 -0
  708. /package/{lib → dist/mjs}/interfaces/navigator.d.ts +0 -0
  709. /package/{lib → dist/mjs}/interfaces/priority-queue.d.ts +0 -0
  710. /package/{lib → dist/mjs}/interfaces/segment-tree.d.ts +0 -0
  711. /package/{lib → dist/mjs}/interfaces/singly-linked-list.d.ts +0 -0
  712. /package/{lib → dist/mjs}/types/data-structures/binary-tree/avl-tree.d.ts +0 -0
  713. /package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  714. /package/{lib → dist/mjs}/types/data-structures/binary-tree/bst.d.ts +0 -0
  715. /package/{lib → dist/mjs}/types/data-structures/binary-tree/index.d.ts +0 -0
  716. /package/{lib → dist/mjs}/types/data-structures/binary-tree/rb-tree.d.ts +0 -0
  717. /package/{lib → dist/mjs}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
  718. /package/{lib → dist/mjs}/types/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  719. /package/{lib → dist/mjs}/types/data-structures/graph/abstract-graph.d.ts +0 -0
  720. /package/{lib → dist/mjs}/types/data-structures/graph/directed-graph.d.ts +0 -0
  721. /package/{lib → dist/mjs}/types/data-structures/graph/index.d.ts +0 -0
  722. /package/{lib → dist/mjs}/types/data-structures/graph/map-graph.d.ts +0 -0
  723. /package/{lib → dist/mjs}/types/data-structures/graph/undirected-graph.d.ts +0 -0
  724. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-map.d.ts +0 -0
  725. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-set.d.ts +0 -0
  726. /package/{lib → dist/mjs}/types/data-structures/hash/hash-map.d.ts +0 -0
  727. /package/{lib → dist/mjs}/types/data-structures/hash/hash-table.d.ts +0 -0
  728. /package/{lib → dist/mjs}/types/data-structures/hash/index.d.ts +0 -0
  729. /package/{lib → dist/mjs}/types/data-structures/hash/tree-map.d.ts +0 -0
  730. /package/{lib → dist/mjs}/types/data-structures/hash/tree-set.d.ts +0 -0
  731. /package/{lib → dist/mjs}/types/data-structures/heap/heap.d.ts +0 -0
  732. /package/{lib → dist/mjs}/types/data-structures/heap/index.d.ts +0 -0
  733. /package/{lib → dist/mjs}/types/data-structures/heap/max-heap.d.ts +0 -0
  734. /package/{lib → dist/mjs}/types/data-structures/heap/min-heap.d.ts +0 -0
  735. /package/{lib → dist/mjs}/types/data-structures/index.d.ts +0 -0
  736. /package/{lib → dist/mjs}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  737. /package/{lib → dist/mjs}/types/data-structures/linked-list/index.d.ts +0 -0
  738. /package/{lib → dist/mjs}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  739. /package/{lib → dist/mjs}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  740. /package/{lib → dist/mjs}/types/data-structures/matrix/index.d.ts +0 -0
  741. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix.d.ts +0 -0
  742. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix2d.d.ts +0 -0
  743. /package/{lib → dist/mjs}/types/data-structures/matrix/navigator.d.ts +0 -0
  744. /package/{lib → dist/mjs}/types/data-structures/matrix/vector2d.d.ts +0 -0
  745. /package/{lib → dist/mjs}/types/data-structures/priority-queue/index.d.ts +0 -0
  746. /package/{lib → dist/mjs}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  747. /package/{lib → dist/mjs}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  748. /package/{lib → dist/mjs}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
  749. /package/{lib → dist/mjs}/types/data-structures/queue/deque.d.ts +0 -0
  750. /package/{lib → dist/mjs}/types/data-structures/queue/index.d.ts +0 -0
  751. /package/{lib → dist/mjs}/types/data-structures/queue/queue.d.ts +0 -0
  752. /package/{lib → dist/mjs}/types/data-structures/stack/index.d.ts +0 -0
  753. /package/{lib → dist/mjs}/types/data-structures/stack/stack.d.ts +0 -0
  754. /package/{lib → dist/mjs}/types/data-structures/tree/index.d.ts +0 -0
  755. /package/{lib → dist/mjs}/types/data-structures/tree/tree.d.ts +0 -0
  756. /package/{lib → dist/mjs}/types/data-structures/trie/index.d.ts +0 -0
  757. /package/{lib → dist/mjs}/types/data-structures/trie/trie.d.ts +0 -0
  758. /package/{lib → dist/mjs}/types/index.d.ts +0 -0
  759. /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
  760. /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
  761. /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
  762. /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
  763. /package/{lib → dist/mjs}/utils/utils.d.ts +0 -0
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractGraph = exports.AbstractEdge = exports.AbstractVertex = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,10 +8,10 @@
5
8
  * @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- import { arrayRemove, uuidV4 } from '../../utils';
9
- import { PriorityQueue } from '../priority-queue';
10
- import { Queue } from '../queue';
11
- export class AbstractVertex {
11
+ const utils_1 = require("../../utils");
12
+ const priority_queue_1 = require("../priority-queue");
13
+ const queue_1 = require("../queue");
14
+ class AbstractVertex {
12
15
  /**
13
16
  * The function is a protected constructor that takes an key and an optional value as parameters.
14
17
  * @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
@@ -20,12 +23,14 @@ export class AbstractVertex {
20
23
  this._key = key;
21
24
  this._val = val;
22
25
  }
26
+ _key;
23
27
  get key() {
24
28
  return this._key;
25
29
  }
26
30
  set key(v) {
27
31
  this._key = v;
28
32
  }
33
+ _val;
29
34
  get val() {
30
35
  return this._val;
31
36
  }
@@ -33,7 +38,8 @@ export class AbstractVertex {
33
38
  this._val = value;
34
39
  }
35
40
  }
36
- export class AbstractEdge {
41
+ exports.AbstractVertex = AbstractVertex;
42
+ class AbstractEdge {
37
43
  /**
38
44
  * The above function is a protected constructor that initializes the weight, value, and hash code properties of an
39
45
  * object.
@@ -46,20 +52,23 @@ export class AbstractEdge {
46
52
  constructor(weight, val) {
47
53
  this._weight = weight !== undefined ? weight : 1;
48
54
  this._val = val;
49
- this._hashCode = uuidV4();
55
+ this._hashCode = (0, utils_1.uuidV4)();
50
56
  }
57
+ _val;
51
58
  get val() {
52
59
  return this._val;
53
60
  }
54
61
  set val(value) {
55
62
  this._val = value;
56
63
  }
64
+ _weight;
57
65
  get weight() {
58
66
  return this._weight;
59
67
  }
60
68
  set weight(v) {
61
69
  this._weight = v;
62
70
  }
71
+ _hashCode;
63
72
  get hashCode() {
64
73
  return this._hashCode;
65
74
  }
@@ -76,10 +85,9 @@ export class AbstractEdge {
76
85
  this._hashCode = v;
77
86
  }
78
87
  }
79
- export class AbstractGraph {
80
- constructor() {
81
- this._vertices = new Map();
82
- }
88
+ exports.AbstractEdge = AbstractEdge;
89
+ class AbstractGraph {
90
+ _vertices = new Map();
83
91
  get vertices() {
84
92
  return this._vertices;
85
93
  }
@@ -212,7 +220,7 @@ export class AbstractGraph {
212
220
  if (!visiting.get(neighbor)) {
213
221
  path.push(neighbor);
214
222
  dfs(neighbor, dest, visiting, path);
215
- arrayRemove(path, (vertex) => vertex === neighbor);
223
+ (0, utils_1.arrayRemove)(path, (vertex) => vertex === neighbor);
216
224
  }
217
225
  }
218
226
  visiting.set(cur, false);
@@ -226,10 +234,9 @@ export class AbstractGraph {
226
234
  * @returns The function `getPathSumWeight` returns the sum of the weights of the edges in the given path.
227
235
  */
228
236
  getPathSumWeight(path) {
229
- var _a;
230
237
  let sum = 0;
231
238
  for (let i = 0; i < path.length; i++) {
232
- sum += ((_a = this.getEdge(path[i], path[i + 1])) === null || _a === void 0 ? void 0 : _a.weight) || 0;
239
+ sum += this.getEdge(path[i], path[i + 1])?.weight || 0;
233
240
  }
234
241
  return sum;
235
242
  }
@@ -266,7 +273,7 @@ export class AbstractGraph {
266
273
  return null;
267
274
  }
268
275
  const visited = new Map();
269
- const queue = new Queue([vertex1]);
276
+ const queue = new queue_1.Queue([vertex1]);
270
277
  visited.set(vertex1, true);
271
278
  let cost = 0;
272
279
  while (queue.size > 0) {
@@ -341,7 +348,7 @@ export class AbstractGraph {
341
348
  if (!visiting.get(neighbor)) {
342
349
  path.push(neighbor);
343
350
  dfs(neighbor, dest, visiting, path);
344
- arrayRemove(path, (vertex) => vertex === neighbor);
351
+ (0, utils_1.arrayRemove)(path, (vertex) => vertex === neighbor);
345
352
  }
346
353
  }
347
354
  visiting.set(cur, false);
@@ -500,7 +507,6 @@ export class AbstractGraph {
500
507
  * @returns The function `dijkstra` returns an object of type `DijkstraResult<V>`.
501
508
  */
502
509
  dijkstra(src, dest, getMinDist, genPaths) {
503
- var _a;
504
510
  if (getMinDist === undefined)
505
511
  getMinDist = false;
506
512
  if (genPaths === undefined)
@@ -524,7 +530,7 @@ export class AbstractGraph {
524
530
  if (vertexOrKey instanceof AbstractVertex)
525
531
  distMap.set(vertexOrKey, Infinity);
526
532
  }
527
- const heap = new PriorityQueue((a, b) => a.key - b.key);
533
+ const heap = new priority_queue_1.PriorityQueue((a, b) => a.key - b.key);
528
534
  heap.add({ key: 0, val: srcVertex });
529
535
  distMap.set(srcVertex, 0);
530
536
  preMap.set(srcVertex, null);
@@ -552,8 +558,8 @@ export class AbstractGraph {
552
558
  };
553
559
  while (heap.size > 0) {
554
560
  const curHeapNode = heap.poll();
555
- const dist = curHeapNode === null || curHeapNode === void 0 ? void 0 : curHeapNode.key;
556
- const cur = curHeapNode === null || curHeapNode === void 0 ? void 0 : curHeapNode.val;
561
+ const dist = curHeapNode?.key;
562
+ const cur = curHeapNode?.val;
557
563
  if (dist !== undefined) {
558
564
  if (cur) {
559
565
  seen.add(cur);
@@ -569,7 +575,7 @@ export class AbstractGraph {
569
575
  const neighbors = this.getNeighbors(cur);
570
576
  for (const neighbor of neighbors) {
571
577
  if (!seen.has(neighbor)) {
572
- const weight = (_a = this.getEdge(cur, neighbor)) === null || _a === void 0 ? void 0 : _a.weight;
578
+ const weight = this.getEdge(cur, neighbor)?.weight;
573
579
  if (typeof weight === 'number') {
574
580
  const distSrcToNeighbor = distMap.get(neighbor);
575
581
  if (distSrcToNeighbor) {
@@ -743,7 +749,6 @@ export class AbstractGraph {
743
749
  * path between vertices in the
744
750
  */
745
751
  floyd() {
746
- var _a;
747
752
  const idAndVertices = [...this._vertices];
748
753
  const n = idAndVertices.length;
749
754
  const costs = [];
@@ -758,7 +763,7 @@ export class AbstractGraph {
758
763
  }
759
764
  for (let i = 0; i < n; i++) {
760
765
  for (let j = 0; j < n; j++) {
761
- costs[i][j] = ((_a = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])) === null || _a === void 0 ? void 0 : _a.weight) || Infinity;
766
+ costs[i][j] = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])?.weight || Infinity;
762
767
  }
763
768
  }
764
769
  for (let k = 0; k < n; k++) {
@@ -869,12 +874,11 @@ export class AbstractGraph {
869
874
  const getSCCs = () => {
870
875
  const SCCs = new Map();
871
876
  lowMap.forEach((low, vertex) => {
872
- var _a;
873
877
  if (!SCCs.has(low)) {
874
878
  SCCs.set(low, [vertex]);
875
879
  }
876
880
  else {
877
- (_a = SCCs.get(low)) === null || _a === void 0 ? void 0 : _a.push(vertex);
881
+ SCCs.get(low)?.push(vertex);
878
882
  }
879
883
  });
880
884
  return SCCs;
@@ -915,3 +919,4 @@ export class AbstractGraph {
915
919
  this._vertices = value;
916
920
  }
917
921
  }
922
+ exports.AbstractGraph = AbstractGraph;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DirectedGraph = exports.DirectedEdge = exports.DirectedVertex = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,9 +8,9 @@
5
8
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- import { arrayRemove } from '../../utils';
9
- import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
10
- export class DirectedVertex extends AbstractVertex {
11
+ const utils_1 = require("../../utils");
12
+ const abstract_graph_1 = require("./abstract-graph");
13
+ class DirectedVertex extends abstract_graph_1.AbstractVertex {
11
14
  /**
12
15
  * The constructor function initializes a vertex with an optional value.
13
16
  * @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
@@ -19,7 +22,8 @@ export class DirectedVertex extends AbstractVertex {
19
22
  super(key, val);
20
23
  }
21
24
  }
22
- export class DirectedEdge extends AbstractEdge {
25
+ exports.DirectedVertex = DirectedVertex;
26
+ class DirectedEdge extends abstract_graph_1.AbstractEdge {
23
27
  /**
24
28
  * The constructor function initializes the source and destination vertices of an edge, along with an optional weight
25
29
  * and value.
@@ -36,12 +40,14 @@ export class DirectedEdge extends AbstractEdge {
36
40
  this._src = src;
37
41
  this._dest = dest;
38
42
  }
43
+ _src;
39
44
  get src() {
40
45
  return this._src;
41
46
  }
42
47
  set src(v) {
43
48
  this._src = v;
44
49
  }
50
+ _dest;
45
51
  get dest() {
46
52
  return this._dest;
47
53
  }
@@ -49,18 +55,19 @@ export class DirectedEdge extends AbstractEdge {
49
55
  this._dest = v;
50
56
  }
51
57
  }
52
- export class DirectedGraph extends AbstractGraph {
58
+ exports.DirectedEdge = DirectedEdge;
59
+ class DirectedGraph extends abstract_graph_1.AbstractGraph {
53
60
  /**
54
61
  * The constructor function initializes an instance of a class.
55
62
  */
56
63
  constructor() {
57
64
  super();
58
- this._outEdgeMap = new Map();
59
- this._inEdgeMap = new Map();
60
65
  }
66
+ _outEdgeMap = new Map();
61
67
  get outEdgeMap() {
62
68
  return this._outEdgeMap;
63
69
  }
70
+ _inEdgeMap = new Map();
64
71
  get inEdgeMap() {
65
72
  return this._inEdgeMap;
66
73
  }
@@ -78,7 +85,7 @@ export class DirectedGraph extends AbstractGraph {
78
85
  * @returns a new instance of a DirectedVertex object, casted as type V.
79
86
  */
80
87
  createVertex(key, val) {
81
- return new DirectedVertex(key, val !== null && val !== void 0 ? val : key);
88
+ return new DirectedVertex(key, val ?? key);
82
89
  }
83
90
  /**
84
91
  * In TypeScript, a subclass inherits the interface implementation of its parent class, without needing to implement the same interface again in the subclass. This behavior differs from Java's approach. In Java, if a parent class implements an interface, the subclass needs to explicitly implement the same interface, even if the parent class has already implemented it.
@@ -95,7 +102,7 @@ export class DirectedGraph extends AbstractGraph {
95
102
  * @returns a new instance of a DirectedEdge object, casted as type E.
96
103
  */
97
104
  createEdge(src, dest, weight, val) {
98
- return new DirectedEdge(src, dest, weight !== null && weight !== void 0 ? weight : 1, val);
105
+ return new DirectedEdge(src, dest, weight ?? 1, val);
99
106
  }
100
107
  /**
101
108
  * The `getEdge` function retrieves an edge between two vertices based on their source and destination IDs.
@@ -134,11 +141,11 @@ export class DirectedGraph extends AbstractGraph {
134
141
  }
135
142
  const srcOutEdges = this._outEdgeMap.get(src);
136
143
  if (srcOutEdges) {
137
- arrayRemove(srcOutEdges, (edge) => edge.dest === dest.key);
144
+ (0, utils_1.arrayRemove)(srcOutEdges, (edge) => edge.dest === dest.key);
138
145
  }
139
146
  const destInEdges = this._inEdgeMap.get(dest);
140
147
  if (destInEdges) {
141
- removed = arrayRemove(destInEdges, (edge) => edge.src === src.key)[0] || null;
148
+ removed = (0, utils_1.arrayRemove)(destInEdges, (edge) => edge.src === src.key)[0] || null;
142
149
  }
143
150
  return removed;
144
151
  }
@@ -155,11 +162,11 @@ export class DirectedGraph extends AbstractGraph {
155
162
  if (src && dest) {
156
163
  const srcOutEdges = this._outEdgeMap.get(src);
157
164
  if (srcOutEdges && srcOutEdges.length > 0) {
158
- arrayRemove(srcOutEdges, (edge) => edge.src === src.key);
165
+ (0, utils_1.arrayRemove)(srcOutEdges, (edge) => edge.src === src.key);
159
166
  }
160
167
  const destInEdges = this._inEdgeMap.get(dest);
161
168
  if (destInEdges && destInEdges.length > 0) {
162
- removed = arrayRemove(destInEdges, (edge) => edge.dest === dest.key)[0];
169
+ removed = (0, utils_1.arrayRemove)(destInEdges, (edge) => edge.dest === dest.key)[0];
163
170
  }
164
171
  }
165
172
  return removed;
@@ -285,7 +292,7 @@ export class DirectedGraph extends AbstractGraph {
285
292
  * @returns an array of vertices or vertex IDs in topological order. If there is a cycle in the graph, it returns null.
286
293
  */
287
294
  topologicalSort(propertyName) {
288
- propertyName = propertyName !== null && propertyName !== void 0 ? propertyName : 'key';
295
+ propertyName = propertyName ?? 'key';
289
296
  // When judging whether there is a cycle in the undirected graph, all nodes with degree of **<= 1** are enqueued
290
297
  // When judging whether there is a cycle in the directed graph, all nodes with **in degree = 0** are enqueued
291
298
  const statusMap = new Map();
@@ -414,3 +421,4 @@ export class DirectedGraph extends AbstractGraph {
414
421
  this._inEdgeMap = value;
415
422
  }
416
423
  }
424
+ exports.DirectedGraph = DirectedGraph;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./abstract-graph"), exports);
18
+ __exportStar(require("./directed-graph"), exports);
19
+ __exportStar(require("./undirected-graph"), exports);
20
+ __exportStar(require("./map-graph"), exports);
@@ -1,5 +1,8 @@
1
- import { DirectedEdge, DirectedGraph, DirectedVertex } from './directed-graph';
2
- export class MapVertex extends DirectedVertex {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapGraph = exports.MapEdge = exports.MapVertex = void 0;
4
+ const directed_graph_1 = require("./directed-graph");
5
+ class MapVertex extends directed_graph_1.DirectedVertex {
3
6
  /**
4
7
  * The constructor function initializes an object with an key, latitude, longitude, and an optional value.
5
8
  * @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex.
@@ -17,12 +20,14 @@ export class MapVertex extends DirectedVertex {
17
20
  this._lat = lat;
18
21
  this._long = long;
19
22
  }
23
+ _lat;
20
24
  get lat() {
21
25
  return this._lat;
22
26
  }
23
27
  set lat(value) {
24
28
  this._lat = value;
25
29
  }
30
+ _long;
26
31
  get long() {
27
32
  return this._long;
28
33
  }
@@ -30,7 +35,8 @@ export class MapVertex extends DirectedVertex {
30
35
  this._long = value;
31
36
  }
32
37
  }
33
- export class MapEdge extends DirectedEdge {
38
+ exports.MapVertex = MapVertex;
39
+ class MapEdge extends directed_graph_1.DirectedEdge {
34
40
  /**
35
41
  * The constructor function initializes a new instance of a class with the given source, destination, weight, and
36
42
  * value.
@@ -45,7 +51,8 @@ export class MapEdge extends DirectedEdge {
45
51
  super(src, dest, weight, val);
46
52
  }
47
53
  }
48
- export class MapGraph extends DirectedGraph {
54
+ exports.MapEdge = MapEdge;
55
+ class MapGraph extends directed_graph_1.DirectedGraph {
49
56
  /**
50
57
  * The constructor function initializes the origin and bottomRight properties of a MapGraphCoordinate object.
51
58
  * @param {MapGraphCoordinate} origin - The `origin` parameter is a `MapGraphCoordinate` object that represents the
@@ -57,16 +64,17 @@ export class MapGraph extends DirectedGraph {
57
64
  */
58
65
  constructor(origin, bottomRight) {
59
66
  super();
60
- this._origin = [0, 0];
61
67
  this._origin = origin;
62
68
  this._bottomRight = bottomRight;
63
69
  }
70
+ _origin = [0, 0];
64
71
  get origin() {
65
72
  return this._origin;
66
73
  }
67
74
  set origin(value) {
68
75
  this._origin = value;
69
76
  }
77
+ _bottomRight;
70
78
  get bottomRight() {
71
79
  return this._bottomRight;
72
80
  }
@@ -103,3 +111,4 @@ export class MapGraph extends DirectedGraph {
103
111
  return new MapEdge(src, dest, weight, val);
104
112
  }
105
113
  }
114
+ exports.MapGraph = MapGraph;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UndirectedGraph = exports.UndirectedEdge = exports.UndirectedVertex = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,9 +8,9 @@
5
8
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- import { arrayRemove } from '../../utils';
9
- import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
10
- export class UndirectedVertex extends AbstractVertex {
11
+ const utils_1 = require("../../utils");
12
+ const abstract_graph_1 = require("./abstract-graph");
13
+ class UndirectedVertex extends abstract_graph_1.AbstractVertex {
11
14
  /**
12
15
  * The constructor function initializes a vertex with an optional value.
13
16
  * @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
@@ -19,7 +22,8 @@ export class UndirectedVertex extends AbstractVertex {
19
22
  super(key, val);
20
23
  }
21
24
  }
22
- export class UndirectedEdge extends AbstractEdge {
25
+ exports.UndirectedVertex = UndirectedVertex;
26
+ class UndirectedEdge extends abstract_graph_1.AbstractEdge {
23
27
  /**
24
28
  * The constructor function creates an instance of a class with two vertex IDs, an optional weight, and an optional
25
29
  * value.
@@ -34,6 +38,7 @@ export class UndirectedEdge extends AbstractEdge {
34
38
  super(weight, val);
35
39
  this._vertices = [v1, v2];
36
40
  }
41
+ _vertices;
37
42
  get vertices() {
38
43
  return this._vertices;
39
44
  }
@@ -41,7 +46,8 @@ export class UndirectedEdge extends AbstractEdge {
41
46
  this._vertices = v;
42
47
  }
43
48
  }
44
- export class UndirectedGraph extends AbstractGraph {
49
+ exports.UndirectedEdge = UndirectedEdge;
50
+ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
45
51
  /**
46
52
  * The constructor initializes a new Map object to store edges.
47
53
  */
@@ -49,6 +55,7 @@ export class UndirectedGraph extends AbstractGraph {
49
55
  super();
50
56
  this._edges = new Map();
51
57
  }
58
+ _edges;
52
59
  get edges() {
53
60
  return this._edges;
54
61
  }
@@ -62,7 +69,7 @@ export class UndirectedGraph extends AbstractGraph {
62
69
  * @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `V`.
63
70
  */
64
71
  createVertex(key, val) {
65
- return new UndirectedVertex(key, val !== null && val !== void 0 ? val : key);
72
+ return new UndirectedVertex(key, val ?? key);
66
73
  }
67
74
  /**
68
75
  * The function creates an undirected edge between two vertices with an optional weight and value.
@@ -75,7 +82,7 @@ export class UndirectedGraph extends AbstractGraph {
75
82
  * @returns a new instance of the `UndirectedEdge` class, which is casted as type `E`.
76
83
  */
77
84
  createEdge(v1, v2, weight, val) {
78
- return new UndirectedEdge(v1, v2, weight !== null && weight !== void 0 ? weight : 1, val);
85
+ return new UndirectedEdge(v1, v2, weight ?? 1, val);
79
86
  }
80
87
  /**
81
88
  * The function `getEdge` returns the first edge that connects two vertices, or null if no such edge exists.
@@ -86,13 +93,12 @@ export class UndirectedGraph extends AbstractGraph {
86
93
  * @returns an edge (E) or null.
87
94
  */
88
95
  getEdge(v1, v2) {
89
- var _a;
90
96
  let edges = [];
91
97
  if (v1 !== null && v2 !== null) {
92
98
  const vertex1 = this._getVertex(v1);
93
99
  const vertex2 = this._getVertex(v2);
94
100
  if (vertex1 && vertex2) {
95
- edges = (_a = this._edges.get(vertex1)) === null || _a === void 0 ? void 0 : _a.filter(e => e.vertices.includes(vertex2.key));
101
+ edges = this._edges.get(vertex1)?.filter(e => e.vertices.includes(vertex2.key));
96
102
  }
97
103
  }
98
104
  return edges ? edges[0] || null : null;
@@ -113,11 +119,11 @@ export class UndirectedGraph extends AbstractGraph {
113
119
  const v1Edges = this._edges.get(vertex1);
114
120
  let removed = null;
115
121
  if (v1Edges) {
116
- removed = arrayRemove(v1Edges, (e) => e.vertices.includes(vertex2.key))[0] || null;
122
+ removed = (0, utils_1.arrayRemove)(v1Edges, (e) => e.vertices.includes(vertex2.key))[0] || null;
117
123
  }
118
124
  const v2Edges = this._edges.get(vertex2);
119
125
  if (v2Edges) {
120
- arrayRemove(v2Edges, (e) => e.vertices.includes(vertex1.key));
126
+ (0, utils_1.arrayRemove)(v2Edges, (e) => e.vertices.includes(vertex1.key));
121
127
  }
122
128
  return removed;
123
129
  }
@@ -137,10 +143,9 @@ export class UndirectedGraph extends AbstractGraph {
137
143
  * edges connected to that vertex.
138
144
  */
139
145
  degreeOf(vertexOrKey) {
140
- var _a;
141
146
  const vertex = this._getVertex(vertexOrKey);
142
147
  if (vertex) {
143
- return ((_a = this._edges.get(vertex)) === null || _a === void 0 ? void 0 : _a.length) || 0;
148
+ return this._edges.get(vertex)?.length || 0;
144
149
  }
145
150
  else {
146
151
  return 0;
@@ -244,3 +249,4 @@ export class UndirectedGraph extends AbstractGraph {
244
249
  this._edges = v;
245
250
  }
246
251
  }
252
+ exports.UndirectedGraph = UndirectedGraph;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoordinateMap = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,13 +8,13 @@
5
8
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- export class CoordinateMap extends Map {
11
+ class CoordinateMap extends Map {
9
12
  constructor(joint) {
10
13
  super();
11
- this._joint = '_';
12
14
  if (joint !== undefined)
13
15
  this._joint = joint;
14
16
  }
17
+ _joint = '_';
15
18
  get joint() {
16
19
  return this._joint;
17
20
  }
@@ -59,3 +62,4 @@ export class CoordinateMap extends Map {
59
62
  this._joint = v;
60
63
  }
61
64
  }
65
+ exports.CoordinateMap = CoordinateMap;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoordinateSet = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,13 +8,13 @@
5
8
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- export class CoordinateSet extends Set {
11
+ class CoordinateSet extends Set {
9
12
  constructor(joint) {
10
13
  super();
11
- this._joint = '_';
12
14
  if (joint !== undefined)
13
15
  this._joint = joint;
14
16
  }
17
+ _joint = '_';
15
18
  get joint() {
16
19
  return this._joint;
17
20
  }
@@ -49,3 +52,4 @@ export class CoordinateSet extends Set {
49
52
  this._joint = v;
50
53
  }
51
54
  }
55
+ exports.CoordinateSet = CoordinateSet;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HashMap = void 0;
1
4
  /**
2
5
  * data-structure-typed
3
6
  *
@@ -5,7 +8,7 @@
5
8
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
9
  * @license MIT License
7
10
  */
8
- export class HashMap {
11
+ class HashMap {
9
12
  /**
10
13
  * The constructor initializes the properties of a hash table, including the initial capacity, load factor, capacity
11
14
  * multiplier, size, table array, and hash function.
@@ -35,36 +38,42 @@ export class HashMap {
35
38
  return hash % this.table.length;
36
39
  });
37
40
  }
41
+ _initialCapacity;
38
42
  get initialCapacity() {
39
43
  return this._initialCapacity;
40
44
  }
41
45
  set initialCapacity(value) {
42
46
  this._initialCapacity = value;
43
47
  }
48
+ _loadFactor;
44
49
  get loadFactor() {
45
50
  return this._loadFactor;
46
51
  }
47
52
  set loadFactor(value) {
48
53
  this._loadFactor = value;
49
54
  }
55
+ _capacityMultiplier;
50
56
  get capacityMultiplier() {
51
57
  return this._capacityMultiplier;
52
58
  }
53
59
  set capacityMultiplier(value) {
54
60
  this._capacityMultiplier = value;
55
61
  }
62
+ _size;
56
63
  get size() {
57
64
  return this._size;
58
65
  }
59
66
  set size(value) {
60
67
  this._size = value;
61
68
  }
69
+ _table;
62
70
  get table() {
63
71
  return this._table;
64
72
  }
65
73
  set table(value) {
66
74
  this._table = value;
67
75
  }
76
+ _hashFn;
68
77
  get hashFn() {
69
78
  return this._hashFn;
70
79
  }
@@ -165,3 +174,4 @@ export class HashMap {
165
174
  this._table = newTable; // Again, here is this._table
166
175
  }
167
176
  }
177
+ exports.HashMap = HashMap;