data-structure-typed 1.43.1 → 1.44.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 (786) hide show
  1. package/.eslintrc.js +3 -1
  2. package/CHANGELOG.md +1 -1
  3. package/README.md +7 -0
  4. package/benchmark/report.html +30 -30
  5. package/benchmark/report.json +201 -147
  6. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
  7. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  8. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-tree.d.ts +8 -8
  9. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-tree.js +62 -62
  10. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
  11. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
  12. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
  13. package/dist/{mjs/src → cjs}/data-structures/binary-tree/rb-tree.d.ts +4 -4
  14. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/rb-tree.js +1 -1
  15. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
  16. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
  17. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.js +50 -50
  18. package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -0
  19. package/dist/{mjs/src → cjs}/data-structures/graph/abstract-graph.d.ts +37 -37
  20. package/dist/cjs/{src/data-structures → data-structures}/graph/abstract-graph.js +37 -37
  21. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
  22. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
  23. package/dist/cjs/data-structures/graph/index.js.map +1 -0
  24. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
  25. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
  26. package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
  27. package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
  28. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
  29. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
  30. package/dist/cjs/data-structures/hash/index.js.map +1 -0
  31. package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
  32. package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
  33. package/dist/cjs/data-structures/heap/heap.js.map +1 -0
  34. package/dist/cjs/data-structures/heap/index.js.map +1 -0
  35. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
  36. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
  37. package/dist/cjs/data-structures/index.js.map +1 -0
  38. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  39. package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
  40. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
  41. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
  42. package/dist/cjs/data-structures/matrix/index.js.map +1 -0
  43. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
  44. package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
  45. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
  46. package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
  47. package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
  48. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  49. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  50. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
  51. package/dist/cjs/data-structures/queue/deque.js.map +1 -0
  52. package/dist/cjs/data-structures/queue/index.js.map +1 -0
  53. package/dist/cjs/data-structures/queue/queue.js.map +1 -0
  54. package/dist/cjs/data-structures/stack/index.js.map +1 -0
  55. package/dist/cjs/data-structures/stack/stack.js.map +1 -0
  56. package/dist/cjs/data-structures/tree/index.js.map +1 -0
  57. package/dist/cjs/data-structures/tree/tree.js.map +1 -0
  58. package/dist/cjs/data-structures/trie/index.js.map +1 -0
  59. package/dist/cjs/data-structures/trie/trie.js.map +1 -0
  60. package/dist/cjs/index.js.map +1 -0
  61. package/dist/cjs/{src/interfaces → interfaces}/binary-tree.d.ts +1 -1
  62. package/dist/cjs/interfaces/binary-tree.js.map +1 -0
  63. package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
  64. package/dist/cjs/{src/interfaces → interfaces}/graph.js.map +1 -1
  65. package/dist/cjs/{src/interfaces → interfaces}/heap.js.map +1 -1
  66. package/dist/cjs/interfaces/index.js.map +1 -0
  67. package/dist/cjs/interfaces/navigator.js.map +1 -0
  68. package/dist/cjs/interfaces/priority-queue.js.map +1 -0
  69. package/dist/cjs/interfaces/segment-tree.js.map +1 -0
  70. package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
  71. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  72. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  73. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  74. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
  75. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
  76. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  77. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  78. package/dist/cjs/types/data-structures/binary-tree/tree-multimap.js.map +1 -0
  79. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
  80. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
  81. package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
  82. package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
  83. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
  84. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
  85. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
  86. package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
  87. package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
  88. package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
  89. package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
  90. package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
  91. package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
  92. package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
  93. package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
  94. package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
  95. package/dist/cjs/types/data-structures/index.js.map +1 -0
  96. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  97. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
  98. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  99. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  100. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
  101. package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
  102. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
  103. package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
  104. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
  105. package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
  106. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  107. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  108. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  109. package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
  110. package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
  111. package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
  112. package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
  113. package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
  114. package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
  115. package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
  116. package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
  117. package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
  118. package/dist/cjs/types/helpers.js.map +1 -0
  119. package/dist/cjs/types/index.js.map +1 -0
  120. package/dist/cjs/types/utils/index.js.map +1 -0
  121. package/dist/cjs/{src/types → types}/utils/utils.js.map +1 -1
  122. package/dist/cjs/types/utils/validate-type.js.map +1 -0
  123. package/dist/cjs/utils/index.js.map +1 -0
  124. package/dist/cjs/utils/utils.js.map +1 -0
  125. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/avl-tree.js +3 -8
  126. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.js +3 -7
  127. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-tree.d.ts +8 -8
  128. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-tree.js +97 -102
  129. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/bst.js +34 -39
  130. package/dist/mjs/data-structures/binary-tree/index.js +7 -0
  131. package/dist/{cjs/src → mjs}/data-structures/binary-tree/rb-tree.d.ts +4 -4
  132. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/rb-tree.js +43 -48
  133. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/segment-tree.js +2 -7
  134. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.js +60 -65
  135. package/dist/{cjs/src → mjs}/data-structures/graph/abstract-graph.d.ts +37 -37
  136. package/dist/mjs/{src/data-structures → data-structures}/graph/abstract-graph.js +46 -52
  137. package/dist/mjs/{src/data-structures → data-structures}/graph/directed-graph.js +9 -15
  138. package/dist/mjs/data-structures/graph/index.js +4 -0
  139. package/dist/mjs/{src/data-structures → data-structures}/graph/map-graph.js +4 -10
  140. package/dist/mjs/{src/data-structures → data-structures}/graph/undirected-graph.js +7 -13
  141. package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-map.js +1 -5
  142. package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-set.js +1 -5
  143. package/dist/mjs/{src/data-structures → data-structures}/hash/hash-map.js +1 -5
  144. package/dist/mjs/{src/data-structures → data-structures}/hash/hash-table.js +2 -7
  145. package/dist/mjs/data-structures/hash/index.js +6 -0
  146. package/dist/mjs/data-structures/hash/tree-map.js +2 -0
  147. package/dist/mjs/data-structures/hash/tree-set.js +2 -0
  148. package/dist/mjs/{src/data-structures → data-structures}/heap/heap.js +3 -9
  149. package/dist/mjs/data-structures/heap/index.js +3 -0
  150. package/dist/mjs/{src/data-structures → data-structures}/heap/max-heap.js +2 -6
  151. package/dist/mjs/{src/data-structures → data-structures}/heap/min-heap.js +2 -6
  152. package/dist/mjs/data-structures/index.js +11 -0
  153. package/dist/mjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.js +2 -7
  154. package/dist/mjs/data-structures/linked-list/index.js +3 -0
  155. package/dist/mjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.js +2 -7
  156. package/dist/mjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.js +2 -7
  157. package/dist/mjs/data-structures/matrix/index.js +4 -0
  158. package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix.js +1 -5
  159. package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix2d.js +4 -8
  160. package/dist/mjs/{src/data-structures → data-structures}/matrix/navigator.js +2 -7
  161. package/dist/mjs/{src/data-structures → data-structures}/matrix/vector2d.js +1 -5
  162. package/dist/mjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.js +2 -6
  163. package/dist/mjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.js +2 -6
  164. package/dist/mjs/data-structures/priority-queue/priority-queue.js +13 -0
  165. package/dist/mjs/{src/data-structures → data-structures}/queue/deque.js +4 -10
  166. package/dist/mjs/{src/data-structures → data-structures}/queue/queue.js +3 -8
  167. package/dist/mjs/{src/data-structures → data-structures}/stack/stack.js +1 -5
  168. package/dist/mjs/{src/data-structures → data-structures}/tree/tree.js +1 -5
  169. package/dist/mjs/{src/data-structures → data-structures}/trie/trie.js +2 -7
  170. package/dist/mjs/index.js +4 -0
  171. package/dist/mjs/{src/interfaces → interfaces}/binary-tree.d.ts +1 -1
  172. package/dist/mjs/interfaces/index.js +8 -0
  173. package/dist/mjs/{src/types → types}/data-structures/binary-tree/binary-tree.js +4 -7
  174. package/dist/mjs/types/data-structures/binary-tree/index.js +6 -0
  175. package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +5 -0
  176. package/dist/mjs/types/data-structures/graph/directed-graph.js +6 -0
  177. package/dist/mjs/types/data-structures/graph/index.js +3 -0
  178. package/dist/mjs/types/data-structures/hash/hash-table.js +1 -0
  179. package/dist/mjs/types/data-structures/hash/index.js +1 -0
  180. package/dist/mjs/types/data-structures/hash/tree-map.d.ts +1 -0
  181. package/dist/mjs/types/data-structures/hash/tree-map.js +1 -0
  182. package/dist/mjs/types/data-structures/hash/tree-set.d.ts +1 -0
  183. package/dist/mjs/types/data-structures/hash/tree-set.js +1 -0
  184. package/dist/mjs/types/data-structures/heap/heap.d.ts +1 -0
  185. package/dist/mjs/types/data-structures/heap/heap.js +1 -0
  186. package/dist/mjs/types/data-structures/heap/index.js +1 -0
  187. package/dist/mjs/types/data-structures/heap/max-heap.d.ts +1 -0
  188. package/dist/mjs/types/data-structures/heap/max-heap.js +1 -0
  189. package/dist/mjs/types/data-structures/heap/min-heap.d.ts +1 -0
  190. package/dist/mjs/types/data-structures/heap/min-heap.js +1 -0
  191. package/dist/mjs/types/data-structures/index.js +11 -0
  192. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
  193. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +1 -0
  194. package/dist/mjs/types/data-structures/linked-list/index.js +2 -0
  195. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
  196. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +1 -0
  197. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  198. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +1 -0
  199. package/dist/mjs/types/data-structures/matrix/index.js +1 -0
  200. package/dist/mjs/types/data-structures/matrix/matrix.d.ts +1 -0
  201. package/dist/mjs/types/data-structures/matrix/matrix.js +1 -0
  202. package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +1 -0
  203. package/dist/mjs/types/data-structures/matrix/matrix2d.js +1 -0
  204. package/dist/mjs/types/data-structures/matrix/navigator.js +1 -0
  205. package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +1 -0
  206. package/dist/mjs/types/data-structures/matrix/vector2d.js +1 -0
  207. package/dist/mjs/types/data-structures/priority-queue/index.d.ts +3 -0
  208. package/dist/mjs/types/data-structures/priority-queue/index.js +3 -0
  209. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  210. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +1 -0
  211. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  212. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +1 -0
  213. package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  214. package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +1 -0
  215. package/dist/mjs/types/data-structures/queue/deque.d.ts +1 -0
  216. package/dist/mjs/types/data-structures/queue/deque.js +1 -0
  217. package/dist/mjs/types/data-structures/queue/index.d.ts +2 -0
  218. package/dist/mjs/types/data-structures/queue/index.js +2 -0
  219. package/dist/mjs/types/data-structures/queue/queue.d.ts +1 -0
  220. package/dist/mjs/types/data-structures/queue/queue.js +1 -0
  221. package/dist/mjs/types/data-structures/stack/index.d.ts +1 -0
  222. package/dist/mjs/types/data-structures/stack/index.js +1 -0
  223. package/dist/mjs/types/data-structures/stack/stack.d.ts +1 -0
  224. package/dist/mjs/types/data-structures/stack/stack.js +1 -0
  225. package/dist/mjs/types/data-structures/tree/index.d.ts +1 -0
  226. package/dist/mjs/types/data-structures/tree/index.js +1 -0
  227. package/dist/mjs/types/data-structures/tree/tree.d.ts +1 -0
  228. package/dist/mjs/types/data-structures/tree/tree.js +1 -0
  229. package/dist/mjs/types/data-structures/trie/index.d.ts +1 -0
  230. package/dist/mjs/types/data-structures/trie/index.js +1 -0
  231. package/dist/mjs/types/data-structures/trie/trie.d.ts +1 -0
  232. package/dist/mjs/types/data-structures/trie/trie.js +1 -0
  233. package/dist/mjs/types/helpers.js +6 -0
  234. package/dist/mjs/types/index.js +3 -0
  235. package/dist/mjs/types/utils/index.js +2 -0
  236. package/dist/mjs/types/utils/utils.js +1 -0
  237. package/dist/mjs/types/utils/validate-type.js +1 -0
  238. package/dist/mjs/utils/index.js +1 -0
  239. package/dist/mjs/utils/utils.js +54 -0
  240. package/dist/umd/data-structure-typed.js +10593 -0
  241. package/dist/umd/data-structure-typed.min.js +5 -10
  242. package/dist/umd/data-structure-typed.min.js.map +1 -1
  243. package/package.json +14 -15
  244. package/src/data-structures/binary-tree/avl-tree.ts +2 -3
  245. package/src/data-structures/binary-tree/binary-tree.ts +85 -92
  246. package/src/data-structures/binary-tree/bst.ts +14 -22
  247. package/src/data-structures/binary-tree/rb-tree.ts +11 -20
  248. package/src/data-structures/binary-tree/tree-multimap.ts +56 -58
  249. package/src/data-structures/graph/abstract-graph.ts +6 -22
  250. package/src/data-structures/graph/directed-graph.ts +3 -9
  251. package/src/data-structures/graph/map-graph.ts +6 -6
  252. package/src/data-structures/graph/undirected-graph.ts +1 -2
  253. package/src/data-structures/heap/heap.ts +1 -6
  254. package/src/data-structures/trie/trie.ts +1 -1
  255. package/src/interfaces/binary-tree.ts +1 -1
  256. package/src/types/utils/validate-type.ts +2 -16
  257. package/test/integration/index.html +50 -4
  258. package/test/performance/data-structures/binary-tree/rb-tree.test.ts +18 -19
  259. package/test/performance/data-structures/hash/hash-map.test.ts +10 -13
  260. package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +16 -16
  261. package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +1 -3
  262. package/test/performance/data-structures/priority-queue/priority-queue.test.ts +10 -12
  263. package/test/performance/data-structures/queue/deque.test.ts +18 -19
  264. package/test/performance/data-structures/queue/queue.test.ts +18 -19
  265. package/test/performance/data-structures/stack/stack.test.ts +10 -11
  266. package/test/performance/reportor.ts +4 -5
  267. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +0 -1
  268. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +83 -61
  269. package/test/unit/data-structures/binary-tree/bst.test.ts +2 -6
  270. package/test/unit/data-structures/binary-tree/rb-tree.test.ts +34 -25
  271. package/test/unit/data-structures/graph/abstract-graph.test.ts +6 -6
  272. package/test/unit/data-structures/graph/directed-graph.test.ts +8 -28
  273. package/test/unit/data-structures/heap/heap.test.ts +1 -8
  274. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +34 -12
  275. package/test/utils/json2html.ts +2 -6
  276. package/tsconfig-base.json +0 -1
  277. package/tsconfig-cjs.json +4 -3
  278. package/tsconfig-mjs.json +5 -3
  279. package/tsup.config.js +39 -17
  280. package/dist/cjs/src/data-structures/binary-tree/avl-tree.js.map +0 -1
  281. package/dist/cjs/src/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  282. package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +0 -1
  283. package/dist/cjs/src/data-structures/binary-tree/bst.js.map +0 -1
  284. package/dist/cjs/src/data-structures/binary-tree/index.js.map +0 -1
  285. package/dist/cjs/src/data-structures/binary-tree/rb-tree.js.map +0 -1
  286. package/dist/cjs/src/data-structures/binary-tree/segment-tree.js.map +0 -1
  287. package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js.map +0 -1
  288. package/dist/cjs/src/data-structures/graph/abstract-graph.js.map +0 -1
  289. package/dist/cjs/src/data-structures/graph/directed-graph.js.map +0 -1
  290. package/dist/cjs/src/data-structures/graph/index.js.map +0 -1
  291. package/dist/cjs/src/data-structures/graph/map-graph.js.map +0 -1
  292. package/dist/cjs/src/data-structures/graph/undirected-graph.js.map +0 -1
  293. package/dist/cjs/src/data-structures/hash/coordinate-map.js.map +0 -1
  294. package/dist/cjs/src/data-structures/hash/coordinate-set.js.map +0 -1
  295. package/dist/cjs/src/data-structures/hash/hash-map.js.map +0 -1
  296. package/dist/cjs/src/data-structures/hash/hash-table.js.map +0 -1
  297. package/dist/cjs/src/data-structures/hash/index.js.map +0 -1
  298. package/dist/cjs/src/data-structures/hash/tree-map.js.map +0 -1
  299. package/dist/cjs/src/data-structures/hash/tree-set.js.map +0 -1
  300. package/dist/cjs/src/data-structures/heap/heap.js.map +0 -1
  301. package/dist/cjs/src/data-structures/heap/index.js.map +0 -1
  302. package/dist/cjs/src/data-structures/heap/max-heap.js.map +0 -1
  303. package/dist/cjs/src/data-structures/heap/min-heap.js.map +0 -1
  304. package/dist/cjs/src/data-structures/index.js.map +0 -1
  305. package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  306. package/dist/cjs/src/data-structures/linked-list/index.js.map +0 -1
  307. package/dist/cjs/src/data-structures/linked-list/singly-linked-list.js.map +0 -1
  308. package/dist/cjs/src/data-structures/linked-list/skip-linked-list.js.map +0 -1
  309. package/dist/cjs/src/data-structures/matrix/index.js.map +0 -1
  310. package/dist/cjs/src/data-structures/matrix/matrix.js.map +0 -1
  311. package/dist/cjs/src/data-structures/matrix/matrix2d.js.map +0 -1
  312. package/dist/cjs/src/data-structures/matrix/navigator.js.map +0 -1
  313. package/dist/cjs/src/data-structures/matrix/vector2d.js.map +0 -1
  314. package/dist/cjs/src/data-structures/priority-queue/index.js.map +0 -1
  315. package/dist/cjs/src/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  316. package/dist/cjs/src/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  317. package/dist/cjs/src/data-structures/priority-queue/priority-queue.js.map +0 -1
  318. package/dist/cjs/src/data-structures/queue/deque.js.map +0 -1
  319. package/dist/cjs/src/data-structures/queue/index.js.map +0 -1
  320. package/dist/cjs/src/data-structures/queue/queue.js.map +0 -1
  321. package/dist/cjs/src/data-structures/stack/index.js.map +0 -1
  322. package/dist/cjs/src/data-structures/stack/stack.js.map +0 -1
  323. package/dist/cjs/src/data-structures/tree/index.js.map +0 -1
  324. package/dist/cjs/src/data-structures/tree/tree.js.map +0 -1
  325. package/dist/cjs/src/data-structures/trie/index.js.map +0 -1
  326. package/dist/cjs/src/data-structures/trie/trie.js.map +0 -1
  327. package/dist/cjs/src/index.js.map +0 -1
  328. package/dist/cjs/src/interfaces/binary-tree.js.map +0 -1
  329. package/dist/cjs/src/interfaces/doubly-linked-list.js.map +0 -1
  330. package/dist/cjs/src/interfaces/index.js.map +0 -1
  331. package/dist/cjs/src/interfaces/navigator.js.map +0 -1
  332. package/dist/cjs/src/interfaces/priority-queue.js.map +0 -1
  333. package/dist/cjs/src/interfaces/segment-tree.js.map +0 -1
  334. package/dist/cjs/src/interfaces/singly-linked-list.js.map +0 -1
  335. package/dist/cjs/src/types/data-structures/binary-tree/avl-tree.js.map +0 -1
  336. package/dist/cjs/src/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  337. package/dist/cjs/src/types/data-structures/binary-tree/binary-tree.js.map +0 -1
  338. package/dist/cjs/src/types/data-structures/binary-tree/bst.js.map +0 -1
  339. package/dist/cjs/src/types/data-structures/binary-tree/index.js.map +0 -1
  340. package/dist/cjs/src/types/data-structures/binary-tree/rb-tree.js.map +0 -1
  341. package/dist/cjs/src/types/data-structures/binary-tree/segment-tree.js.map +0 -1
  342. package/dist/cjs/src/types/data-structures/binary-tree/tree-multimap.js.map +0 -1
  343. package/dist/cjs/src/types/data-structures/graph/abstract-graph.js.map +0 -1
  344. package/dist/cjs/src/types/data-structures/graph/directed-graph.js.map +0 -1
  345. package/dist/cjs/src/types/data-structures/graph/index.js.map +0 -1
  346. package/dist/cjs/src/types/data-structures/graph/map-graph.js.map +0 -1
  347. package/dist/cjs/src/types/data-structures/graph/undirected-graph.js.map +0 -1
  348. package/dist/cjs/src/types/data-structures/hash/coordinate-map.js.map +0 -1
  349. package/dist/cjs/src/types/data-structures/hash/coordinate-set.js.map +0 -1
  350. package/dist/cjs/src/types/data-structures/hash/hash-map.js.map +0 -1
  351. package/dist/cjs/src/types/data-structures/hash/hash-table.js.map +0 -1
  352. package/dist/cjs/src/types/data-structures/hash/index.js.map +0 -1
  353. package/dist/cjs/src/types/data-structures/hash/tree-map.js.map +0 -1
  354. package/dist/cjs/src/types/data-structures/hash/tree-set.js.map +0 -1
  355. package/dist/cjs/src/types/data-structures/heap/heap.js.map +0 -1
  356. package/dist/cjs/src/types/data-structures/heap/index.js.map +0 -1
  357. package/dist/cjs/src/types/data-structures/heap/max-heap.js.map +0 -1
  358. package/dist/cjs/src/types/data-structures/heap/min-heap.js.map +0 -1
  359. package/dist/cjs/src/types/data-structures/index.js.map +0 -1
  360. package/dist/cjs/src/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  361. package/dist/cjs/src/types/data-structures/linked-list/index.js.map +0 -1
  362. package/dist/cjs/src/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
  363. package/dist/cjs/src/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
  364. package/dist/cjs/src/types/data-structures/matrix/index.js.map +0 -1
  365. package/dist/cjs/src/types/data-structures/matrix/matrix.js.map +0 -1
  366. package/dist/cjs/src/types/data-structures/matrix/matrix2d.js.map +0 -1
  367. package/dist/cjs/src/types/data-structures/matrix/navigator.js.map +0 -1
  368. package/dist/cjs/src/types/data-structures/matrix/vector2d.js.map +0 -1
  369. package/dist/cjs/src/types/data-structures/priority-queue/index.js.map +0 -1
  370. package/dist/cjs/src/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  371. package/dist/cjs/src/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  372. package/dist/cjs/src/types/data-structures/priority-queue/priority-queue.js.map +0 -1
  373. package/dist/cjs/src/types/data-structures/queue/deque.js.map +0 -1
  374. package/dist/cjs/src/types/data-structures/queue/index.js.map +0 -1
  375. package/dist/cjs/src/types/data-structures/queue/queue.js.map +0 -1
  376. package/dist/cjs/src/types/data-structures/stack/index.js.map +0 -1
  377. package/dist/cjs/src/types/data-structures/stack/stack.js.map +0 -1
  378. package/dist/cjs/src/types/data-structures/tree/index.js.map +0 -1
  379. package/dist/cjs/src/types/data-structures/tree/tree.js.map +0 -1
  380. package/dist/cjs/src/types/data-structures/trie/index.js.map +0 -1
  381. package/dist/cjs/src/types/data-structures/trie/trie.js.map +0 -1
  382. package/dist/cjs/src/types/helpers.js.map +0 -1
  383. package/dist/cjs/src/types/index.js.map +0 -1
  384. package/dist/cjs/src/types/utils/index.js.map +0 -1
  385. package/dist/cjs/src/types/utils/validate-type.js.map +0 -1
  386. package/dist/cjs/src/utils/index.js.map +0 -1
  387. package/dist/cjs/src/utils/utils.js.map +0 -1
  388. package/dist/mjs/src/data-structures/binary-tree/index.js +0 -23
  389. package/dist/mjs/src/data-structures/graph/index.js +0 -20
  390. package/dist/mjs/src/data-structures/hash/index.js +0 -22
  391. package/dist/mjs/src/data-structures/hash/tree-map.js +0 -6
  392. package/dist/mjs/src/data-structures/hash/tree-set.js +0 -6
  393. package/dist/mjs/src/data-structures/heap/index.js +0 -19
  394. package/dist/mjs/src/data-structures/index.js +0 -27
  395. package/dist/mjs/src/data-structures/linked-list/index.js +0 -19
  396. package/dist/mjs/src/data-structures/matrix/index.js +0 -20
  397. package/dist/mjs/src/data-structures/priority-queue/index.js +0 -19
  398. package/dist/mjs/src/data-structures/priority-queue/priority-queue.js +0 -17
  399. package/dist/mjs/src/data-structures/queue/index.js +0 -18
  400. package/dist/mjs/src/data-structures/stack/index.js +0 -17
  401. package/dist/mjs/src/data-structures/tree/index.js +0 -17
  402. package/dist/mjs/src/data-structures/trie/index.js +0 -17
  403. package/dist/mjs/src/index.js +0 -20
  404. package/dist/mjs/src/interfaces/binary-tree.js +0 -2
  405. package/dist/mjs/src/interfaces/doubly-linked-list.js +0 -2
  406. package/dist/mjs/src/interfaces/graph.js +0 -2
  407. package/dist/mjs/src/interfaces/heap.js +0 -2
  408. package/dist/mjs/src/interfaces/index.js +0 -24
  409. package/dist/mjs/src/interfaces/navigator.js +0 -2
  410. package/dist/mjs/src/interfaces/priority-queue.js +0 -2
  411. package/dist/mjs/src/interfaces/segment-tree.js +0 -2
  412. package/dist/mjs/src/interfaces/singly-linked-list.js +0 -2
  413. package/dist/mjs/src/types/data-structures/binary-tree/avl-tree.js +0 -2
  414. package/dist/mjs/src/types/data-structures/binary-tree/binary-indexed-tree.js +0 -2
  415. package/dist/mjs/src/types/data-structures/binary-tree/bst.js +0 -2
  416. package/dist/mjs/src/types/data-structures/binary-tree/index.js +0 -22
  417. package/dist/mjs/src/types/data-structures/binary-tree/rb-tree.js +0 -8
  418. package/dist/mjs/src/types/data-structures/binary-tree/segment-tree.js +0 -2
  419. package/dist/mjs/src/types/data-structures/binary-tree/tree-multimap.js +0 -2
  420. package/dist/mjs/src/types/data-structures/graph/abstract-graph.js +0 -2
  421. package/dist/mjs/src/types/data-structures/graph/directed-graph.js +0 -9
  422. package/dist/mjs/src/types/data-structures/graph/index.js +0 -19
  423. package/dist/mjs/src/types/data-structures/graph/map-graph.js +0 -2
  424. package/dist/mjs/src/types/data-structures/graph/undirected-graph.js +0 -2
  425. package/dist/mjs/src/types/data-structures/hash/coordinate-map.js +0 -2
  426. package/dist/mjs/src/types/data-structures/hash/coordinate-set.js +0 -2
  427. package/dist/mjs/src/types/data-structures/hash/hash-map.js +0 -2
  428. package/dist/mjs/src/types/data-structures/hash/hash-table.js +0 -2
  429. package/dist/mjs/src/types/data-structures/hash/index.js +0 -2
  430. package/dist/mjs/src/types/data-structures/hash/tree-map.js +0 -2
  431. package/dist/mjs/src/types/data-structures/hash/tree-set.js +0 -2
  432. package/dist/mjs/src/types/data-structures/heap/heap.js +0 -2
  433. package/dist/mjs/src/types/data-structures/heap/index.js +0 -17
  434. package/dist/mjs/src/types/data-structures/heap/max-heap.js +0 -2
  435. package/dist/mjs/src/types/data-structures/heap/min-heap.js +0 -2
  436. package/dist/mjs/src/types/data-structures/index.js +0 -27
  437. package/dist/mjs/src/types/data-structures/linked-list/doubly-linked-list.js +0 -2
  438. package/dist/mjs/src/types/data-structures/linked-list/index.js +0 -18
  439. package/dist/mjs/src/types/data-structures/linked-list/singly-linked-list.js +0 -2
  440. package/dist/mjs/src/types/data-structures/linked-list/skip-linked-list.js +0 -2
  441. package/dist/mjs/src/types/data-structures/matrix/index.js +0 -17
  442. package/dist/mjs/src/types/data-structures/matrix/matrix.js +0 -2
  443. package/dist/mjs/src/types/data-structures/matrix/matrix2d.js +0 -2
  444. package/dist/mjs/src/types/data-structures/matrix/navigator.js +0 -2
  445. package/dist/mjs/src/types/data-structures/matrix/vector2d.js +0 -2
  446. package/dist/mjs/src/types/data-structures/priority-queue/index.js +0 -19
  447. package/dist/mjs/src/types/data-structures/priority-queue/max-priority-queue.js +0 -2
  448. package/dist/mjs/src/types/data-structures/priority-queue/min-priority-queue.js +0 -2
  449. package/dist/mjs/src/types/data-structures/priority-queue/priority-queue.js +0 -2
  450. package/dist/mjs/src/types/data-structures/queue/deque.js +0 -2
  451. package/dist/mjs/src/types/data-structures/queue/index.js +0 -18
  452. package/dist/mjs/src/types/data-structures/queue/queue.js +0 -2
  453. package/dist/mjs/src/types/data-structures/stack/index.js +0 -17
  454. package/dist/mjs/src/types/data-structures/stack/stack.js +0 -2
  455. package/dist/mjs/src/types/data-structures/tree/index.js +0 -17
  456. package/dist/mjs/src/types/data-structures/tree/tree.js +0 -2
  457. package/dist/mjs/src/types/data-structures/trie/index.js +0 -17
  458. package/dist/mjs/src/types/data-structures/trie/trie.js +0 -2
  459. package/dist/mjs/src/types/helpers.js +0 -9
  460. package/dist/mjs/src/types/index.js +0 -19
  461. package/dist/mjs/src/types/utils/index.js +0 -18
  462. package/dist/mjs/src/types/utils/utils.js +0 -2
  463. package/dist/mjs/src/types/utils/validate-type.js +0 -2
  464. package/dist/mjs/src/utils/index.js +0 -17
  465. package/dist/mjs/src/utils/utils.js +0 -64
  466. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
  467. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.js +0 -0
  468. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  469. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  470. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/bst.d.ts +0 -0
  471. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/bst.js +0 -0
  472. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/index.d.ts +0 -0
  473. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/index.js +0 -0
  474. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/segment-tree.d.ts +0 -0
  475. package/dist/cjs/{src/data-structures → data-structures}/binary-tree/segment-tree.js +0 -0
  476. package/dist/{mjs/src → cjs}/data-structures/binary-tree/tree-multimap.d.ts +24 -24
  477. package/dist/cjs/{src/data-structures → data-structures}/graph/directed-graph.d.ts +0 -0
  478. package/dist/cjs/{src/data-structures → data-structures}/graph/directed-graph.js +0 -0
  479. package/dist/cjs/{src/data-structures → data-structures}/graph/index.d.ts +0 -0
  480. package/dist/cjs/{src/data-structures → data-structures}/graph/index.js +0 -0
  481. package/dist/cjs/{src/data-structures → data-structures}/graph/map-graph.d.ts +0 -0
  482. package/dist/cjs/{src/data-structures → data-structures}/graph/map-graph.js +0 -0
  483. package/dist/cjs/{src/data-structures → data-structures}/graph/undirected-graph.d.ts +0 -0
  484. package/dist/cjs/{src/data-structures → data-structures}/graph/undirected-graph.js +0 -0
  485. package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-map.d.ts +0 -0
  486. package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-map.js +0 -0
  487. package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-set.d.ts +0 -0
  488. package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-set.js +0 -0
  489. package/dist/cjs/{src/data-structures → data-structures}/hash/hash-map.d.ts +0 -0
  490. package/dist/cjs/{src/data-structures → data-structures}/hash/hash-map.js +0 -0
  491. package/dist/cjs/{src/data-structures → data-structures}/hash/hash-table.d.ts +0 -0
  492. package/dist/cjs/{src/data-structures → data-structures}/hash/hash-table.js +0 -0
  493. package/dist/cjs/{src/data-structures → data-structures}/hash/index.d.ts +0 -0
  494. package/dist/cjs/{src/data-structures → data-structures}/hash/index.js +0 -0
  495. package/dist/cjs/{src/data-structures → data-structures}/hash/tree-map.d.ts +0 -0
  496. package/dist/cjs/{src/data-structures → data-structures}/hash/tree-map.js +0 -0
  497. package/dist/cjs/{src/data-structures → data-structures}/hash/tree-set.d.ts +0 -0
  498. package/dist/cjs/{src/data-structures → data-structures}/hash/tree-set.js +0 -0
  499. package/dist/cjs/{src/data-structures → data-structures}/heap/heap.d.ts +0 -0
  500. package/dist/cjs/{src/data-structures → data-structures}/heap/heap.js +0 -0
  501. package/dist/cjs/{src/data-structures → data-structures}/heap/index.d.ts +0 -0
  502. package/dist/cjs/{src/data-structures → data-structures}/heap/index.js +0 -0
  503. package/dist/cjs/{src/data-structures → data-structures}/heap/max-heap.d.ts +0 -0
  504. package/dist/cjs/{src/data-structures → data-structures}/heap/max-heap.js +0 -0
  505. package/dist/cjs/{src/data-structures → data-structures}/heap/min-heap.d.ts +0 -0
  506. package/dist/cjs/{src/data-structures → data-structures}/heap/min-heap.js +0 -0
  507. package/dist/cjs/{src/data-structures → data-structures}/index.d.ts +0 -0
  508. package/dist/cjs/{src/data-structures → data-structures}/index.js +0 -0
  509. package/dist/cjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  510. package/dist/cjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.js +0 -0
  511. package/dist/cjs/{src/data-structures → data-structures}/linked-list/index.d.ts +0 -0
  512. package/dist/cjs/{src/data-structures → data-structures}/linked-list/index.js +0 -0
  513. package/dist/cjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  514. package/dist/cjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.js +0 -0
  515. package/dist/cjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  516. package/dist/cjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.js +0 -0
  517. package/dist/cjs/{src/data-structures → data-structures}/matrix/index.d.ts +0 -0
  518. package/dist/cjs/{src/data-structures → data-structures}/matrix/index.js +0 -0
  519. package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix.d.ts +0 -0
  520. package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix.js +0 -0
  521. package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix2d.d.ts +0 -0
  522. package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix2d.js +0 -0
  523. package/dist/cjs/{src/data-structures → data-structures}/matrix/navigator.d.ts +0 -0
  524. package/dist/cjs/{src/data-structures → data-structures}/matrix/navigator.js +0 -0
  525. package/dist/cjs/{src/data-structures → data-structures}/matrix/vector2d.d.ts +0 -0
  526. package/dist/cjs/{src/data-structures → data-structures}/matrix/vector2d.js +0 -0
  527. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/index.d.ts +0 -0
  528. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/index.js +0 -0
  529. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  530. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.js +0 -0
  531. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  532. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.js +0 -0
  533. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/priority-queue.d.ts +0 -0
  534. package/dist/cjs/{src/data-structures → data-structures}/priority-queue/priority-queue.js +0 -0
  535. package/dist/cjs/{src/data-structures → data-structures}/queue/deque.d.ts +0 -0
  536. package/dist/cjs/{src/data-structures → data-structures}/queue/deque.js +0 -0
  537. package/dist/cjs/{src/data-structures → data-structures}/queue/index.d.ts +0 -0
  538. package/dist/cjs/{src/data-structures → data-structures}/queue/index.js +0 -0
  539. package/dist/cjs/{src/data-structures → data-structures}/queue/queue.d.ts +0 -0
  540. package/dist/cjs/{src/data-structures → data-structures}/queue/queue.js +0 -0
  541. package/dist/cjs/{src/data-structures → data-structures}/stack/index.d.ts +0 -0
  542. package/dist/cjs/{src/data-structures → data-structures}/stack/index.js +0 -0
  543. package/dist/cjs/{src/data-structures → data-structures}/stack/stack.d.ts +0 -0
  544. package/dist/cjs/{src/data-structures → data-structures}/stack/stack.js +0 -0
  545. package/dist/cjs/{src/data-structures → data-structures}/tree/index.d.ts +0 -0
  546. package/dist/cjs/{src/data-structures → data-structures}/tree/index.js +0 -0
  547. package/dist/cjs/{src/data-structures → data-structures}/tree/tree.d.ts +0 -0
  548. package/dist/cjs/{src/data-structures → data-structures}/tree/tree.js +0 -0
  549. package/dist/cjs/{src/data-structures → data-structures}/trie/index.d.ts +0 -0
  550. package/dist/cjs/{src/data-structures → data-structures}/trie/index.js +0 -0
  551. package/dist/cjs/{src/data-structures → data-structures}/trie/trie.d.ts +0 -0
  552. package/dist/cjs/{src/data-structures → data-structures}/trie/trie.js +0 -0
  553. package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
  554. package/dist/cjs/{src/index.js → index.js} +0 -0
  555. package/dist/cjs/{src/interfaces → interfaces}/binary-tree.js +0 -0
  556. package/dist/cjs/{src/interfaces → interfaces}/doubly-linked-list.d.ts +0 -0
  557. package/dist/cjs/{src/interfaces → interfaces}/doubly-linked-list.js +0 -0
  558. package/dist/cjs/{src/interfaces → interfaces}/graph.d.ts +0 -0
  559. package/dist/cjs/{src/interfaces → interfaces}/graph.js +0 -0
  560. package/dist/cjs/{src/interfaces → interfaces}/heap.d.ts +0 -0
  561. package/dist/cjs/{src/interfaces → interfaces}/heap.js +0 -0
  562. package/dist/cjs/{src/interfaces → interfaces}/index.d.ts +0 -0
  563. package/dist/cjs/{src/interfaces → interfaces}/index.js +0 -0
  564. package/dist/cjs/{src/interfaces → interfaces}/navigator.d.ts +0 -0
  565. package/dist/cjs/{src/interfaces → interfaces}/navigator.js +0 -0
  566. package/dist/cjs/{src/interfaces → interfaces}/priority-queue.d.ts +0 -0
  567. package/dist/cjs/{src/interfaces → interfaces}/priority-queue.js +0 -0
  568. package/dist/cjs/{src/interfaces → interfaces}/segment-tree.d.ts +0 -0
  569. package/dist/cjs/{src/interfaces → interfaces}/segment-tree.js +0 -0
  570. package/dist/cjs/{src/interfaces → interfaces}/singly-linked-list.d.ts +0 -0
  571. package/dist/cjs/{src/interfaces → interfaces}/singly-linked-list.js +0 -0
  572. package/dist/cjs/{src/types → types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  573. package/dist/cjs/{src/types → types}/data-structures/binary-tree/avl-tree.js +0 -0
  574. package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  575. package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  576. package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  577. package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-tree.js +0 -0
  578. package/dist/cjs/{src/types → types}/data-structures/binary-tree/bst.d.ts +0 -0
  579. package/dist/cjs/{src/types → types}/data-structures/binary-tree/bst.js +0 -0
  580. package/dist/cjs/{src/types → types}/data-structures/binary-tree/index.d.ts +0 -0
  581. package/dist/cjs/{src/types → types}/data-structures/binary-tree/index.js +0 -0
  582. package/dist/cjs/{src/types → types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  583. package/dist/cjs/{src/types → types}/data-structures/binary-tree/rb-tree.js +0 -0
  584. package/dist/cjs/{src/types → types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  585. package/dist/cjs/{src/types → types}/data-structures/binary-tree/segment-tree.js +0 -0
  586. package/dist/cjs/{src/types → types}/data-structures/binary-tree/tree-multimap.d.ts +0 -0
  587. package/dist/cjs/{src/types → types}/data-structures/binary-tree/tree-multimap.js +0 -0
  588. package/dist/cjs/{src/types → types}/data-structures/graph/abstract-graph.d.ts +0 -0
  589. package/dist/cjs/{src/types → types}/data-structures/graph/abstract-graph.js +0 -0
  590. package/dist/cjs/{src/types → types}/data-structures/graph/directed-graph.d.ts +0 -0
  591. package/dist/cjs/{src/types → types}/data-structures/graph/directed-graph.js +0 -0
  592. package/dist/cjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
  593. package/dist/cjs/{src/types → types}/data-structures/graph/index.js +0 -0
  594. package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
  595. package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.js +0 -0
  596. package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.d.ts +0 -0
  597. package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.js +0 -0
  598. package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.d.ts +0 -0
  599. package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.js +0 -0
  600. package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.d.ts +0 -0
  601. package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.js +0 -0
  602. package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.d.ts +0 -0
  603. package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.js +0 -0
  604. package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.d.ts +0 -0
  605. package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.js +0 -0
  606. package/dist/cjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
  607. package/dist/cjs/{src/types → types}/data-structures/hash/index.js +0 -0
  608. package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.d.ts +0 -0
  609. package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.js +0 -0
  610. package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.d.ts +0 -0
  611. package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.js +0 -0
  612. package/dist/cjs/{src/types → types}/data-structures/heap/heap.d.ts +0 -0
  613. package/dist/cjs/{src/types → types}/data-structures/heap/heap.js +0 -0
  614. package/dist/cjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
  615. package/dist/cjs/{src/types → types}/data-structures/heap/index.js +0 -0
  616. package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.d.ts +0 -0
  617. package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.js +0 -0
  618. package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.d.ts +0 -0
  619. package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.js +0 -0
  620. package/dist/cjs/{src/types → types}/data-structures/index.d.ts +0 -0
  621. package/dist/cjs/{src/types → types}/data-structures/index.js +0 -0
  622. package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  623. package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  624. package/dist/cjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
  625. package/dist/cjs/{src/types → types}/data-structures/linked-list/index.js +0 -0
  626. package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  627. package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.js +0 -0
  628. package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  629. package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.js +0 -0
  630. package/dist/cjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
  631. package/dist/cjs/{src/types → types}/data-structures/matrix/index.js +0 -0
  632. package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.d.ts +0 -0
  633. package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.js +0 -0
  634. package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.d.ts +0 -0
  635. package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.js +0 -0
  636. package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
  637. package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.js +0 -0
  638. package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.d.ts +0 -0
  639. package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.js +0 -0
  640. package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.d.ts +0 -0
  641. package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.js +0 -0
  642. package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  643. package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  644. package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  645. package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  646. package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  647. package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.js +0 -0
  648. package/dist/cjs/{src/types → types}/data-structures/queue/deque.d.ts +0 -0
  649. package/dist/cjs/{src/types → types}/data-structures/queue/deque.js +0 -0
  650. package/dist/cjs/{src/types → types}/data-structures/queue/index.d.ts +0 -0
  651. package/dist/cjs/{src/types → types}/data-structures/queue/index.js +0 -0
  652. package/dist/cjs/{src/types → types}/data-structures/queue/queue.d.ts +0 -0
  653. package/dist/cjs/{src/types → types}/data-structures/queue/queue.js +0 -0
  654. package/dist/cjs/{src/types → types}/data-structures/stack/index.d.ts +0 -0
  655. package/dist/cjs/{src/types → types}/data-structures/stack/index.js +0 -0
  656. package/dist/cjs/{src/types → types}/data-structures/stack/stack.d.ts +0 -0
  657. package/dist/cjs/{src/types → types}/data-structures/stack/stack.js +0 -0
  658. package/dist/cjs/{src/types → types}/data-structures/tree/index.d.ts +0 -0
  659. package/dist/cjs/{src/types → types}/data-structures/tree/index.js +0 -0
  660. package/dist/cjs/{src/types → types}/data-structures/tree/tree.d.ts +0 -0
  661. package/dist/cjs/{src/types → types}/data-structures/tree/tree.js +0 -0
  662. package/dist/cjs/{src/types → types}/data-structures/trie/index.d.ts +0 -0
  663. package/dist/cjs/{src/types → types}/data-structures/trie/index.js +0 -0
  664. package/dist/cjs/{src/types → types}/data-structures/trie/trie.d.ts +0 -0
  665. package/dist/cjs/{src/types → types}/data-structures/trie/trie.js +0 -0
  666. package/dist/cjs/{src/types → types}/helpers.d.ts +0 -0
  667. package/dist/cjs/{src/types → types}/helpers.js +0 -0
  668. package/dist/cjs/{src/types → types}/index.d.ts +0 -0
  669. package/dist/cjs/{src/types → types}/index.js +0 -0
  670. package/dist/cjs/{src/types → types}/utils/index.d.ts +0 -0
  671. package/dist/cjs/{src/types → types}/utils/index.js +0 -0
  672. package/dist/cjs/{src/types → types}/utils/utils.d.ts +0 -0
  673. package/dist/cjs/{src/types → types}/utils/utils.js +0 -0
  674. package/dist/cjs/{src/types → types}/utils/validate-type.d.ts +0 -0
  675. package/dist/cjs/{src/types → types}/utils/validate-type.js +0 -0
  676. package/dist/cjs/{src/utils → utils}/index.d.ts +0 -0
  677. package/dist/cjs/{src/utils → utils}/index.js +0 -0
  678. package/dist/cjs/{src/utils → utils}/utils.d.ts +0 -0
  679. package/dist/cjs/{src/utils → utils}/utils.js +0 -0
  680. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
  681. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  682. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/bst.d.ts +0 -0
  683. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/index.d.ts +0 -0
  684. package/dist/mjs/{src/data-structures → data-structures}/binary-tree/segment-tree.d.ts +0 -0
  685. package/dist/{cjs/src → mjs}/data-structures/binary-tree/tree-multimap.d.ts +24 -24
  686. /package/dist/mjs/{src/data-structures → data-structures}/graph/directed-graph.d.ts +0 -0
  687. /package/dist/mjs/{src/data-structures → data-structures}/graph/index.d.ts +0 -0
  688. /package/dist/mjs/{src/data-structures → data-structures}/graph/map-graph.d.ts +0 -0
  689. /package/dist/mjs/{src/data-structures → data-structures}/graph/undirected-graph.d.ts +0 -0
  690. /package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-map.d.ts +0 -0
  691. /package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-set.d.ts +0 -0
  692. /package/dist/mjs/{src/data-structures → data-structures}/hash/hash-map.d.ts +0 -0
  693. /package/dist/mjs/{src/data-structures → data-structures}/hash/hash-table.d.ts +0 -0
  694. /package/dist/mjs/{src/data-structures → data-structures}/hash/index.d.ts +0 -0
  695. /package/dist/mjs/{src/data-structures → data-structures}/hash/tree-map.d.ts +0 -0
  696. /package/dist/mjs/{src/data-structures → data-structures}/hash/tree-set.d.ts +0 -0
  697. /package/dist/mjs/{src/data-structures → data-structures}/heap/heap.d.ts +0 -0
  698. /package/dist/mjs/{src/data-structures → data-structures}/heap/index.d.ts +0 -0
  699. /package/dist/mjs/{src/data-structures → data-structures}/heap/max-heap.d.ts +0 -0
  700. /package/dist/mjs/{src/data-structures → data-structures}/heap/min-heap.d.ts +0 -0
  701. /package/dist/mjs/{src/data-structures → data-structures}/index.d.ts +0 -0
  702. /package/dist/mjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  703. /package/dist/mjs/{src/data-structures → data-structures}/linked-list/index.d.ts +0 -0
  704. /package/dist/mjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  705. /package/dist/mjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  706. /package/dist/mjs/{src/data-structures → data-structures}/matrix/index.d.ts +0 -0
  707. /package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix.d.ts +0 -0
  708. /package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix2d.d.ts +0 -0
  709. /package/dist/mjs/{src/data-structures → data-structures}/matrix/navigator.d.ts +0 -0
  710. /package/dist/mjs/{src/data-structures → data-structures}/matrix/vector2d.d.ts +0 -0
  711. /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/index.d.ts +0 -0
  712. /package/dist/mjs/{src/types/data-structures/priority-queue/index.d.ts → data-structures/priority-queue/index.js} +0 -0
  713. /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  714. /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  715. /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/priority-queue.d.ts +0 -0
  716. /package/dist/mjs/{src/data-structures → data-structures}/queue/deque.d.ts +0 -0
  717. /package/dist/mjs/{src/data-structures → data-structures}/queue/index.d.ts +0 -0
  718. /package/dist/mjs/{src/types/data-structures/queue/index.d.ts → data-structures/queue/index.js} +0 -0
  719. /package/dist/mjs/{src/data-structures → data-structures}/queue/queue.d.ts +0 -0
  720. /package/dist/mjs/{src/data-structures → data-structures}/stack/index.d.ts +0 -0
  721. /package/dist/mjs/{src/types/data-structures/stack/index.d.ts → data-structures/stack/index.js} +0 -0
  722. /package/dist/mjs/{src/data-structures → data-structures}/stack/stack.d.ts +0 -0
  723. /package/dist/mjs/{src/data-structures → data-structures}/tree/index.d.ts +0 -0
  724. /package/dist/mjs/{src/types/data-structures/tree/index.d.ts → data-structures/tree/index.js} +0 -0
  725. /package/dist/mjs/{src/data-structures → data-structures}/tree/tree.d.ts +0 -0
  726. /package/dist/mjs/{src/data-structures → data-structures}/trie/index.d.ts +0 -0
  727. /package/dist/mjs/{src/types/data-structures/trie/index.d.ts → data-structures/trie/index.js} +0 -0
  728. /package/dist/mjs/{src/data-structures → data-structures}/trie/trie.d.ts +0 -0
  729. /package/dist/mjs/{src/index.d.ts → index.d.ts} +0 -0
  730. /package/dist/mjs/{src/interfaces/doubly-linked-list.d.ts → interfaces/binary-tree.js} +0 -0
  731. /package/dist/mjs/{src/types/data-structures/linked-list → interfaces}/doubly-linked-list.d.ts +0 -0
  732. /package/dist/mjs/{src/interfaces/heap.d.ts → interfaces/doubly-linked-list.js} +0 -0
  733. /package/dist/mjs/{src/interfaces → interfaces}/graph.d.ts +0 -0
  734. /package/dist/mjs/{src/interfaces/navigator.d.ts → interfaces/graph.js} +0 -0
  735. /package/dist/mjs/{src/types/data-structures/heap → interfaces}/heap.d.ts +0 -0
  736. /package/dist/mjs/{src/interfaces/priority-queue.d.ts → interfaces/heap.js} +0 -0
  737. /package/dist/mjs/{src/interfaces → interfaces}/index.d.ts +0 -0
  738. /package/dist/mjs/{src/interfaces/segment-tree.d.ts → interfaces/navigator.d.ts} +0 -0
  739. /package/dist/mjs/{src/interfaces/singly-linked-list.d.ts → interfaces/navigator.js} +0 -0
  740. /package/dist/mjs/{src/types/data-structures/priority-queue → interfaces}/priority-queue.d.ts +0 -0
  741. /package/dist/mjs/{src/types/data-structures/binary-tree/binary-indexed-tree.d.ts → interfaces/priority-queue.js} +0 -0
  742. /package/dist/mjs/{src/types/data-structures/graph/undirected-graph.d.ts → interfaces/segment-tree.d.ts} +0 -0
  743. /package/dist/mjs/{src/types/data-structures/hash/coordinate-map.d.ts → interfaces/segment-tree.js} +0 -0
  744. /package/dist/mjs/{src/types/data-structures/linked-list → interfaces}/singly-linked-list.d.ts +0 -0
  745. /package/dist/mjs/{src/types/data-structures/hash/coordinate-set.d.ts → interfaces/singly-linked-list.js} +0 -0
  746. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  747. /package/dist/mjs/{src/types/data-structures/hash/hash-map.d.ts → types/data-structures/binary-tree/avl-tree.js} +0 -0
  748. /package/dist/mjs/{src/types/data-structures/hash/hash-table.d.ts → types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
  749. /package/dist/mjs/{src/types/data-structures/hash/tree-map.d.ts → types/data-structures/binary-tree/binary-indexed-tree.js} +0 -0
  750. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  751. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/bst.d.ts +0 -0
  752. /package/dist/mjs/{src/types/data-structures/hash/tree-set.d.ts → types/data-structures/binary-tree/bst.js} +0 -0
  753. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/index.d.ts +0 -0
  754. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  755. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  756. /package/dist/mjs/{src/types/data-structures/heap/max-heap.d.ts → types/data-structures/binary-tree/segment-tree.js} +0 -0
  757. /package/dist/mjs/{src/types → types}/data-structures/binary-tree/tree-multimap.d.ts +0 -0
  758. /package/dist/mjs/{src/types/data-structures/heap/min-heap.d.ts → types/data-structures/binary-tree/tree-multimap.js} +0 -0
  759. /package/dist/mjs/{src/types → types}/data-structures/graph/abstract-graph.d.ts +0 -0
  760. /package/dist/mjs/{src/types/data-structures/linked-list/skip-linked-list.d.ts → types/data-structures/graph/abstract-graph.js} +0 -0
  761. /package/dist/mjs/{src/types → types}/data-structures/graph/directed-graph.d.ts +0 -0
  762. /package/dist/mjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
  763. /package/dist/mjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
  764. /package/dist/mjs/{src/types/data-structures/matrix/matrix.d.ts → types/data-structures/graph/map-graph.js} +0 -0
  765. /package/dist/mjs/{src/types/data-structures/matrix/matrix2d.d.ts → types/data-structures/graph/undirected-graph.d.ts} +0 -0
  766. /package/dist/mjs/{src/types/data-structures/matrix/vector2d.d.ts → types/data-structures/graph/undirected-graph.js} +0 -0
  767. /package/dist/mjs/{src/types/data-structures/priority-queue/max-priority-queue.d.ts → types/data-structures/hash/coordinate-map.d.ts} +0 -0
  768. /package/dist/mjs/{src/types/data-structures/priority-queue/min-priority-queue.d.ts → types/data-structures/hash/coordinate-map.js} +0 -0
  769. /package/dist/mjs/{src/types/data-structures/queue/deque.d.ts → types/data-structures/hash/coordinate-set.d.ts} +0 -0
  770. /package/dist/mjs/{src/types/data-structures/queue/queue.d.ts → types/data-structures/hash/coordinate-set.js} +0 -0
  771. /package/dist/mjs/{src/types/data-structures/stack/stack.d.ts → types/data-structures/hash/hash-map.d.ts} +0 -0
  772. /package/dist/mjs/{src/types/data-structures/tree/tree.d.ts → types/data-structures/hash/hash-map.js} +0 -0
  773. /package/dist/mjs/{src/types/data-structures/trie/trie.d.ts → types/data-structures/hash/hash-table.d.ts} +0 -0
  774. /package/dist/mjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
  775. /package/dist/mjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
  776. /package/dist/mjs/{src/types → types}/data-structures/index.d.ts +0 -0
  777. /package/dist/mjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
  778. /package/dist/mjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
  779. /package/dist/mjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
  780. /package/dist/mjs/{src/types → types}/helpers.d.ts +0 -0
  781. /package/dist/mjs/{src/types → types}/index.d.ts +0 -0
  782. /package/dist/mjs/{src/types → types}/utils/index.d.ts +0 -0
  783. /package/dist/mjs/{src/types → types}/utils/utils.d.ts +0 -0
  784. /package/dist/mjs/{src/types → types}/utils/validate-type.d.ts +0 -0
  785. /package/dist/mjs/{src/utils → utils}/index.d.ts +0 -0
  786. /package/dist/mjs/{src/utils → utils}/utils.d.ts +0 -0
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * data-structure-typed
4
3
  *
@@ -6,17 +5,15 @@
6
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
7
6
  * @license MIT License
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.BinaryTree = exports.BinaryTreeNode = void 0;
11
- const types_1 = require("../../types");
12
- const utils_1 = require("../../utils");
13
- const queue_1 = require("../queue");
8
+ import { FamilyPosition, IterationType } from '../../types';
9
+ import { trampoline } from '../../utils';
10
+ import { Queue } from '../queue';
14
11
  /**
15
12
  * Represents a node in a binary tree.
16
13
  * @template V - The type of data stored in the node.
17
14
  * @template N - The type of the family relationship in the binary tree.
18
15
  */
19
- class BinaryTreeNode {
16
+ export class BinaryTreeNode {
20
17
  /**
21
18
  * The key associated with the node.
22
19
  */
@@ -79,31 +76,30 @@ class BinaryTreeNode {
79
76
  get familyPosition() {
80
77
  const that = this;
81
78
  if (!this.parent) {
82
- return this.left || this.right ? types_1.FamilyPosition.ROOT : types_1.FamilyPosition.ISOLATED;
79
+ return this.left || this.right ? FamilyPosition.ROOT : FamilyPosition.ISOLATED;
83
80
  }
84
81
  if (this.parent.left === that) {
85
- return this.left || this.right ? types_1.FamilyPosition.ROOT_LEFT : types_1.FamilyPosition.LEFT;
82
+ return this.left || this.right ? FamilyPosition.ROOT_LEFT : FamilyPosition.LEFT;
86
83
  }
87
84
  else if (this.parent.right === that) {
88
- return this.left || this.right ? types_1.FamilyPosition.ROOT_RIGHT : types_1.FamilyPosition.RIGHT;
85
+ return this.left || this.right ? FamilyPosition.ROOT_RIGHT : FamilyPosition.RIGHT;
89
86
  }
90
- return types_1.FamilyPosition.MAL_NODE;
87
+ return FamilyPosition.MAL_NODE;
91
88
  }
92
89
  }
93
- exports.BinaryTreeNode = BinaryTreeNode;
94
90
  /**
95
91
  * Represents a binary tree data structure.
96
92
  * @template N - The type of the binary tree's nodes.
97
93
  */
98
- class BinaryTree {
99
- iterationType = types_1.IterationType.ITERATIVE;
94
+ export class BinaryTree {
95
+ iterationType = IterationType.ITERATIVE;
100
96
  /**
101
97
  * Creates a new instance of BinaryTree.
102
98
  * @param {BinaryTreeOptions} [options] - The options for the binary tree.
103
99
  */
104
100
  constructor(options) {
105
101
  if (options) {
106
- const { iterationType = types_1.IterationType.ITERATIVE } = options;
102
+ const { iterationType = IterationType.ITERATIVE } = options;
107
103
  this.iterationType = iterationType;
108
104
  }
109
105
  this._size = 0;
@@ -151,7 +147,7 @@ class BinaryTree {
151
147
  */
152
148
  add(keyOrNode, value) {
153
149
  const _bfs = (root, newNode) => {
154
- const queue = new queue_1.Queue([root]);
150
+ const queue = new Queue([root]);
155
151
  while (queue.size > 0) {
156
152
  const cur = queue.shift();
157
153
  if (newNode && cur.key === newNode.key) {
@@ -284,10 +280,10 @@ class BinaryTree {
284
280
  }
285
281
  else {
286
282
  const { familyPosition: fp } = curr;
287
- if (fp === types_1.FamilyPosition.LEFT || fp === types_1.FamilyPosition.ROOT_LEFT) {
283
+ if (fp === FamilyPosition.LEFT || fp === FamilyPosition.ROOT_LEFT) {
288
284
  parent.left = curr.right;
289
285
  }
290
- else if (fp === types_1.FamilyPosition.RIGHT || fp === types_1.FamilyPosition.ROOT_RIGHT) {
286
+ else if (fp === FamilyPosition.RIGHT || fp === FamilyPosition.ROOT_RIGHT) {
291
287
  parent.right = curr.right;
292
288
  }
293
289
  needBalanced = parent;
@@ -366,7 +362,7 @@ class BinaryTree {
366
362
  beginRoot = this.ensureNotKey(beginRoot);
367
363
  if (!beginRoot)
368
364
  return -1;
369
- if (iterationType === types_1.IterationType.RECURSIVE) {
365
+ if (iterationType === IterationType.RECURSIVE) {
370
366
  const _getMaxHeight = (cur) => {
371
367
  if (!cur)
372
368
  return -1;
@@ -412,7 +408,7 @@ class BinaryTree {
412
408
  beginRoot = this.ensureNotKey(beginRoot);
413
409
  if (!beginRoot)
414
410
  return -1;
415
- if (iterationType === types_1.IterationType.RECURSIVE) {
411
+ if (iterationType === IterationType.RECURSIVE) {
416
412
  const _getMinHeight = (cur) => {
417
413
  if (!cur)
418
414
  return 0;
@@ -506,7 +502,7 @@ class BinaryTree {
506
502
  if (!beginRoot)
507
503
  return [];
508
504
  const ans = [];
509
- if (iterationType === types_1.IterationType.RECURSIVE) {
505
+ if (iterationType === IterationType.RECURSIVE) {
510
506
  const _traverse = (cur) => {
511
507
  if (callback(cur) === identifier) {
512
508
  ans.push(cur);
@@ -521,7 +517,7 @@ class BinaryTree {
521
517
  _traverse(beginRoot);
522
518
  }
523
519
  else {
524
- const queue = new queue_1.Queue([beginRoot]);
520
+ const queue = new Queue([beginRoot]);
525
521
  while (queue.size > 0) {
526
522
  const cur = queue.shift();
527
523
  if (cur) {
@@ -614,10 +610,10 @@ class BinaryTree {
614
610
  * @returns The function `getNodeByKey` returns a node (`N`) if a node with the specified key is
615
611
  * found in the binary tree. If no node is found, it returns `undefined`.
616
612
  */
617
- getNodeByKey(key, iterationType = types_1.IterationType.ITERATIVE) {
613
+ getNodeByKey(key, iterationType = IterationType.ITERATIVE) {
618
614
  if (!this.root)
619
615
  return undefined;
620
- if (iterationType === types_1.IterationType.RECURSIVE) {
616
+ if (iterationType === IterationType.RECURSIVE) {
621
617
  const _dfs = (cur) => {
622
618
  if (cur.key === key)
623
619
  return cur;
@@ -631,7 +627,7 @@ class BinaryTree {
631
627
  return _dfs(this.root);
632
628
  }
633
629
  else {
634
- const queue = new queue_1.Queue([this.root]);
630
+ const queue = new Queue([this.root]);
635
631
  while (queue.size > 0) {
636
632
  const cur = queue.shift();
637
633
  if (cur) {
@@ -654,7 +650,7 @@ class BinaryTree {
654
650
  * @returns either the node corresponding to the given key if it is a valid node key, or the key
655
651
  * itself if it is not a valid node key.
656
652
  */
657
- ensureNotKey(key, iterationType = types_1.IterationType.ITERATIVE) {
653
+ ensureNotKey(key, iterationType = IterationType.ITERATIVE) {
658
654
  return this.isNodeKey(key) ? this.getNodeByKey(key, iterationType) : key;
659
655
  }
660
656
  /**
@@ -757,7 +753,7 @@ class BinaryTree {
757
753
  beginRoot = this.ensureNotKey(beginRoot);
758
754
  if (!beginRoot)
759
755
  return beginRoot;
760
- if (iterationType === types_1.IterationType.RECURSIVE) {
756
+ if (iterationType === IterationType.RECURSIVE) {
761
757
  const _traverse = (cur) => {
762
758
  if (!this.isRealNode(cur.left))
763
759
  return cur;
@@ -767,7 +763,7 @@ class BinaryTree {
767
763
  }
768
764
  else {
769
765
  // Indirect implementation of iteration using tail recursion optimization
770
- const _traverse = (0, utils_1.trampoline)((cur) => {
766
+ const _traverse = trampoline((cur) => {
771
767
  if (!this.isRealNode(cur.left))
772
768
  return cur;
773
769
  return _traverse.cont(cur.left);
@@ -799,7 +795,7 @@ class BinaryTree {
799
795
  beginRoot = this.ensureNotKey(beginRoot);
800
796
  if (!beginRoot)
801
797
  return beginRoot;
802
- if (iterationType === types_1.IterationType.RECURSIVE) {
798
+ if (iterationType === IterationType.RECURSIVE) {
803
799
  const _traverse = (cur) => {
804
800
  if (!this.isRealNode(cur.right))
805
801
  return cur;
@@ -809,7 +805,7 @@ class BinaryTree {
809
805
  }
810
806
  else {
811
807
  // Indirect implementation of iteration using tail recursion optimization
812
- const _traverse = (0, utils_1.trampoline)((cur) => {
808
+ const _traverse = trampoline((cur) => {
813
809
  if (!this.isRealNode(cur.right))
814
810
  return cur;
815
811
  return _traverse.cont(cur.right);
@@ -838,7 +834,7 @@ class BinaryTree {
838
834
  beginRoot = this.ensureNotKey(beginRoot);
839
835
  if (!beginRoot)
840
836
  return true;
841
- if (iterationType === types_1.IterationType.RECURSIVE) {
837
+ if (iterationType === IterationType.RECURSIVE) {
842
838
  const dfs = (cur, min, max) => {
843
839
  if (!cur)
844
840
  return true;
@@ -916,7 +912,7 @@ class BinaryTree {
916
912
  const ans = [];
917
913
  if (!beginRoot)
918
914
  return ans;
919
- if (iterationType === types_1.IterationType.RECURSIVE) {
915
+ if (iterationType === IterationType.RECURSIVE) {
920
916
  const _traverse = (cur) => {
921
917
  if (cur !== undefined) {
922
918
  ans.push(callback(cur));
@@ -1012,12 +1008,12 @@ class BinaryTree {
1012
1008
  * `false`, null or undefined
1013
1009
  * @returns an array of values that are the return values of the callback function.
1014
1010
  */
1015
- dfs(callback = this._defaultOneParamCallback, pattern = 'in', beginRoot = this.root, iterationType = types_1.IterationType.ITERATIVE, includeNull = false) {
1011
+ dfs(callback = this._defaultOneParamCallback, pattern = 'in', beginRoot = this.root, iterationType = IterationType.ITERATIVE, includeNull = false) {
1016
1012
  beginRoot = this.ensureNotKey(beginRoot);
1017
1013
  if (!beginRoot)
1018
1014
  return [];
1019
1015
  const ans = [];
1020
- if (iterationType === types_1.IterationType.RECURSIVE) {
1016
+ if (iterationType === IterationType.RECURSIVE) {
1021
1017
  const _traverse = (node) => {
1022
1018
  switch (pattern) {
1023
1019
  case 'in':
@@ -1148,8 +1144,8 @@ class BinaryTree {
1148
1144
  if (!beginRoot)
1149
1145
  return [];
1150
1146
  const ans = [];
1151
- if (iterationType === types_1.IterationType.RECURSIVE) {
1152
- const queue = new queue_1.Queue([beginRoot]);
1147
+ if (iterationType === IterationType.RECURSIVE) {
1148
+ const queue = new Queue([beginRoot]);
1153
1149
  const traverse = (level) => {
1154
1150
  if (queue.size === 0)
1155
1151
  return;
@@ -1172,7 +1168,7 @@ class BinaryTree {
1172
1168
  traverse(0);
1173
1169
  }
1174
1170
  else {
1175
- const queue = new queue_1.Queue([beginRoot]);
1171
+ const queue = new Queue([beginRoot]);
1176
1172
  while (queue.size > 0) {
1177
1173
  const levelSize = queue.size;
1178
1174
  for (let i = 0; i < levelSize; i++) {
@@ -1225,7 +1221,7 @@ class BinaryTree {
1225
1221
  const levelsNodes = [];
1226
1222
  if (!beginRoot)
1227
1223
  return levelsNodes;
1228
- if (iterationType === types_1.IterationType.RECURSIVE) {
1224
+ if (iterationType === IterationType.RECURSIVE) {
1229
1225
  const _recursive = (node, level) => {
1230
1226
  if (!levelsNodes[level])
1231
1227
  levelsNodes[level] = [];
@@ -1432,7 +1428,7 @@ class BinaryTree {
1432
1428
  if (!node) {
1433
1429
  return;
1434
1430
  }
1435
- if (this.iterationType === types_1.IterationType.ITERATIVE) {
1431
+ if (this.iterationType === IterationType.ITERATIVE) {
1436
1432
  const stack = [];
1437
1433
  let current = node;
1438
1434
  while (current || stack.length > 0) {
@@ -1457,6 +1453,68 @@ class BinaryTree {
1457
1453
  }
1458
1454
  }
1459
1455
  }
1456
+ /**
1457
+ * The `print` function is used to display a binary tree structure in a visually appealing way.
1458
+ * @param {N | null | undefined} root - The `root` parameter is of type `BTNKey | N | null |
1459
+ * undefined`. It represents the root node of a binary tree. The root node can have one of the
1460
+ * following types:
1461
+ */
1462
+ print(beginRoot = this.root) {
1463
+ beginRoot = this.ensureNotKey(beginRoot);
1464
+ if (!beginRoot)
1465
+ return;
1466
+ const display = (root) => {
1467
+ const [lines, , ,] = _displayAux(root);
1468
+ for (const line of lines) {
1469
+ console.log(line);
1470
+ }
1471
+ };
1472
+ const _displayAux = (node) => {
1473
+ if (!this.isRealNode(node)) {
1474
+ return [[], 0, 0, 0];
1475
+ }
1476
+ if (this.isRealNode(node) && !this.isRealNode(node.right) && !this.isRealNode(node.left)) {
1477
+ const line = `${node.key}`;
1478
+ const width = line.length;
1479
+ const height = 1;
1480
+ const middle = Math.floor(width / 2);
1481
+ return [[line], width, height, middle];
1482
+ }
1483
+ if (this.isRealNode(node) && !this.isRealNode(node.right)) {
1484
+ const [lines, n, p, x] = _displayAux(node.left);
1485
+ const s = `${node.key}`;
1486
+ const u = s.length;
1487
+ const first_line = ' '.repeat(x + 1) + '_'.repeat(n - x - 1) + s;
1488
+ const second_line = ' '.repeat(x) + '/' + ' '.repeat(n - x - 1 + u);
1489
+ const shifted_lines = lines.map(line => line + ' '.repeat(u));
1490
+ return [[first_line, second_line, ...shifted_lines], n + u, p + 2, n + Math.floor(u / 2)];
1491
+ }
1492
+ if (this.isRealNode(node) && !this.isRealNode(node.left)) {
1493
+ const [lines, n, p, u] = _displayAux(node.right);
1494
+ const s = `${node.key}`;
1495
+ const x = s.length;
1496
+ const first_line = s + '_'.repeat(x) + ' '.repeat(n - x);
1497
+ const second_line = ' '.repeat(u + x) + '\\' + ' '.repeat(n - x - 1);
1498
+ const shifted_lines = lines.map(line => ' '.repeat(u) + line);
1499
+ return [[first_line, second_line, ...shifted_lines], n + x, p + 2, Math.floor(u / 2)];
1500
+ }
1501
+ const [left, n, p, x] = _displayAux(node.left);
1502
+ const [right, m, q, y] = _displayAux(node.right);
1503
+ const s = `${node.key}`;
1504
+ const u = s.length;
1505
+ const first_line = ' '.repeat(x + 1) + '_'.repeat(n - x - 1) + s + '_'.repeat(y) + ' '.repeat(m - y);
1506
+ const second_line = ' '.repeat(x) + '/' + ' '.repeat(n - x - 1 + u + y) + '\\' + ' '.repeat(m - y - 1);
1507
+ if (p < q) {
1508
+ left.push(...new Array(q - p).fill(' '.repeat(n)));
1509
+ }
1510
+ else if (q < p) {
1511
+ right.push(...new Array(p - q).fill(' '.repeat(m)));
1512
+ }
1513
+ const zipped_lines = left.map((a, i) => a + ' '.repeat(u) + right[i]);
1514
+ return [[first_line, second_line, ...zipped_lines], n + m + u, Math.max(p, q) + 2, n + Math.floor(u / 2)];
1515
+ };
1516
+ display(beginRoot);
1517
+ }
1460
1518
  _defaultOneParamCallback = (node) => node.key;
1461
1519
  /**
1462
1520
  * Swap the data of two nodes in the binary tree.
@@ -1531,67 +1589,4 @@ class BinaryTree {
1531
1589
  }
1532
1590
  this._root = v;
1533
1591
  }
1534
- /**
1535
- * The `print` function is used to display a binary tree structure in a visually appealing way.
1536
- * @param {N | null | undefined} root - The `root` parameter is of type `BTNKey | N | null |
1537
- * undefined`. It represents the root node of a binary tree. The root node can have one of the
1538
- * following types:
1539
- */
1540
- print(beginRoot = this.root) {
1541
- beginRoot = this.ensureNotKey(beginRoot);
1542
- if (!beginRoot)
1543
- return;
1544
- const display = (root) => {
1545
- const [lines, , ,] = _displayAux(root);
1546
- for (const line of lines) {
1547
- console.log(line);
1548
- }
1549
- };
1550
- const _displayAux = (node) => {
1551
- if (!this.isRealNode(node)) {
1552
- return [[], 0, 0, 0];
1553
- }
1554
- if (this.isRealNode(node) && !this.isRealNode(node.right) && !this.isRealNode(node.left)) {
1555
- const line = `${node.key}`;
1556
- const width = line.length;
1557
- const height = 1;
1558
- const middle = Math.floor(width / 2);
1559
- return [[line], width, height, middle];
1560
- }
1561
- if (this.isRealNode(node) && !this.isRealNode(node.right)) {
1562
- const [lines, n, p, x] = _displayAux(node.left);
1563
- const s = `${node.key}`;
1564
- const u = s.length;
1565
- const first_line = ' '.repeat(x + 1) + '_'.repeat(n - x - 1) + s;
1566
- const second_line = ' '.repeat(x) + '/' + ' '.repeat(n - x - 1 + u);
1567
- const shifted_lines = lines.map(line => line + ' '.repeat(u));
1568
- return [[first_line, second_line, ...shifted_lines], n + u, p + 2, n + Math.floor(u / 2)];
1569
- }
1570
- if (this.isRealNode(node) && !this.isRealNode(node.left)) {
1571
- const [lines, n, p, u] = _displayAux(node.right);
1572
- const s = `${node.key}`;
1573
- const x = s.length;
1574
- const first_line = s + '_'.repeat(x) + ' '.repeat(n - x);
1575
- const second_line = ' '.repeat(u + x) + '\\' + ' '.repeat(n - x - 1);
1576
- const shifted_lines = lines.map(line => ' '.repeat(u) + line);
1577
- return [[first_line, second_line, ...shifted_lines], n + x, p + 2, Math.floor(u / 2)];
1578
- }
1579
- const [left, n, p, x] = _displayAux(node.left);
1580
- const [right, m, q, y] = _displayAux(node.right);
1581
- const s = `${node.key}`;
1582
- const u = s.length;
1583
- const first_line = ' '.repeat(x + 1) + '_'.repeat(n - x - 1) + s + '_'.repeat(y) + ' '.repeat(m - y);
1584
- const second_line = ' '.repeat(x) + '/' + ' '.repeat(n - x - 1 + u + y) + '\\' + ' '.repeat(m - y - 1);
1585
- if (p < q) {
1586
- left.push(...new Array(q - p).fill(' '.repeat(n)));
1587
- }
1588
- else if (q < p) {
1589
- right.push(...new Array(p - q).fill(' '.repeat(m)));
1590
- }
1591
- const zipped_lines = left.map((a, i) => a + ' '.repeat(u) + right[i]);
1592
- return [[first_line, second_line, ...zipped_lines], n + m + u, Math.max(p, q) + 2, n + Math.floor(u / 2)];
1593
- };
1594
- display(beginRoot);
1595
- }
1596
1592
  }
1597
- exports.BinaryTree = BinaryTree;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BST = exports.BSTNode = void 0;
4
- const types_1 = require("../../types");
5
- const binary_tree_1 = require("./binary-tree");
6
- const queue_1 = require("../queue");
7
- class BSTNode extends binary_tree_1.BinaryTreeNode {
1
+ import { CP, IterationType } from '../../types';
2
+ import { BinaryTree, BinaryTreeNode } from './binary-tree';
3
+ import { Queue } from '../queue';
4
+ export class BSTNode extends BinaryTreeNode {
8
5
  parent;
9
6
  constructor(key, value) {
10
7
  super(key, value);
@@ -47,8 +44,7 @@ class BSTNode extends binary_tree_1.BinaryTreeNode {
47
44
  this._right = v;
48
45
  }
49
46
  }
50
- exports.BSTNode = BSTNode;
51
- class BST extends binary_tree_1.BinaryTree {
47
+ export class BST extends BinaryTree {
52
48
  /**
53
49
  * The constructor function initializes a binary search tree with an optional comparator function.
54
50
  * @param {BSTOptions} [options] - An optional object that contains additional configuration options
@@ -123,7 +119,7 @@ class BST extends binary_tree_1.BinaryTree {
123
119
  let traversing = true;
124
120
  while (traversing) {
125
121
  if (cur !== undefined && newNode !== undefined) {
126
- if (this._compare(cur.key, newNode.key) === types_1.CP.eq) {
122
+ if (this._compare(cur.key, newNode.key) === CP.eq) {
127
123
  if (newNode) {
128
124
  cur.value = newNode.value;
129
125
  }
@@ -131,7 +127,7 @@ class BST extends binary_tree_1.BinaryTree {
131
127
  traversing = false;
132
128
  inserted = cur;
133
129
  }
134
- else if (this._compare(cur.key, newNode.key) === types_1.CP.gt) {
130
+ else if (this._compare(cur.key, newNode.key) === CP.gt) {
135
131
  // Traverse left of the node
136
132
  if (cur.left === undefined) {
137
133
  if (newNode) {
@@ -149,7 +145,7 @@ class BST extends binary_tree_1.BinaryTree {
149
145
  cur = cur.left;
150
146
  }
151
147
  }
152
- else if (this._compare(cur.key, newNode.key) === types_1.CP.lt) {
148
+ else if (this._compare(cur.key, newNode.key) === CP.lt) {
153
149
  // Traverse right of the node
154
150
  if (cur.right === undefined) {
155
151
  if (newNode) {
@@ -260,7 +256,7 @@ class BST extends binary_tree_1.BinaryTree {
260
256
  }
261
257
  }
262
258
  };
263
- if (iterationType === types_1.IterationType.RECURSIVE) {
259
+ if (iterationType === IterationType.RECURSIVE) {
264
260
  _dfs(sortedKeysOrNodes, sortedData);
265
261
  }
266
262
  else {
@@ -288,9 +284,9 @@ class BST extends binary_tree_1.BinaryTree {
288
284
  * rightmost node otherwise. If no node is found, it returns 0.
289
285
  */
290
286
  lastKey(beginRoot = this.root, iterationType = this.iterationType) {
291
- if (this._compare(0, 1) === types_1.CP.lt)
287
+ if (this._compare(0, 1) === CP.lt)
292
288
  return this.getRightMost(beginRoot, iterationType)?.key ?? 0;
293
- else if (this._compare(0, 1) === types_1.CP.gt)
289
+ else if (this._compare(0, 1) === CP.gt)
294
290
  return this.getLeftMost(beginRoot, iterationType)?.key ?? 0;
295
291
  else
296
292
  return this.getRightMost(beginRoot, iterationType)?.key ?? 0;
@@ -313,32 +309,32 @@ class BST extends binary_tree_1.BinaryTree {
313
309
  * @returns The function `getNodeByKey` returns a node (`N`) if a node with the specified key is
314
310
  * found in the binary tree. If no node is found, it returns `undefined`.
315
311
  */
316
- getNodeByKey(key, iterationType = types_1.IterationType.ITERATIVE) {
312
+ getNodeByKey(key, iterationType = IterationType.ITERATIVE) {
317
313
  if (!this.root)
318
314
  return undefined;
319
- if (iterationType === types_1.IterationType.RECURSIVE) {
315
+ if (iterationType === IterationType.RECURSIVE) {
320
316
  const _dfs = (cur) => {
321
317
  if (cur.key === key)
322
318
  return cur;
323
319
  if (!cur.left && !cur.right)
324
320
  return;
325
- if (this._compare(cur.key, key) === types_1.CP.gt && cur.left)
321
+ if (this._compare(cur.key, key) === CP.gt && cur.left)
326
322
  return _dfs(cur.left);
327
- if (this._compare(cur.key, key) === types_1.CP.lt && cur.right)
323
+ if (this._compare(cur.key, key) === CP.lt && cur.right)
328
324
  return _dfs(cur.right);
329
325
  };
330
326
  return _dfs(this.root);
331
327
  }
332
328
  else {
333
- const queue = new queue_1.Queue([this.root]);
329
+ const queue = new Queue([this.root]);
334
330
  while (queue.size > 0) {
335
331
  const cur = queue.shift();
336
332
  if (cur) {
337
- if (this._compare(cur.key, key) === types_1.CP.eq)
333
+ if (this._compare(cur.key, key) === CP.eq)
338
334
  return cur;
339
- if (this._compare(cur.key, key) === types_1.CP.gt)
335
+ if (this._compare(cur.key, key) === CP.gt)
340
336
  cur.left && queue.push(cur.left);
341
- if (this._compare(cur.key, key) === types_1.CP.lt)
337
+ if (this._compare(cur.key, key) === CP.lt)
342
338
  cur.right && queue.push(cur.right);
343
339
  }
344
340
  }
@@ -353,7 +349,7 @@ class BST extends binary_tree_1.BinaryTree {
353
349
  * type of iteration to be performed. It has a default value of `IterationType.ITERATIVE`.
354
350
  * @returns either a node object (N) or undefined.
355
351
  */
356
- ensureNotKey(key, iterationType = types_1.IterationType.ITERATIVE) {
352
+ ensureNotKey(key, iterationType = IterationType.ITERATIVE) {
357
353
  return this.isNodeKey(key) ? this.getNodeByKey(key, iterationType) : key;
358
354
  }
359
355
  /**
@@ -388,7 +384,7 @@ class BST extends binary_tree_1.BinaryTree {
388
384
  if (!beginRoot)
389
385
  return [];
390
386
  const ans = [];
391
- if (iterationType === types_1.IterationType.RECURSIVE) {
387
+ if (iterationType === IterationType.RECURSIVE) {
392
388
  const _traverse = (cur) => {
393
389
  const callbackResult = callback(cur);
394
390
  if (callbackResult === identifier) {
@@ -400,9 +396,9 @@ class BST extends binary_tree_1.BinaryTree {
400
396
  return;
401
397
  // TODO potential bug
402
398
  if (callback === this._defaultOneParamCallback) {
403
- if (this._compare(cur.key, identifier) === types_1.CP.gt)
399
+ if (this._compare(cur.key, identifier) === CP.gt)
404
400
  cur.left && _traverse(cur.left);
405
- if (this._compare(cur.key, identifier) === types_1.CP.lt)
401
+ if (this._compare(cur.key, identifier) === CP.lt)
406
402
  cur.right && _traverse(cur.right);
407
403
  }
408
404
  else {
@@ -413,7 +409,7 @@ class BST extends binary_tree_1.BinaryTree {
413
409
  _traverse(beginRoot);
414
410
  }
415
411
  else {
416
- const queue = new queue_1.Queue([beginRoot]);
412
+ const queue = new Queue([beginRoot]);
417
413
  while (queue.size > 0) {
418
414
  const cur = queue.shift();
419
415
  if (cur) {
@@ -425,9 +421,9 @@ class BST extends binary_tree_1.BinaryTree {
425
421
  }
426
422
  // TODO potential bug
427
423
  if (callback === this._defaultOneParamCallback) {
428
- if (this._compare(cur.key, identifier) === types_1.CP.gt)
424
+ if (this._compare(cur.key, identifier) === CP.gt)
429
425
  cur.left && queue.push(cur.left);
430
- if (this._compare(cur.key, identifier) === types_1.CP.lt)
426
+ if (this._compare(cur.key, identifier) === CP.lt)
431
427
  cur.right && queue.push(cur.right);
432
428
  }
433
429
  else {
@@ -464,7 +460,7 @@ class BST extends binary_tree_1.BinaryTree {
464
460
  * @returns The function `lesserOrGreaterTraverse` returns an array of values of type
465
461
  * `ReturnType<C>`, which is the return type of the callback function passed as an argument.
466
462
  */
467
- lesserOrGreaterTraverse(callback = this._defaultOneParamCallback, lesserOrGreater = types_1.CP.lt, targetNode = this.root, iterationType = this.iterationType) {
463
+ lesserOrGreaterTraverse(callback = this._defaultOneParamCallback, lesserOrGreater = CP.lt, targetNode = this.root, iterationType = this.iterationType) {
468
464
  targetNode = this.ensureNotKey(targetNode);
469
465
  const ans = [];
470
466
  if (!targetNode)
@@ -472,7 +468,7 @@ class BST extends binary_tree_1.BinaryTree {
472
468
  if (!this.root)
473
469
  return ans;
474
470
  const targetKey = targetNode.key;
475
- if (iterationType === types_1.IterationType.RECURSIVE) {
471
+ if (iterationType === IterationType.RECURSIVE) {
476
472
  const _traverse = (cur) => {
477
473
  const compared = this._compare(cur.key, targetKey);
478
474
  if (compared === lesserOrGreater)
@@ -488,7 +484,7 @@ class BST extends binary_tree_1.BinaryTree {
488
484
  return ans;
489
485
  }
490
486
  else {
491
- const queue = new queue_1.Queue([this.root]);
487
+ const queue = new Queue([this.root]);
492
488
  while (queue.size > 0) {
493
489
  const cur = queue.shift();
494
490
  if (cur) {
@@ -533,7 +529,7 @@ class BST extends binary_tree_1.BinaryTree {
533
529
  this.clear();
534
530
  if (sorted.length < 1)
535
531
  return false;
536
- if (iterationType === types_1.IterationType.RECURSIVE) {
532
+ if (iterationType === IterationType.RECURSIVE) {
537
533
  const buildBalanceBST = (l, r) => {
538
534
  if (l > r)
539
535
  return;
@@ -582,7 +578,7 @@ class BST extends binary_tree_1.BinaryTree {
582
578
  if (!this.root)
583
579
  return true;
584
580
  let balanced = true;
585
- if (iterationType === types_1.IterationType.RECURSIVE) {
581
+ if (iterationType === IterationType.RECURSIVE) {
586
582
  const _height = (cur) => {
587
583
  if (!cur)
588
584
  return 0;
@@ -641,11 +637,10 @@ class BST extends binary_tree_1.BinaryTree {
641
637
  _compare(a, b) {
642
638
  const compared = this._comparator(a, b);
643
639
  if (compared > 0)
644
- return types_1.CP.gt;
640
+ return CP.gt;
645
641
  else if (compared < 0)
646
- return types_1.CP.lt;
642
+ return CP.lt;
647
643
  else
648
- return types_1.CP.eq;
644
+ return CP.eq;
649
645
  }
650
646
  }
651
- exports.BST = BST;
@@ -0,0 +1,7 @@
1
+ export * from './binary-tree';
2
+ export * from './bst';
3
+ export * from './binary-indexed-tree';
4
+ export * from './segment-tree';
5
+ export * from './avl-tree';
6
+ export * from './rb-tree';
7
+ export * from './tree-multimap';
@@ -5,9 +5,9 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import { BiTreeDeleteResult, BTNCallback, BTNKey, IterationType, RBTNColor, RedBlackTreeNodeNested, RBTreeOptions } from '../../types';
9
- import { BST, BSTNode } from "./bst";
10
- import { IBinaryTree } from "../../interfaces";
8
+ import { BiTreeDeleteResult, BTNCallback, BTNKey, IterationType, RBTNColor, RBTreeOptions, RedBlackTreeNodeNested } from '../../types';
9
+ import { BST, BSTNode } from './bst';
10
+ import { IBinaryTree } from '../../interfaces';
11
11
  export declare class RedBlackTreeNode<V = any, N extends RedBlackTreeNode<V, N> = RedBlackTreeNodeNested<V>> extends BSTNode<V, N> {
12
12
  color: RBTNColor;
13
13
  constructor(key: BTNKey, value?: V, color?: RBTNColor);
@@ -20,6 +20,7 @@ export declare class RedBlackTreeNode<V = any, N extends RedBlackTreeNode<V, N>
20
20
  * 5. Black balance: Every path from any node to each of its leaf nodes contains the same number of black nodes.
21
21
  */
22
22
  export declare class RedBlackTree<V = any, N extends RedBlackTreeNode<V, N> = RedBlackTreeNode<V, RedBlackTreeNodeNested<V>>> extends BST<V, N> implements IBinaryTree<V, N> {
23
+ NIL: N;
23
24
  /**
24
25
  * The constructor function initializes a Red-Black Tree with an optional set of options.
25
26
  * @param {RBTreeOptions} [options] - The `options` parameter is an optional object that can be
@@ -30,7 +31,6 @@ export declare class RedBlackTree<V = any, N extends RedBlackTreeNode<V, N> = Re
30
31
  get root(): N;
31
32
  protected _size: number;
32
33
  get size(): number;
33
- NIL: N;
34
34
  /**
35
35
  * Time Complexity: O(log n) on average (where n is the number of nodes in the tree)
36
36
  * Space Complexity: O(1)