red-black-tree-typed 1.47.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 (341) hide show
  1. package/.eslintrc.js +61 -0
  2. package/.prettierignore +6 -0
  3. package/.prettierrc.js +16 -0
  4. package/LICENSE +21 -0
  5. package/README.md +713 -0
  6. package/coverage/clover.xml +13 -0
  7. package/coverage/coverage-final.json +96 -0
  8. package/coverage/coverage-summary.json +60 -0
  9. package/coverage/lcov-report/base.css +403 -0
  10. package/coverage/lcov-report/block-navigation.js +87 -0
  11. package/coverage/lcov-report/favicon.png +0 -0
  12. package/coverage/lcov-report/index.html +119 -0
  13. package/coverage/lcov-report/index.ts.html +109 -0
  14. package/coverage/lcov-report/prettify.css +1 -0
  15. package/coverage/lcov-report/prettify.js +2 -0
  16. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  17. package/coverage/lcov-report/sorter.js +206 -0
  18. package/coverage/lcov.info +14 -0
  19. package/dist/data-structures/binary-tree/avl-tree.d.ts +173 -0
  20. package/dist/data-structures/binary-tree/avl-tree.js +429 -0
  21. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
  22. package/dist/data-structures/binary-tree/binary-indexed-tree.js +269 -0
  23. package/dist/data-structures/binary-tree/binary-tree.d.ts +515 -0
  24. package/dist/data-structures/binary-tree/binary-tree.js +1665 -0
  25. package/dist/data-structures/binary-tree/bst.d.ts +253 -0
  26. package/dist/data-structures/binary-tree/bst.js +651 -0
  27. package/dist/data-structures/binary-tree/index.d.ts +7 -0
  28. package/dist/data-structures/binary-tree/index.js +23 -0
  29. package/dist/data-structures/binary-tree/rb-tree.d.ts +169 -0
  30. package/dist/data-structures/binary-tree/rb-tree.js +524 -0
  31. package/dist/data-structures/binary-tree/segment-tree.d.ts +67 -0
  32. package/dist/data-structures/binary-tree/segment-tree.js +180 -0
  33. package/dist/data-structures/binary-tree/tree-multimap.d.ts +162 -0
  34. package/dist/data-structures/binary-tree/tree-multimap.js +407 -0
  35. package/dist/data-structures/graph/abstract-graph.d.ts +450 -0
  36. package/dist/data-structures/graph/abstract-graph.js +1047 -0
  37. package/dist/data-structures/graph/directed-graph.d.ts +320 -0
  38. package/dist/data-structures/graph/directed-graph.js +530 -0
  39. package/dist/data-structures/graph/index.d.ts +4 -0
  40. package/dist/data-structures/graph/index.js +20 -0
  41. package/dist/data-structures/graph/map-graph.d.ts +73 -0
  42. package/dist/data-structures/graph/map-graph.js +93 -0
  43. package/dist/data-structures/graph/undirected-graph.d.ts +183 -0
  44. package/dist/data-structures/graph/undirected-graph.js +302 -0
  45. package/dist/data-structures/hash/hash-map.d.ts +186 -0
  46. package/dist/data-structures/hash/hash-map.js +367 -0
  47. package/dist/data-structures/hash/hash-table.d.ts +103 -0
  48. package/dist/data-structures/hash/hash-table.js +236 -0
  49. package/dist/data-structures/hash/index.d.ts +2 -0
  50. package/dist/data-structures/hash/index.js +18 -0
  51. package/dist/data-structures/heap/heap.d.ts +410 -0
  52. package/dist/data-structures/heap/heap.js +697 -0
  53. package/dist/data-structures/heap/index.d.ts +3 -0
  54. package/dist/data-structures/heap/index.js +19 -0
  55. package/dist/data-structures/heap/max-heap.d.ts +15 -0
  56. package/dist/data-structures/heap/max-heap.js +26 -0
  57. package/dist/data-structures/heap/min-heap.d.ts +15 -0
  58. package/dist/data-structures/heap/min-heap.js +26 -0
  59. package/dist/data-structures/index.d.ts +11 -0
  60. package/dist/data-structures/index.js +27 -0
  61. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +456 -0
  62. package/dist/data-structures/linked-list/doubly-linked-list.js +772 -0
  63. package/dist/data-structures/linked-list/index.d.ts +3 -0
  64. package/dist/data-structures/linked-list/index.js +19 -0
  65. package/dist/data-structures/linked-list/singly-linked-list.d.ts +414 -0
  66. package/dist/data-structures/linked-list/singly-linked-list.js +715 -0
  67. package/dist/data-structures/linked-list/skip-linked-list.d.ts +144 -0
  68. package/dist/data-structures/linked-list/skip-linked-list.js +251 -0
  69. package/dist/data-structures/matrix/index.d.ts +4 -0
  70. package/dist/data-structures/matrix/index.js +20 -0
  71. package/dist/data-structures/matrix/matrix.d.ts +21 -0
  72. package/dist/data-structures/matrix/matrix.js +28 -0
  73. package/dist/data-structures/matrix/matrix2d.d.ts +107 -0
  74. package/dist/data-structures/matrix/matrix2d.js +199 -0
  75. package/dist/data-structures/matrix/navigator.d.ts +52 -0
  76. package/dist/data-structures/matrix/navigator.js +106 -0
  77. package/dist/data-structures/matrix/vector2d.d.ts +200 -0
  78. package/dist/data-structures/matrix/vector2d.js +290 -0
  79. package/dist/data-structures/priority-queue/index.d.ts +3 -0
  80. package/dist/data-structures/priority-queue/index.js +19 -0
  81. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
  82. package/dist/data-structures/priority-queue/max-priority-queue.js +26 -0
  83. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
  84. package/dist/data-structures/priority-queue/min-priority-queue.js +26 -0
  85. package/dist/data-structures/priority-queue/priority-queue.d.ts +15 -0
  86. package/dist/data-structures/priority-queue/priority-queue.js +17 -0
  87. package/dist/data-structures/queue/deque.d.ts +572 -0
  88. package/dist/data-structures/queue/deque.js +990 -0
  89. package/dist/data-structures/queue/index.d.ts +2 -0
  90. package/dist/data-structures/queue/index.js +18 -0
  91. package/dist/data-structures/queue/queue.d.ts +209 -0
  92. package/dist/data-structures/queue/queue.js +274 -0
  93. package/dist/data-structures/stack/index.d.ts +1 -0
  94. package/dist/data-structures/stack/index.js +17 -0
  95. package/dist/data-structures/stack/stack.d.ts +106 -0
  96. package/dist/data-structures/stack/stack.js +136 -0
  97. package/dist/data-structures/tree/index.d.ts +1 -0
  98. package/dist/data-structures/tree/index.js +17 -0
  99. package/dist/data-structures/tree/tree.d.ts +8 -0
  100. package/dist/data-structures/tree/tree.js +40 -0
  101. package/dist/data-structures/trie/index.d.ts +1 -0
  102. package/dist/data-structures/trie/index.js +17 -0
  103. package/dist/data-structures/trie/trie.d.ts +155 -0
  104. package/dist/data-structures/trie/trie.js +326 -0
  105. package/dist/index.d.ts +10 -0
  106. package/dist/index.js +27 -0
  107. package/dist/interfaces/binary-tree.d.ts +7 -0
  108. package/dist/interfaces/binary-tree.js +2 -0
  109. package/dist/interfaces/doubly-linked-list.d.ts +1 -0
  110. package/dist/interfaces/doubly-linked-list.js +2 -0
  111. package/dist/interfaces/graph.d.ts +5 -0
  112. package/dist/interfaces/graph.js +2 -0
  113. package/dist/interfaces/heap.d.ts +1 -0
  114. package/dist/interfaces/heap.js +2 -0
  115. package/dist/interfaces/index.d.ts +8 -0
  116. package/dist/interfaces/index.js +24 -0
  117. package/dist/interfaces/navigator.d.ts +1 -0
  118. package/dist/interfaces/navigator.js +2 -0
  119. package/dist/interfaces/priority-queue.d.ts +1 -0
  120. package/dist/interfaces/priority-queue.js +2 -0
  121. package/dist/interfaces/segment-tree.d.ts +1 -0
  122. package/dist/interfaces/segment-tree.js +2 -0
  123. package/dist/interfaces/singly-linked-list.d.ts +1 -0
  124. package/dist/interfaces/singly-linked-list.js +2 -0
  125. package/dist/types/common.d.ts +20 -0
  126. package/dist/types/common.js +9 -0
  127. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +5 -0
  128. package/dist/types/data-structures/binary-tree/avl-tree.js +2 -0
  129. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
  130. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  131. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +31 -0
  132. package/dist/types/data-structures/binary-tree/binary-tree.js +24 -0
  133. package/dist/types/data-structures/binary-tree/bst.d.ts +8 -0
  134. package/dist/types/data-structures/binary-tree/bst.js +2 -0
  135. package/dist/types/data-structures/binary-tree/index.d.ts +6 -0
  136. package/dist/types/data-structures/binary-tree/index.js +22 -0
  137. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +9 -0
  138. package/dist/types/data-structures/binary-tree/rb-tree.js +8 -0
  139. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +1 -0
  140. package/dist/types/data-structures/binary-tree/segment-tree.js +2 -0
  141. package/dist/types/data-structures/binary-tree/tree-multimap.d.ts +5 -0
  142. package/dist/types/data-structures/binary-tree/tree-multimap.js +2 -0
  143. package/dist/types/data-structures/graph/abstract-graph.d.ts +10 -0
  144. package/dist/types/data-structures/graph/abstract-graph.js +2 -0
  145. package/dist/types/data-structures/graph/directed-graph.d.ts +1 -0
  146. package/dist/types/data-structures/graph/directed-graph.js +2 -0
  147. package/dist/types/data-structures/graph/index.d.ts +3 -0
  148. package/dist/types/data-structures/graph/index.js +19 -0
  149. package/dist/types/data-structures/graph/map-graph.d.ts +1 -0
  150. package/dist/types/data-structures/graph/map-graph.js +2 -0
  151. package/dist/types/data-structures/graph/undirected-graph.d.ts +1 -0
  152. package/dist/types/data-structures/graph/undirected-graph.js +2 -0
  153. package/dist/types/data-structures/hash/hash-map.d.ts +11 -0
  154. package/dist/types/data-structures/hash/hash-map.js +2 -0
  155. package/dist/types/data-structures/hash/hash-table.d.ts +1 -0
  156. package/dist/types/data-structures/hash/hash-table.js +2 -0
  157. package/dist/types/data-structures/hash/index.d.ts +3 -0
  158. package/dist/types/data-structures/hash/index.js +18 -0
  159. package/dist/types/data-structures/heap/heap.d.ts +1 -0
  160. package/dist/types/data-structures/heap/heap.js +2 -0
  161. package/dist/types/data-structures/heap/index.d.ts +1 -0
  162. package/dist/types/data-structures/heap/index.js +17 -0
  163. package/dist/types/data-structures/heap/max-heap.d.ts +1 -0
  164. package/dist/types/data-structures/heap/max-heap.js +2 -0
  165. package/dist/types/data-structures/heap/min-heap.d.ts +1 -0
  166. package/dist/types/data-structures/heap/min-heap.js +2 -0
  167. package/dist/types/data-structures/index.d.ts +11 -0
  168. package/dist/types/data-structures/index.js +27 -0
  169. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
  170. package/dist/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  171. package/dist/types/data-structures/linked-list/index.d.ts +2 -0
  172. package/dist/types/data-structures/linked-list/index.js +18 -0
  173. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
  174. package/dist/types/data-structures/linked-list/singly-linked-list.js +2 -0
  175. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  176. package/dist/types/data-structures/linked-list/skip-linked-list.js +2 -0
  177. package/dist/types/data-structures/matrix/index.d.ts +1 -0
  178. package/dist/types/data-structures/matrix/index.js +17 -0
  179. package/dist/types/data-structures/matrix/matrix.d.ts +1 -0
  180. package/dist/types/data-structures/matrix/matrix.js +2 -0
  181. package/dist/types/data-structures/matrix/matrix2d.d.ts +1 -0
  182. package/dist/types/data-structures/matrix/matrix2d.js +2 -0
  183. package/dist/types/data-structures/matrix/navigator.d.ts +14 -0
  184. package/dist/types/data-structures/matrix/navigator.js +2 -0
  185. package/dist/types/data-structures/matrix/vector2d.d.ts +1 -0
  186. package/dist/types/data-structures/matrix/vector2d.js +2 -0
  187. package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
  188. package/dist/types/data-structures/priority-queue/index.js +19 -0
  189. package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  190. package/dist/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  191. package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  192. package/dist/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  193. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  194. package/dist/types/data-structures/priority-queue/priority-queue.js +2 -0
  195. package/dist/types/data-structures/queue/deque.d.ts +1 -0
  196. package/dist/types/data-structures/queue/deque.js +2 -0
  197. package/dist/types/data-structures/queue/index.d.ts +2 -0
  198. package/dist/types/data-structures/queue/index.js +18 -0
  199. package/dist/types/data-structures/queue/queue.d.ts +1 -0
  200. package/dist/types/data-structures/queue/queue.js +2 -0
  201. package/dist/types/data-structures/stack/index.d.ts +1 -0
  202. package/dist/types/data-structures/stack/index.js +17 -0
  203. package/dist/types/data-structures/stack/stack.d.ts +1 -0
  204. package/dist/types/data-structures/stack/stack.js +2 -0
  205. package/dist/types/data-structures/tree/index.d.ts +1 -0
  206. package/dist/types/data-structures/tree/index.js +17 -0
  207. package/dist/types/data-structures/tree/tree.d.ts +1 -0
  208. package/dist/types/data-structures/tree/tree.js +2 -0
  209. package/dist/types/data-structures/trie/index.d.ts +1 -0
  210. package/dist/types/data-structures/trie/index.js +17 -0
  211. package/dist/types/data-structures/trie/trie.d.ts +1 -0
  212. package/dist/types/data-structures/trie/trie.js +2 -0
  213. package/dist/types/index.d.ts +3 -0
  214. package/dist/types/index.js +19 -0
  215. package/dist/types/utils/index.d.ts +2 -0
  216. package/dist/types/utils/index.js +18 -0
  217. package/dist/types/utils/utils.d.ts +7 -0
  218. package/dist/types/utils/utils.js +2 -0
  219. package/dist/types/utils/validate-type.d.ts +19 -0
  220. package/dist/types/utils/validate-type.js +2 -0
  221. package/dist/utils/index.d.ts +1 -0
  222. package/dist/utils/index.js +17 -0
  223. package/dist/utils/utils.d.ts +24 -0
  224. package/dist/utils/utils.js +89 -0
  225. package/docs/.nojekyll +1 -0
  226. package/docs/assets/highlight.css +92 -0
  227. package/docs/assets/main.js +59 -0
  228. package/docs/assets/navigation.js +1 -0
  229. package/docs/assets/search.js +1 -0
  230. package/docs/assets/style.css +1383 -0
  231. package/docs/classes/AVLTree.html +2046 -0
  232. package/docs/classes/AVLTreeNode.html +263 -0
  233. package/docs/index.html +523 -0
  234. package/docs/modules.html +45 -0
  235. package/jest.config.js +8 -0
  236. package/package.json +147 -0
  237. package/src/data-structures/binary-tree/avl-tree.ts +443 -0
  238. package/src/data-structures/binary-tree/binary-indexed-tree.ts +306 -0
  239. package/src/data-structures/binary-tree/binary-tree.ts +1974 -0
  240. package/src/data-structures/binary-tree/bst.ts +676 -0
  241. package/src/data-structures/binary-tree/index.ts +7 -0
  242. package/src/data-structures/binary-tree/rb-tree.ts +585 -0
  243. package/src/data-structures/binary-tree/segment-tree.ts +190 -0
  244. package/src/data-structures/binary-tree/tree-multimap.ts +435 -0
  245. package/src/data-structures/graph/abstract-graph.ts +1181 -0
  246. package/src/data-structures/graph/directed-graph.ts +593 -0
  247. package/src/data-structures/graph/index.ts +4 -0
  248. package/src/data-structures/graph/map-graph.ts +106 -0
  249. package/src/data-structures/graph/undirected-graph.ts +331 -0
  250. package/src/data-structures/hash/hash-map.ts +401 -0
  251. package/src/data-structures/hash/hash-table.ts +268 -0
  252. package/src/data-structures/hash/index.ts +2 -0
  253. package/src/data-structures/heap/heap.ts +790 -0
  254. package/src/data-structures/heap/index.ts +3 -0
  255. package/src/data-structures/heap/max-heap.ts +26 -0
  256. package/src/data-structures/heap/min-heap.ts +26 -0
  257. package/src/data-structures/index.ts +11 -0
  258. package/src/data-structures/linked-list/doubly-linked-list.ts +837 -0
  259. package/src/data-structures/linked-list/index.ts +3 -0
  260. package/src/data-structures/linked-list/singly-linked-list.ts +784 -0
  261. package/src/data-structures/linked-list/skip-linked-list.ts +295 -0
  262. package/src/data-structures/matrix/index.ts +4 -0
  263. package/src/data-structures/matrix/matrix.ts +27 -0
  264. package/src/data-structures/matrix/matrix2d.ts +211 -0
  265. package/src/data-structures/matrix/navigator.ts +121 -0
  266. package/src/data-structures/matrix/vector2d.ts +315 -0
  267. package/src/data-structures/priority-queue/index.ts +3 -0
  268. package/src/data-structures/priority-queue/max-priority-queue.ts +25 -0
  269. package/src/data-structures/priority-queue/min-priority-queue.ts +25 -0
  270. package/src/data-structures/priority-queue/priority-queue.ts +16 -0
  271. package/src/data-structures/queue/deque.ts +1073 -0
  272. package/src/data-structures/queue/index.ts +2 -0
  273. package/src/data-structures/queue/queue.ts +308 -0
  274. package/src/data-structures/stack/index.ts +1 -0
  275. package/src/data-structures/stack/stack.ts +150 -0
  276. package/src/data-structures/tree/index.ts +1 -0
  277. package/src/data-structures/tree/tree.ts +41 -0
  278. package/src/data-structures/trie/index.ts +1 -0
  279. package/src/data-structures/trie/trie.ts +345 -0
  280. package/src/index.ts +11 -0
  281. package/src/interfaces/binary-tree.ts +10 -0
  282. package/src/interfaces/doubly-linked-list.ts +1 -0
  283. package/src/interfaces/graph.ts +7 -0
  284. package/src/interfaces/heap.ts +1 -0
  285. package/src/interfaces/index.ts +8 -0
  286. package/src/interfaces/navigator.ts +1 -0
  287. package/src/interfaces/priority-queue.ts +1 -0
  288. package/src/interfaces/segment-tree.ts +1 -0
  289. package/src/interfaces/singly-linked-list.ts +1 -0
  290. package/src/types/common.ts +23 -0
  291. package/src/types/data-structures/binary-tree/avl-tree.ts +9 -0
  292. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  293. package/src/types/data-structures/binary-tree/binary-tree.ts +35 -0
  294. package/src/types/data-structures/binary-tree/bst.ts +13 -0
  295. package/src/types/data-structures/binary-tree/index.ts +6 -0
  296. package/src/types/data-structures/binary-tree/rb-tree.ts +10 -0
  297. package/src/types/data-structures/binary-tree/segment-tree.ts +1 -0
  298. package/src/types/data-structures/binary-tree/tree-multimap.ts +8 -0
  299. package/src/types/data-structures/graph/abstract-graph.ts +11 -0
  300. package/src/types/data-structures/graph/directed-graph.ts +2 -0
  301. package/src/types/data-structures/graph/index.ts +3 -0
  302. package/src/types/data-structures/graph/map-graph.ts +1 -0
  303. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  304. package/src/types/data-structures/hash/hash-map.ts +12 -0
  305. package/src/types/data-structures/hash/hash-table.ts +1 -0
  306. package/src/types/data-structures/hash/index.ts +4 -0
  307. package/src/types/data-structures/heap/heap.ts +1 -0
  308. package/src/types/data-structures/heap/index.ts +1 -0
  309. package/src/types/data-structures/heap/max-heap.ts +1 -0
  310. package/src/types/data-structures/heap/min-heap.ts +1 -0
  311. package/src/types/data-structures/index.ts +11 -0
  312. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
  313. package/src/types/data-structures/linked-list/index.ts +2 -0
  314. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
  315. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  316. package/src/types/data-structures/matrix/index.ts +1 -0
  317. package/src/types/data-structures/matrix/matrix.ts +1 -0
  318. package/src/types/data-structures/matrix/matrix2d.ts +1 -0
  319. package/src/types/data-structures/matrix/navigator.ts +14 -0
  320. package/src/types/data-structures/matrix/vector2d.ts +1 -0
  321. package/src/types/data-structures/priority-queue/index.ts +3 -0
  322. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  323. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  324. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  325. package/src/types/data-structures/queue/deque.ts +1 -0
  326. package/src/types/data-structures/queue/index.ts +2 -0
  327. package/src/types/data-structures/queue/queue.ts +1 -0
  328. package/src/types/data-structures/stack/index.ts +1 -0
  329. package/src/types/data-structures/stack/stack.ts +1 -0
  330. package/src/types/data-structures/tree/index.ts +1 -0
  331. package/src/types/data-structures/tree/tree.ts +1 -0
  332. package/src/types/data-structures/trie/index.ts +1 -0
  333. package/src/types/data-structures/trie/trie.ts +1 -0
  334. package/src/types/index.ts +3 -0
  335. package/src/types/utils/index.ts +2 -0
  336. package/src/types/utils/utils.ts +6 -0
  337. package/src/types/utils/validate-type.ts +35 -0
  338. package/src/utils/index.ts +1 -0
  339. package/src/utils/utils.ts +101 -0
  340. package/test/index.test.ts +111 -0
  341. package/tsconfig.json +38 -0
@@ -0,0 +1,401 @@
1
+ /**
2
+ * data-structure-typed
3
+ *
4
+ * @author Tyler Zeng
5
+ * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
+ * @license MIT License
7
+ */
8
+
9
+ import { isWeakKey, rangeCheck } from '../../utils';
10
+ import { HashMapLinkedNode, HashMapOptions } from '../../types';
11
+
12
+ export class HashMap<K = any, V = any> {
13
+
14
+ protected _noObjMap: Record<string, HashMapLinkedNode<K, V | undefined>> = {};
15
+ protected _objMap = new WeakMap<object, HashMapLinkedNode<K, V | undefined>>();
16
+ protected _head: HashMapLinkedNode<K, V | undefined>;
17
+ protected _tail: HashMapLinkedNode<K, V | undefined>;
18
+ protected readonly _sentinel: HashMapLinkedNode<K, V | undefined>;
19
+ protected _hashFn: (key: K) => string;
20
+ protected _objHashFn: (key: K) => object;
21
+
22
+ /**
23
+ * The constructor initializes a HashMapLinkedNode with an optional iterable of key-value pairs.
24
+ * @param options - The `options` parameter is an object that contains the `elements` property. The
25
+ * `elements` property is an iterable that contains key-value pairs represented as arrays `[K, V]`.
26
+ */
27
+ constructor(options: HashMapOptions<K, V> = {
28
+ elements: [],
29
+ hashFn: (key: K) => String(key),
30
+ objHashFn: (key: K) => (<object>key)
31
+ }) {
32
+ this._sentinel = <HashMapLinkedNode<K, V>>{};
33
+ this._sentinel.prev = this._sentinel.next = this._head = this._tail = this._sentinel;
34
+
35
+ const { elements, hashFn, objHashFn } = options;
36
+ this._hashFn = hashFn;
37
+ this._objHashFn = objHashFn;
38
+ if (elements) {
39
+ for (const el of elements) {
40
+ this.set(el[0], el[1]);
41
+ }
42
+ }
43
+
44
+ }
45
+
46
+ protected _size = 0;
47
+
48
+ get size() {
49
+ return this._size;
50
+ }
51
+
52
+ /**
53
+ * Time Complexity: O(1)
54
+ * Space Complexity: O(1)
55
+ *
56
+ * The function returns the key-value pair at the front of a data structure.
57
+ * @returns The front element of the data structure, represented as a tuple with a key (K) and a
58
+ * value (V).
59
+ */
60
+ get first() {
61
+ if (this._size === 0) return;
62
+ return <[K, V]>[this._head.key, this._head.value];
63
+ }
64
+
65
+ /**
66
+ * Time Complexity: O(1)
67
+ * Space Complexity: O(1)
68
+ *
69
+ * The function returns the key-value pair at the end of a data structure.
70
+ * @returns The method is returning an array containing the key-value pair of the tail element in the
71
+ * data structure.
72
+ */
73
+ get last() {
74
+ if (this._size === 0) return;
75
+ return <[K, V]>[this._tail.key, this._tail.value];
76
+ }
77
+
78
+ /**
79
+ * The `begin()` function in TypeScript iterates over a linked list and yields key-value pairs.
80
+ */
81
+ * begin() {
82
+ let node = this._head;
83
+ while (node !== this._sentinel) {
84
+ yield [node.key, node.value];
85
+ node = node.next;
86
+ }
87
+ }
88
+
89
+ /**
90
+ * The function `reverseBegin()` iterates over a linked list in reverse order, yielding each node's
91
+ * key and value.
92
+ */
93
+ * reverseBegin() {
94
+ let node = this._tail;
95
+ while (node !== this._sentinel) {
96
+ yield [node.key, node.value];
97
+ node = node.prev;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Time Complexity: O(1)
103
+ * Space Complexity: O(1)
104
+ *
105
+ * The `set` function adds a new key-value pair to a data structure, either using an object key or a
106
+ * string key.
107
+ * @param {K} key - The `key` parameter is the key to be set in the data structure. It can be of any
108
+ * type, but typically it is a string or symbol.
109
+ * @param {V} [value] - The `value` parameter is an optional parameter of type `V`. It represents the
110
+ * value associated with the key being set in the data structure.
111
+ * @returns the size of the data structure after the key-value pair has been set.
112
+ */
113
+ set(key: K, value?: V) {
114
+ let node;
115
+
116
+ if (isWeakKey(key)) {
117
+ const hash = this._objHashFn(key);
118
+ node = this._objMap.get(hash);
119
+
120
+ if (node) {
121
+ // If the node already exists, update its value
122
+ node.value = value;
123
+ } else {
124
+ // Create new node
125
+ node = { key: <K>hash, value, prev: this._tail, next: this._sentinel };
126
+
127
+ // Add new nodes to _objMap and linked list
128
+ this._objMap.set(hash, node);
129
+ }
130
+ } else {
131
+ const hash = this._hashFn(key);
132
+ // Non-object keys are handled in the same way as the original implementation
133
+ node = this._noObjMap[hash];
134
+ if (node) {
135
+ node.value = value;
136
+ } else {
137
+ this._noObjMap[hash] = node = {
138
+ key,
139
+ value,
140
+ prev: this._tail,
141
+ next: this._sentinel
142
+ };
143
+ }
144
+ }
145
+
146
+ if (this._size === 0) {
147
+ this._head = node;
148
+ this._sentinel.next = node;
149
+ } else {
150
+ this._tail.next = node;
151
+ }
152
+
153
+ this._tail = node;
154
+ this._sentinel.prev = node;
155
+ this._size++;
156
+
157
+ return this._size;
158
+ }
159
+
160
+ /**
161
+ * Time Complexity: O(1)
162
+ * Space Complexity: O(1)
163
+ *
164
+ * The function `get` retrieves the value associated with a given key from a map, either by using the
165
+ * key directly or by using an index stored in the key object.
166
+ * @param {K} key - The `key` parameter is the key used to retrieve a value from the map. It can be
167
+ * of any type, but typically it is a string or symbol.
168
+ * @returns The value associated with the given key is being returned. If the key is an object key,
169
+ * the value is retrieved from the `_nodes` array using the index stored in the `OBJ_KEY_INDEX`
170
+ * property of the key. If the key is a string key, the value is retrieved from the `_noObjMap` object
171
+ * using the key itself. If the key is not found, `undefined` is
172
+ */
173
+ get(key: K): V | undefined {
174
+ if (isWeakKey(key)) {
175
+ const hash = this._objHashFn(key);
176
+ const node = this._objMap.get(hash);
177
+ return node ? node.value : undefined;
178
+ } else {
179
+ const hash = this._hashFn(key);
180
+ const node = this._noObjMap[hash];
181
+ return node ? node.value : undefined;
182
+ }
183
+ }
184
+
185
+ /**
186
+ * Time Complexity: O(n), where n is the index.
187
+ * Space Complexity: O(1)
188
+ *
189
+ * The function `getAt` retrieves the key-value pair at a specified index in a linked list.
190
+ * @param {number} index - The index parameter is a number that represents the position of the
191
+ * element we want to retrieve from the data structure.
192
+ * @returns The method `getAt(index: number)` is returning an array containing the key-value pair at
193
+ * the specified index in the data structure. The key-value pair is represented as a tuple `[K, V]`,
194
+ * where `K` is the key and `V` is the value.
195
+ */
196
+ getAt(index: number) {
197
+ rangeCheck(index, 0, this._size - 1);
198
+ let node = this._head;
199
+ while (index--) {
200
+ node = node.next;
201
+ }
202
+ return <[K, V]>[node.key, node.value];
203
+ }
204
+
205
+ /**
206
+ * Time Complexity: O(1)
207
+ * Space Complexity: O(1)
208
+ *
209
+ * The `delete` function removes a key-value pair from a map-like data structure.
210
+ * @param {K} key - The `key` parameter is the key that you want to delete from the data structure.
211
+ * It can be of any type, but typically it is a string or an object.
212
+ * @returns a boolean value. It returns `true` if the deletion was successful, and `false` if the key
213
+ * was not found.
214
+ */
215
+ delete(key: K) {
216
+ let node;
217
+
218
+ if (isWeakKey(key)) {
219
+ const hash = this._objHashFn(key);
220
+ // Get nodes from WeakMap
221
+ node = this._objMap.get(hash);
222
+
223
+ if (!node) {
224
+ return false; // If the node does not exist, return false
225
+ }
226
+
227
+ // Remove nodes from WeakMap
228
+ this._objMap.delete(hash);
229
+ } else {
230
+ const hash = this._hashFn(key);
231
+ // Get nodes from noObjMap
232
+ node = this._noObjMap[hash];
233
+
234
+ if (!node) {
235
+ return false; // If the node does not exist, return false
236
+ }
237
+
238
+ // Remove nodes from orgMap
239
+ delete this._noObjMap[hash];
240
+ }
241
+
242
+ // Remove node from doubly linked list
243
+ this._deleteNode(node);
244
+ return true;
245
+ }
246
+
247
+ /**
248
+ * Time Complexity: O(n), where n is the index.
249
+ * Space Complexity: O(1)
250
+ *
251
+ * The `deleteAt` function deletes a node at a specified index in a linked list.
252
+ * @param {number} index - The index parameter represents the position at which the node should be
253
+ * deleted in the linked list.
254
+ * @returns The size of the list after deleting the element at the specified index.
255
+ */
256
+ deleteAt(index: number) {
257
+ rangeCheck(index, 0, this._size - 1);
258
+ let node = this._head;
259
+ while (index--) {
260
+ node = node.next;
261
+ }
262
+ this._deleteNode(node);
263
+ return this._size;
264
+ }
265
+
266
+ /**
267
+ * Time Complexity: O(1)
268
+ * Space Complexity: O(1)
269
+ *
270
+ * The function checks if a data structure is empty by comparing its size to zero.
271
+ * @returns The method is returning a boolean value indicating whether the size of the object is 0 or
272
+ * not.
273
+ */
274
+ isEmpty() {
275
+ return this._size === 0;
276
+ }
277
+
278
+ /**
279
+ * Time Complexity: O(1)
280
+ * Space Complexity: O(1)
281
+ *
282
+ * The `clear` function clears all the elements in a data structure and resets its properties.
283
+ */
284
+ clear() {
285
+ this._noObjMap = {};
286
+ this._size = 0;
287
+ this._head = this._tail = this._sentinel.prev = this._sentinel.next = this._sentinel;
288
+ }
289
+
290
+ /**
291
+ * Time Complexity: O(n), where n is the number of elements in the HashMap.
292
+ * Space Complexity: O(1)
293
+ *
294
+ * The `forEach` function iterates over each element in a HashMap and executes a callback function on
295
+ * each element.
296
+ * @param callback - The callback parameter is a function that will be called for each element in the
297
+ * HashMap. It takes three arguments:
298
+ */
299
+ forEach(callback: (element: [K, V], index: number, hashMap: HashMap<K, V>) => void) {
300
+ let index = 0;
301
+ let node = this._head;
302
+ while (node !== this._sentinel) {
303
+ callback(<[K, V]>[node.key, node.value], index++, this);
304
+ node = node.next;
305
+ }
306
+ }
307
+
308
+ /**
309
+ * The `filter` function takes a predicate function and returns a new HashMap containing only the
310
+ * key-value pairs that satisfy the predicate.
311
+ * @param predicate - The `predicate` parameter is a function that takes two arguments: `element` and
312
+ * `map`.
313
+ * @returns a new HashMap object that contains the key-value pairs from the original HashMap that
314
+ * satisfy the given predicate function.
315
+ */
316
+ filter(predicate: (element: [K, V], map: HashMap<K, V>) => boolean): HashMap<K, V> {
317
+ const filteredMap = new HashMap<K, V>();
318
+ for (const [key, value] of this) {
319
+ if (predicate([key, value], this)) {
320
+ filteredMap.set(key, value);
321
+ }
322
+ }
323
+ return filteredMap;
324
+ }
325
+
326
+ /**
327
+ * The `map` function takes a callback function and returns a new HashMap with the values transformed
328
+ * by the callback.
329
+ * @param callback - The `callback` parameter is a function that takes two arguments: `element` and
330
+ * `map`.
331
+ * @returns a new HashMap object with the values mapped according to the provided callback function.
332
+ */
333
+ map<NV>(callback: (element: [K, V], map: HashMap<K, V>) => NV): HashMap<K, NV> {
334
+ const mappedMap = new HashMap<K, NV>();
335
+ for (const [key, value] of this) {
336
+ const newValue = callback([key, value], this);
337
+ mappedMap.set(key, newValue);
338
+ }
339
+ return mappedMap;
340
+ }
341
+
342
+ /**
343
+ * The `reduce` function iterates over the elements of a HashMap and applies a callback function to
344
+ * each element, accumulating a single value.
345
+ * @param callback - The callback parameter is a function that takes three arguments: accumulator,
346
+ * element, and map. It is called for each element in the HashMap and is used to accumulate a single
347
+ * result.
348
+ * @param {A} initialValue - The `initialValue` parameter is the initial value of the accumulator. It
349
+ * is the value that will be passed as the first argument to the `callback` function when reducing
350
+ * the elements of the map.
351
+ * @returns The `reduce` function is returning the final value of the accumulator after iterating
352
+ * over all the elements in the HashMap and applying the callback function to each element.
353
+ */
354
+ reduce<A>(callback: (accumulator: A, element: [K, V], map: HashMap<K, V>) => A, initialValue: A): A {
355
+ let accumulator = initialValue;
356
+ for (const element of this) {
357
+ accumulator = callback(accumulator, element, this);
358
+ }
359
+ return accumulator;
360
+ }
361
+
362
+ /**
363
+ * Time Complexity: O(n), where n is the number of elements in the HashMap.
364
+ * Space Complexity: O(1)
365
+ *
366
+ * The above function is an iterator that yields key-value pairs from a linked list.
367
+ */
368
+ * [Symbol.iterator]() {
369
+ let node = this._head;
370
+ while (node !== this._sentinel) {
371
+ yield <[K, V]>[node.key, node.value];
372
+ node = node.next;
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Time Complexity: O(1)
378
+ * Space Complexity: O(1)
379
+ *
380
+ * The `_deleteNode` function removes a node from a doubly linked list and updates the head and tail
381
+ * pointers if necessary.
382
+ * @param node - The `node` parameter is an instance of the `HashMapLinkedNode` class, which
383
+ * represents a node in a linked list. It contains a key-value pair and references to the previous
384
+ * and next nodes in the list.
385
+ */
386
+ protected _deleteNode(node: HashMapLinkedNode<K, V | undefined>) {
387
+ const { prev, next } = node;
388
+ prev.next = next;
389
+ next.prev = prev;
390
+
391
+ if (node === this._head) {
392
+ this._head = next;
393
+ }
394
+
395
+ if (node === this._tail) {
396
+ this._tail = prev;
397
+ }
398
+
399
+ this._size -= 1;
400
+ }
401
+ }
@@ -0,0 +1,268 @@
1
+ /**
2
+ * data-structure-typed
3
+ *
4
+ * @author Tyler Zeng
5
+ * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
+ * @license MIT License
7
+ */
8
+
9
+ export class HashTableNode<K, V> {
10
+ key: K;
11
+ value: V;
12
+ next: HashTableNode<K, V> | null;
13
+
14
+ constructor(key: K, value: V) {
15
+ this.key = key;
16
+ this.value = value;
17
+ this.next = null;
18
+ }
19
+ }
20
+
21
+ import { HashFunction } from '../../types';
22
+
23
+ export class HashTable<K, V> {
24
+ protected static readonly DEFAULT_CAPACITY = 16;
25
+ protected static readonly LOAD_FACTOR = 0.75;
26
+
27
+ constructor(capacity: number = HashTable.DEFAULT_CAPACITY, hashFn?: HashFunction<K>) {
28
+ this._hashFn = hashFn || this._defaultHashFn;
29
+ this._capacity = Math.max(capacity, HashTable.DEFAULT_CAPACITY);
30
+ this._size = 0;
31
+ this._buckets = new Array<HashTableNode<K, V> | null>(this._capacity).fill(null);
32
+ }
33
+
34
+ protected _capacity: number;
35
+
36
+ get capacity(): number {
37
+ return this._capacity;
38
+ }
39
+
40
+ protected _size: number;
41
+
42
+ get size(): number {
43
+ return this._size;
44
+ }
45
+
46
+ protected _buckets: Array<HashTableNode<K, V> | null>;
47
+
48
+ get buckets(): Array<HashTableNode<K, V> | null> {
49
+ return this._buckets;
50
+ }
51
+
52
+ protected _hashFn: HashFunction<K>;
53
+
54
+ get hashFn(): HashFunction<K> {
55
+ return this._hashFn;
56
+ }
57
+
58
+ /**
59
+ * The set function adds a key-value pair to the hash table, handling collisions and resizing if necessary.
60
+ * @param {K} key - The key parameter represents the key of the key-value pair that you want to insert into the hash
61
+ * table. It is of type K, which is a generic type representing the key's data type.
62
+ * @param {V} value - The parameter `value` represents the value that you want to associate with the given key in the hash
63
+ * table.
64
+ * @returns Nothing is being returned. The return type of the `put` method is `void`, which means it does not return any
65
+ * value.
66
+ */
67
+ set(key: K, value: V): void {
68
+ const index = this._hash(key);
69
+ const newNode = new HashTableNode<K, V>(key, value);
70
+
71
+ if (!this._buckets[index]) {
72
+ this._buckets[index] = newNode;
73
+ } else {
74
+ // Handle collisions, consider using open addressing, etc.
75
+ let currentNode = this._buckets[index]!;
76
+ while (currentNode) {
77
+ if (currentNode.key === key) {
78
+ // If the key already exists, update the value
79
+ currentNode.value = value;
80
+ return;
81
+ }
82
+ if (!currentNode.next) {
83
+ break;
84
+ }
85
+ currentNode = currentNode.next;
86
+ }
87
+ // Add to the end of the linked list
88
+ currentNode.next = newNode;
89
+ }
90
+ this._size++;
91
+
92
+ // If the load factor is too high, resize the hash table
93
+ if (this._size / this._capacity >= HashTable.LOAD_FACTOR) {
94
+ this._expand();
95
+ }
96
+ }
97
+
98
+ /**
99
+ * The `get` function retrieves the value associated with a given key from a hash table.
100
+ * @param {K} key - The `key` parameter represents the key of the element that we want to retrieve from the data
101
+ * structure.
102
+ * @returns The method is returning the value associated with the given key if it exists in the hash table. If the key is
103
+ * not found, it returns `undefined`.
104
+ */
105
+ get(key: K): V | undefined {
106
+ const index = this._hash(key);
107
+ let currentNode = this._buckets[index];
108
+
109
+ while (currentNode) {
110
+ if (currentNode.key === key) {
111
+ return currentNode.value;
112
+ }
113
+ currentNode = currentNode.next;
114
+ }
115
+ return undefined; // Key not found
116
+ }
117
+
118
+ /**
119
+ * The delete function removes a key-value pair from a hash table.
120
+ * @param {K} key - The `key` parameter represents the key of the key-value pair that needs to be removed from the hash
121
+ * table.
122
+ * @returns Nothing is being returned. The `delete` method has a return type of `void`, which means it does not return
123
+ * any value.
124
+ */
125
+ delete(key: K): void {
126
+ const index = this._hash(key);
127
+ let currentNode = this._buckets[index];
128
+ let prevNode: HashTableNode<K, V> | null = null;
129
+
130
+ while (currentNode) {
131
+ if (currentNode.key === key) {
132
+ if (prevNode) {
133
+ prevNode.next = currentNode.next;
134
+ } else {
135
+ this._buckets[index] = currentNode.next;
136
+ }
137
+ this._size--;
138
+ currentNode.next = null; // Release memory
139
+ return;
140
+ }
141
+ prevNode = currentNode;
142
+ currentNode = currentNode.next;
143
+ }
144
+ }
145
+
146
+ /**
147
+ * The function `_defaultHashFn` calculates the hash value of a given key and returns the remainder when divided by the
148
+ * capacity of the data structure.
149
+ * @param {K} key - The `key` parameter is the input value that needs to be hashed. It can be of any type, but in this
150
+ * code snippet, it is checked whether the key is a string or an object. If it is a string, the `_murmurStringHashFn`
151
+ * function is used to
152
+ * @returns the hash value of the key modulo the capacity of the data structure.
153
+ */
154
+ protected _defaultHashFn(key: K): number {
155
+ // Can be replaced with other hash functions as needed
156
+ const hashValue = typeof key === 'string' ? this._murmurStringHashFn(key) : this._objectHash(key);
157
+ return hashValue % this._capacity;
158
+ }
159
+
160
+ /**
161
+ * The `_multiplicativeStringHashFn` function calculates a hash value for a given string key using the multiplicative
162
+ * string hash function.
163
+ * @param {K} key - The `key` parameter is the input value for which we want to calculate the hash. It can be of any
164
+ * type, as it is generic (`K`). The function converts the `key` to a string using the `String()` function.
165
+ * @returns a number, which is the result of the multiplicative string hash function applied to the input key.
166
+ */
167
+ protected _multiplicativeStringHashFn<K>(key: K): number {
168
+ const keyString = String(key);
169
+ let hash = 0;
170
+ for (let i = 0; i < keyString.length; i++) {
171
+ const charCode = keyString.charCodeAt(i);
172
+ // Some constants for adjusting the hash function
173
+ const A = 0.618033988749895;
174
+ const M = 1 << 30; // 2^30
175
+ hash = (hash * A + charCode) % M;
176
+ }
177
+ return Math.abs(hash); // Take absolute value to ensure non-negative numbers
178
+ }
179
+
180
+ /**
181
+ * The function `_murmurStringHashFn` calculates a hash value for a given string key using the MurmurHash algorithm.
182
+ * @param {K} key - The `key` parameter is the input value for which you want to calculate the hash. It can be of any
183
+ * type, but it will be converted to a string using the `String()` function before calculating the hash.
184
+ * @returns a number, which is the hash value calculated for the given key.
185
+ */
186
+ protected _murmurStringHashFn<K>(key: K): number {
187
+ const keyString = String(key);
188
+ const seed = 0;
189
+ let hash = seed;
190
+
191
+ for (let i = 0; i < keyString.length; i++) {
192
+ const char = keyString.charCodeAt(i);
193
+ hash = (hash ^ char) * 0x5bd1e995;
194
+ hash = (hash ^ (hash >>> 15)) * 0x27d4eb2d;
195
+ hash = hash ^ (hash >>> 15);
196
+ }
197
+
198
+ return Math.abs(hash);
199
+ }
200
+
201
+ /**
202
+ * The _hash function takes a key and returns a number.
203
+ * @param {K} key - The parameter "key" is of type K, which represents the type of the key that will be hashed.
204
+ * @returns The hash function is returning a number.
205
+ */
206
+ protected _hash(key: K): number {
207
+ return this.hashFn(key);
208
+ }
209
+
210
+ /**
211
+ * The function calculates a hash value for a given string using the djb2 algorithm.
212
+ * @param {string} key - The `key` parameter in the `stringHash` function is a string value that represents the input for
213
+ * which we want to calculate the hash value.
214
+ * @returns a number, which is the hash value of the input string.
215
+ */
216
+ protected _stringHash(key: string): number {
217
+ let hash = 0;
218
+ for (let i = 0; i < key.length; i++) {
219
+ hash = (hash * 31 + key.charCodeAt(i)) & 0xffffffff;
220
+ }
221
+ return hash;
222
+ }
223
+
224
+ /**
225
+ * The function `_objectHash` takes a key and returns a hash value, using a custom hash function for objects.
226
+ * @param {K} key - The parameter "key" is of type "K", which means it can be any type. It could be a string, number,
227
+ * boolean, object, or any other type of value. The purpose of the objectHash function is to generate a hash value for
228
+ * the key, which can be used for
229
+ * @returns a number, which is the hash value of the key.
230
+ */
231
+ protected _objectHash(key: K): number {
232
+ // If the key is an object, you can write a custom hash function
233
+ // For example, convert the object's properties to a string and use string hashing
234
+ // This is just an example; you should write a specific object hash function as needed
235
+ return this._stringHash(JSON.stringify(key));
236
+ }
237
+
238
+ /**
239
+ * The `expand` function increases the capacity of a hash table by creating a new array of buckets with double the
240
+ * capacity and rehashing all the existing key-value pairs into the new buckets.
241
+ */
242
+ protected _expand(): void {
243
+ const newCapacity = this._capacity * 2;
244
+ const newBuckets = new Array<HashTableNode<K, V> | null>(newCapacity).fill(null);
245
+
246
+ for (const bucket of this._buckets) {
247
+ let currentNode = bucket;
248
+ while (currentNode) {
249
+ const newIndex = this._hash(currentNode.key);
250
+ const newNode = new HashTableNode<K, V>(currentNode.key, currentNode.value);
251
+
252
+ if (!newBuckets[newIndex]) {
253
+ newBuckets[newIndex] = newNode;
254
+ } else {
255
+ let currentNewNode = newBuckets[newIndex]!;
256
+ while (currentNewNode.next) {
257
+ currentNewNode = currentNewNode.next;
258
+ }
259
+ currentNewNode.next = newNode;
260
+ }
261
+ currentNode = currentNode.next;
262
+ }
263
+ }
264
+
265
+ this._buckets = newBuckets;
266
+ this._capacity = newCapacity;
267
+ }
268
+ }
@@ -0,0 +1,2 @@
1
+ export * from './hash-table';
2
+ export * from './hash-map';