min-heap-typed 1.40.0-rc → 1.40.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 (347) hide show
  1. package/.dependency-cruiser.js +422 -422
  2. package/.eslintrc.js +59 -59
  3. package/.prettierrc.js +14 -14
  4. package/README.md +20 -3
  5. package/coverage/clover.xml +11 -7
  6. package/coverage/coverage-final.json +95 -1
  7. package/coverage/coverage-summary.json +59 -2
  8. package/coverage/lcov-report/base.css +278 -99
  9. package/coverage/lcov-report/index.html +69 -65
  10. package/coverage/lcov-report/index.ts.html +36 -35
  11. package/coverage/lcov-report/sorter.js +15 -5
  12. package/dist/data-structures/binary-tree/avl-tree.d.ts +106 -0
  13. package/dist/data-structures/binary-tree/avl-tree.js +347 -0
  14. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
  15. package/dist/data-structures/binary-tree/binary-indexed-tree.js +269 -0
  16. package/dist/data-structures/binary-tree/binary-tree.d.ts +355 -0
  17. package/dist/data-structures/binary-tree/binary-tree.js +1115 -0
  18. package/dist/data-structures/binary-tree/bst.d.ts +167 -0
  19. package/dist/data-structures/binary-tree/bst.js +512 -0
  20. package/dist/data-structures/binary-tree/index.d.ts +7 -0
  21. package/dist/data-structures/binary-tree/index.js +23 -0
  22. package/dist/data-structures/binary-tree/rb-tree.d.ts +11 -0
  23. package/dist/data-structures/binary-tree/rb-tree.js +21 -0
  24. package/dist/data-structures/binary-tree/segment-tree.d.ts +67 -0
  25. package/dist/data-structures/binary-tree/segment-tree.js +180 -0
  26. package/dist/data-structures/binary-tree/tree-multiset.d.ts +126 -0
  27. package/dist/data-structures/binary-tree/tree-multiset.js +355 -0
  28. package/dist/data-structures/graph/abstract-graph.d.ts +313 -0
  29. package/dist/data-structures/graph/abstract-graph.js +884 -0
  30. package/dist/data-structures/graph/directed-graph.d.ts +194 -0
  31. package/dist/data-structures/graph/directed-graph.js +404 -0
  32. package/dist/data-structures/graph/index.d.ts +4 -0
  33. package/dist/data-structures/graph/index.js +20 -0
  34. package/dist/data-structures/graph/map-graph.d.ts +73 -0
  35. package/dist/data-structures/graph/map-graph.js +93 -0
  36. package/dist/data-structures/graph/undirected-graph.d.ts +120 -0
  37. package/dist/data-structures/graph/undirected-graph.js +239 -0
  38. package/dist/data-structures/hash/coordinate-map.d.ts +44 -0
  39. package/dist/data-structures/hash/coordinate-map.js +62 -0
  40. package/dist/data-structures/hash/coordinate-set.d.ts +36 -0
  41. package/dist/data-structures/hash/coordinate-set.js +52 -0
  42. package/dist/data-structures/hash/hash-map.d.ts +50 -0
  43. package/dist/data-structures/hash/hash-map.js +153 -0
  44. package/dist/data-structures/hash/hash-table.d.ts +103 -0
  45. package/dist/data-structures/hash/hash-table.js +236 -0
  46. package/dist/data-structures/hash/index.d.ts +6 -0
  47. package/dist/data-structures/hash/index.js +22 -0
  48. package/dist/data-structures/hash/tree-map.d.ts +2 -0
  49. package/dist/data-structures/hash/tree-map.js +6 -0
  50. package/dist/data-structures/hash/tree-set.d.ts +2 -0
  51. package/dist/data-structures/hash/tree-set.js +6 -0
  52. package/dist/data-structures/heap/heap.d.ts +235 -0
  53. package/dist/data-structures/heap/heap.js +515 -0
  54. package/dist/data-structures/heap/index.d.ts +3 -0
  55. package/dist/data-structures/heap/index.js +19 -0
  56. package/dist/data-structures/heap/max-heap.d.ts +15 -0
  57. package/dist/data-structures/heap/max-heap.js +26 -0
  58. package/dist/data-structures/heap/min-heap.d.ts +15 -0
  59. package/dist/data-structures/heap/min-heap.js +26 -0
  60. package/dist/data-structures/index.d.ts +11 -0
  61. package/dist/data-structures/index.js +27 -0
  62. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
  63. package/dist/data-structures/linked-list/doubly-linked-list.js +569 -0
  64. package/dist/data-structures/linked-list/index.d.ts +3 -0
  65. package/dist/data-structures/linked-list/index.js +19 -0
  66. package/dist/data-structures/linked-list/singly-linked-list.d.ts +232 -0
  67. package/dist/data-structures/linked-list/singly-linked-list.js +533 -0
  68. package/dist/data-structures/linked-list/skip-linked-list.d.ts +80 -0
  69. package/dist/data-structures/linked-list/skip-linked-list.js +187 -0
  70. package/dist/data-structures/matrix/index.d.ts +4 -0
  71. package/dist/data-structures/matrix/index.js +20 -0
  72. package/dist/data-structures/matrix/matrix.d.ts +21 -0
  73. package/dist/data-structures/matrix/matrix.js +28 -0
  74. package/dist/data-structures/matrix/matrix2d.d.ts +107 -0
  75. package/dist/data-structures/matrix/matrix2d.js +199 -0
  76. package/dist/data-structures/matrix/navigator.d.ts +52 -0
  77. package/dist/data-structures/matrix/navigator.js +106 -0
  78. package/dist/data-structures/matrix/vector2d.d.ts +200 -0
  79. package/dist/data-structures/matrix/vector2d.js +290 -0
  80. package/dist/data-structures/priority-queue/index.d.ts +3 -0
  81. package/dist/data-structures/priority-queue/index.js +19 -0
  82. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
  83. package/dist/data-structures/priority-queue/max-priority-queue.js +26 -0
  84. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
  85. package/dist/data-structures/priority-queue/min-priority-queue.js +26 -0
  86. package/dist/data-structures/priority-queue/priority-queue.d.ts +15 -0
  87. package/dist/data-structures/priority-queue/priority-queue.js +17 -0
  88. package/dist/data-structures/queue/deque.d.ts +161 -0
  89. package/dist/data-structures/queue/deque.js +264 -0
  90. package/dist/data-structures/queue/index.d.ts +2 -0
  91. package/dist/data-structures/queue/index.js +18 -0
  92. package/dist/data-structures/queue/queue.d.ts +122 -0
  93. package/dist/data-structures/queue/queue.js +187 -0
  94. package/dist/data-structures/stack/index.d.ts +1 -0
  95. package/dist/data-structures/stack/index.js +17 -0
  96. package/dist/data-structures/stack/stack.d.ts +64 -0
  97. package/dist/data-structures/stack/stack.js +94 -0
  98. package/dist/data-structures/tree/index.d.ts +1 -0
  99. package/dist/data-structures/tree/index.js +17 -0
  100. package/dist/data-structures/tree/tree.d.ts +8 -0
  101. package/dist/data-structures/tree/tree.js +40 -0
  102. package/dist/data-structures/trie/index.d.ts +1 -0
  103. package/dist/data-structures/trie/index.js +17 -0
  104. package/dist/data-structures/trie/trie.d.ts +79 -0
  105. package/dist/data-structures/trie/trie.js +251 -0
  106. package/dist/index.d.ts +3 -1
  107. package/dist/index.js +18 -4
  108. package/dist/interfaces/binary-tree.d.ts +7 -0
  109. package/dist/interfaces/binary-tree.js +2 -0
  110. package/dist/interfaces/doubly-linked-list.d.ts +1 -0
  111. package/dist/interfaces/doubly-linked-list.js +2 -0
  112. package/dist/interfaces/graph.d.ts +5 -0
  113. package/dist/interfaces/graph.js +2 -0
  114. package/dist/interfaces/heap.d.ts +1 -0
  115. package/dist/interfaces/heap.js +2 -0
  116. package/dist/interfaces/index.d.ts +8 -0
  117. package/dist/interfaces/index.js +24 -0
  118. package/dist/interfaces/navigator.d.ts +1 -0
  119. package/dist/interfaces/navigator.js +2 -0
  120. package/dist/interfaces/priority-queue.d.ts +1 -0
  121. package/dist/interfaces/priority-queue.js +2 -0
  122. package/dist/interfaces/segment-tree.d.ts +1 -0
  123. package/dist/interfaces/segment-tree.js +2 -0
  124. package/dist/interfaces/singly-linked-list.d.ts +1 -0
  125. package/dist/interfaces/singly-linked-list.js +2 -0
  126. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
  127. package/dist/types/data-structures/binary-tree/avl-tree.js +2 -0
  128. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
  129. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  130. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
  131. package/dist/types/data-structures/binary-tree/binary-tree.js +24 -0
  132. package/dist/types/data-structures/binary-tree/bst.d.ts +7 -0
  133. package/dist/types/data-structures/binary-tree/bst.js +2 -0
  134. package/dist/types/data-structures/binary-tree/index.d.ts +6 -0
  135. package/dist/types/data-structures/binary-tree/index.js +22 -0
  136. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +8 -0
  137. package/dist/types/data-structures/binary-tree/rb-tree.js +8 -0
  138. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +1 -0
  139. package/dist/types/data-structures/binary-tree/segment-tree.js +2 -0
  140. package/dist/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
  141. package/dist/types/data-structures/binary-tree/tree-multiset.js +2 -0
  142. package/dist/types/data-structures/graph/abstract-graph.d.ts +10 -0
  143. package/dist/types/data-structures/graph/abstract-graph.js +2 -0
  144. package/dist/types/data-structures/graph/directed-graph.d.ts +6 -0
  145. package/dist/types/data-structures/graph/directed-graph.js +9 -0
  146. package/dist/types/data-structures/graph/index.d.ts +3 -0
  147. package/dist/types/data-structures/graph/index.js +19 -0
  148. package/dist/types/data-structures/graph/map-graph.d.ts +1 -0
  149. package/dist/types/data-structures/graph/map-graph.js +2 -0
  150. package/dist/types/data-structures/graph/undirected-graph.d.ts +1 -0
  151. package/dist/types/data-structures/graph/undirected-graph.js +2 -0
  152. package/dist/types/data-structures/hash/coordinate-map.d.ts +1 -0
  153. package/dist/types/data-structures/hash/coordinate-map.js +2 -0
  154. package/dist/types/data-structures/hash/coordinate-set.d.ts +1 -0
  155. package/dist/types/data-structures/hash/coordinate-set.js +2 -0
  156. package/dist/types/data-structures/hash/hash-map.d.ts +1 -0
  157. package/dist/types/data-structures/hash/hash-map.js +2 -0
  158. package/dist/types/data-structures/hash/hash-table.d.ts +1 -0
  159. package/dist/types/data-structures/hash/hash-table.js +2 -0
  160. package/dist/types/data-structures/hash/index.d.ts +1 -0
  161. package/dist/types/data-structures/hash/index.js +2 -0
  162. package/dist/types/data-structures/hash/tree-map.d.ts +1 -0
  163. package/dist/types/data-structures/hash/tree-map.js +2 -0
  164. package/dist/types/data-structures/hash/tree-set.d.ts +1 -0
  165. package/dist/types/data-structures/hash/tree-set.js +2 -0
  166. package/dist/types/data-structures/heap/heap.d.ts +1 -0
  167. package/dist/types/data-structures/heap/heap.js +2 -0
  168. package/dist/types/data-structures/heap/index.d.ts +1 -0
  169. package/dist/types/data-structures/heap/index.js +17 -0
  170. package/dist/types/data-structures/heap/max-heap.d.ts +1 -0
  171. package/dist/types/data-structures/heap/max-heap.js +2 -0
  172. package/dist/types/data-structures/heap/min-heap.d.ts +1 -0
  173. package/dist/types/data-structures/heap/min-heap.js +2 -0
  174. package/dist/types/data-structures/index.d.ts +11 -0
  175. package/dist/types/data-structures/index.js +27 -0
  176. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
  177. package/dist/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  178. package/dist/types/data-structures/linked-list/index.d.ts +2 -0
  179. package/dist/types/data-structures/linked-list/index.js +18 -0
  180. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
  181. package/dist/types/data-structures/linked-list/singly-linked-list.js +2 -0
  182. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  183. package/dist/types/data-structures/linked-list/skip-linked-list.js +2 -0
  184. package/dist/types/data-structures/matrix/index.d.ts +1 -0
  185. package/dist/types/data-structures/matrix/index.js +17 -0
  186. package/dist/types/data-structures/matrix/matrix.d.ts +1 -0
  187. package/dist/types/data-structures/matrix/matrix.js +2 -0
  188. package/dist/types/data-structures/matrix/matrix2d.d.ts +1 -0
  189. package/dist/types/data-structures/matrix/matrix2d.js +2 -0
  190. package/dist/types/data-structures/matrix/navigator.d.ts +14 -0
  191. package/dist/types/data-structures/matrix/navigator.js +2 -0
  192. package/dist/types/data-structures/matrix/vector2d.d.ts +1 -0
  193. package/dist/types/data-structures/matrix/vector2d.js +2 -0
  194. package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
  195. package/dist/types/data-structures/priority-queue/index.js +19 -0
  196. package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  197. package/dist/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  198. package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  199. package/dist/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  200. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  201. package/dist/types/data-structures/priority-queue/priority-queue.js +2 -0
  202. package/dist/types/data-structures/queue/deque.d.ts +1 -0
  203. package/dist/types/data-structures/queue/deque.js +2 -0
  204. package/dist/types/data-structures/queue/index.d.ts +2 -0
  205. package/dist/types/data-structures/queue/index.js +18 -0
  206. package/dist/types/data-structures/queue/queue.d.ts +1 -0
  207. package/dist/types/data-structures/queue/queue.js +2 -0
  208. package/dist/types/data-structures/stack/index.d.ts +1 -0
  209. package/dist/types/data-structures/stack/index.js +17 -0
  210. package/dist/types/data-structures/stack/stack.d.ts +1 -0
  211. package/dist/types/data-structures/stack/stack.js +2 -0
  212. package/dist/types/data-structures/tree/index.d.ts +1 -0
  213. package/dist/types/data-structures/tree/index.js +17 -0
  214. package/dist/types/data-structures/tree/tree.d.ts +1 -0
  215. package/dist/types/data-structures/tree/tree.js +2 -0
  216. package/dist/types/data-structures/trie/index.d.ts +1 -0
  217. package/dist/types/data-structures/trie/index.js +17 -0
  218. package/dist/types/data-structures/trie/trie.d.ts +1 -0
  219. package/dist/types/data-structures/trie/trie.js +2 -0
  220. package/dist/types/helpers.d.ts +8 -0
  221. package/dist/types/helpers.js +9 -0
  222. package/dist/types/index.d.ts +3 -0
  223. package/dist/types/index.js +19 -0
  224. package/dist/types/utils/index.d.ts +2 -0
  225. package/dist/types/utils/index.js +18 -0
  226. package/dist/types/utils/utils.d.ts +7 -0
  227. package/dist/types/utils/utils.js +2 -0
  228. package/dist/types/utils/validate-type.d.ts +19 -0
  229. package/dist/types/utils/validate-type.js +2 -0
  230. package/dist/utils/index.d.ts +1 -0
  231. package/dist/utils/index.js +17 -0
  232. package/dist/utils/utils.d.ts +20 -0
  233. package/dist/utils/utils.js +73 -0
  234. package/jest.config.js +6 -6
  235. package/package.json +2 -2
  236. package/src/data-structures/binary-tree/avl-tree.ts +350 -0
  237. package/src/data-structures/binary-tree/binary-indexed-tree.ts +306 -0
  238. package/src/data-structures/binary-tree/binary-tree.ts +1262 -0
  239. package/src/data-structures/binary-tree/bst.ts +522 -0
  240. package/src/data-structures/binary-tree/index.ts +7 -0
  241. package/src/data-structures/binary-tree/rb-tree.ts +358 -0
  242. package/src/data-structures/binary-tree/segment-tree.ts +190 -0
  243. package/src/data-structures/binary-tree/tree-multiset.ts +379 -0
  244. package/src/data-structures/graph/abstract-graph.ts +1000 -0
  245. package/src/data-structures/graph/directed-graph.ts +449 -0
  246. package/src/data-structures/graph/index.ts +4 -0
  247. package/src/data-structures/graph/map-graph.ts +106 -0
  248. package/src/data-structures/graph/undirected-graph.ts +259 -0
  249. package/src/data-structures/hash/coordinate-map.ts +63 -0
  250. package/src/data-structures/hash/coordinate-set.ts +52 -0
  251. package/src/data-structures/hash/hash-map.ts +185 -0
  252. package/src/data-structures/hash/hash-table.ts +268 -0
  253. package/src/data-structures/hash/index.ts +6 -0
  254. package/src/data-structures/hash/tree-map.ts +2 -0
  255. package/src/data-structures/hash/tree-set.ts +2 -0
  256. package/src/data-structures/heap/heap.ts +589 -0
  257. package/src/data-structures/heap/index.ts +3 -0
  258. package/src/data-structures/heap/max-heap.ts +26 -0
  259. package/src/data-structures/heap/min-heap.ts +26 -0
  260. package/src/data-structures/index.ts +11 -0
  261. package/src/data-structures/linked-list/doubly-linked-list.ts +605 -0
  262. package/src/data-structures/linked-list/index.ts +3 -0
  263. package/src/data-structures/linked-list/singly-linked-list.ts +576 -0
  264. package/src/data-structures/linked-list/skip-linked-list.ts +221 -0
  265. package/src/data-structures/matrix/index.ts +4 -0
  266. package/src/data-structures/matrix/matrix.ts +27 -0
  267. package/src/data-structures/matrix/matrix2d.ts +211 -0
  268. package/src/data-structures/matrix/navigator.ts +121 -0
  269. package/src/data-structures/matrix/vector2d.ts +315 -0
  270. package/src/data-structures/priority-queue/index.ts +3 -0
  271. package/src/data-structures/priority-queue/max-priority-queue.ts +25 -0
  272. package/src/data-structures/priority-queue/min-priority-queue.ts +25 -0
  273. package/src/data-structures/priority-queue/priority-queue.ts +16 -0
  274. package/src/data-structures/queue/deque.ts +282 -0
  275. package/src/data-structures/queue/index.ts +2 -0
  276. package/src/data-structures/queue/queue.ts +209 -0
  277. package/src/data-structures/stack/index.ts +1 -0
  278. package/src/data-structures/stack/stack.ts +102 -0
  279. package/src/data-structures/tree/index.ts +1 -0
  280. package/src/data-structures/tree/tree.ts +41 -0
  281. package/src/data-structures/trie/index.ts +1 -0
  282. package/src/data-structures/trie/trie.ts +262 -0
  283. package/src/index.ts +4 -1
  284. package/src/interfaces/binary-tree.ts +10 -0
  285. package/src/interfaces/doubly-linked-list.ts +1 -0
  286. package/src/interfaces/graph.ts +7 -0
  287. package/src/interfaces/heap.ts +1 -0
  288. package/src/interfaces/index.ts +8 -0
  289. package/src/interfaces/navigator.ts +1 -0
  290. package/src/interfaces/priority-queue.ts +1 -0
  291. package/src/interfaces/segment-tree.ts +1 -0
  292. package/src/interfaces/singly-linked-list.ts +1 -0
  293. package/src/types/data-structures/binary-tree/avl-tree.ts +5 -0
  294. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  295. package/src/types/data-structures/binary-tree/binary-tree.ts +31 -0
  296. package/src/types/data-structures/binary-tree/bst.ts +11 -0
  297. package/src/types/data-structures/binary-tree/index.ts +6 -0
  298. package/src/types/data-structures/binary-tree/rb-tree.ts +8 -0
  299. package/src/types/data-structures/binary-tree/segment-tree.ts +1 -0
  300. package/src/types/data-structures/binary-tree/tree-multiset.ts +6 -0
  301. package/src/types/data-structures/graph/abstract-graph.ts +11 -0
  302. package/src/types/data-structures/graph/directed-graph.ts +8 -0
  303. package/src/types/data-structures/graph/index.ts +3 -0
  304. package/src/types/data-structures/graph/map-graph.ts +1 -0
  305. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  306. package/src/types/data-structures/hash/coordinate-map.ts +1 -0
  307. package/src/types/data-structures/hash/coordinate-set.ts +1 -0
  308. package/src/types/data-structures/hash/hash-map.ts +1 -0
  309. package/src/types/data-structures/hash/hash-table.ts +1 -0
  310. package/src/types/data-structures/hash/index.ts +1 -0
  311. package/src/types/data-structures/hash/tree-map.ts +1 -0
  312. package/src/types/data-structures/hash/tree-set.ts +1 -0
  313. package/src/types/data-structures/heap/heap.ts +1 -0
  314. package/src/types/data-structures/heap/index.ts +1 -0
  315. package/src/types/data-structures/heap/max-heap.ts +1 -0
  316. package/src/types/data-structures/heap/min-heap.ts +1 -0
  317. package/src/types/data-structures/index.ts +11 -0
  318. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
  319. package/src/types/data-structures/linked-list/index.ts +2 -0
  320. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
  321. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  322. package/src/types/data-structures/matrix/index.ts +1 -0
  323. package/src/types/data-structures/matrix/matrix.ts +1 -0
  324. package/src/types/data-structures/matrix/matrix2d.ts +1 -0
  325. package/src/types/data-structures/matrix/navigator.ts +14 -0
  326. package/src/types/data-structures/matrix/vector2d.ts +1 -0
  327. package/src/types/data-structures/priority-queue/index.ts +3 -0
  328. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  329. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  330. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  331. package/src/types/data-structures/queue/deque.ts +1 -0
  332. package/src/types/data-structures/queue/index.ts +2 -0
  333. package/src/types/data-structures/queue/queue.ts +1 -0
  334. package/src/types/data-structures/stack/index.ts +1 -0
  335. package/src/types/data-structures/stack/stack.ts +1 -0
  336. package/src/types/data-structures/tree/index.ts +1 -0
  337. package/src/types/data-structures/tree/tree.ts +1 -0
  338. package/src/types/data-structures/trie/index.ts +1 -0
  339. package/src/types/data-structures/trie/trie.ts +1 -0
  340. package/src/types/helpers.ts +11 -0
  341. package/src/types/index.ts +3 -0
  342. package/src/types/utils/index.ts +2 -0
  343. package/src/types/utils/utils.ts +6 -0
  344. package/src/types/utils/validate-type.ts +35 -0
  345. package/src/utils/index.ts +1 -0
  346. package/src/utils/utils.ts +86 -0
  347. package/tsconfig.json +1 -2
package/.eslintrc.js CHANGED
@@ -1,65 +1,65 @@
1
1
  module.exports = {
2
- 'extends': [
3
- 'plugin:@typescript-eslint/recommended',
4
- 'prettier'
5
- ],
6
- 'rules': {
7
- 'react/display-name': 'off',
8
- '@next/next/no-img-element': 'off',
9
- 'react/no-unescaped-entities': 'off',
10
- 'import/no-anonymous-default-export': 'off',
11
- '@typescript-eslint/no-unused-vars': 'error',
12
- '@typescript-eslint/ban-ts-comment': 'off',
13
- '@typescript-eslint/no-explicit-any': 'off',
14
- '@typescript-eslint/no-non-null-assertion': 'off',
15
- // add new line above comment
16
- 'lines-around-comment': [
17
- 'error',
18
- {
19
- 'beforeLineComment': false,
20
- 'beforeBlockComment': true,
21
- 'allowBlockStart': true,
22
- 'allowClassStart': true,
23
- 'allowObjectStart': true,
24
- 'allowArrayStart': true
25
- }
2
+ 'extends': [
3
+ 'plugin:@typescript-eslint/recommended',
4
+ 'prettier'
26
5
  ],
27
- // add new line above return
28
- 'newline-before-return': 'off',
29
- // add new line below import
30
- 'import/newline-after-import': [
31
- 'error',
32
- {
33
- 'count': 1
34
- }
6
+ 'rules': {
7
+ 'react/display-name': 'off',
8
+ '@next/next/no-img-element': 'off',
9
+ 'react/no-unescaped-entities': 'off',
10
+ 'import/no-anonymous-default-export': 'off',
11
+ '@typescript-eslint/no-unused-vars': 'error',
12
+ '@typescript-eslint/ban-ts-comment': 'off',
13
+ '@typescript-eslint/no-explicit-any': 'off',
14
+ '@typescript-eslint/no-non-null-assertion': 'off',
15
+ // add new line above comment
16
+ 'lines-around-comment': [
17
+ 'error',
18
+ {
19
+ 'beforeLineComment': false,
20
+ 'beforeBlockComment': true,
21
+ 'allowBlockStart': true,
22
+ 'allowClassStart': true,
23
+ 'allowObjectStart': true,
24
+ 'allowArrayStart': true
25
+ }
26
+ ],
27
+ // add new line above return
28
+ 'newline-before-return': 'off',
29
+ // add new line below import
30
+ 'import/newline-after-import': [
31
+ 'error',
32
+ {
33
+ 'count': 1
34
+ }
35
+ ],
36
+ '@typescript-eslint/ban-types': [
37
+ 'error',
38
+ {
39
+ 'extendDefaults': true,
40
+ 'types': {
41
+ '{}': false
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ 'plugins': [
47
+ 'import'
35
48
  ],
36
- '@typescript-eslint/ban-types': [
37
- 'error',
38
- {
39
- 'extendDefaults': true,
40
- 'types': {
41
- '{}': false
49
+ 'settings': {
50
+ 'import/parsers': {
51
+ '@typescript-eslint/parser': [
52
+ '.ts',
53
+ '.tsx'
54
+ ]
55
+ },
56
+ 'import/resolver': {
57
+ 'typescript': {
58
+ 'alwaysTryTypes': true,
59
+ 'project': [
60
+ './tsconfig.json'
61
+ ]
62
+ }
42
63
  }
43
- }
44
- ]
45
- },
46
- 'plugins': [
47
- 'import'
48
- ],
49
- 'settings': {
50
- 'import/parsers': {
51
- '@typescript-eslint/parser': [
52
- '.ts',
53
- '.tsx'
54
- ]
55
- },
56
- 'import/resolver': {
57
- 'typescript': {
58
- 'alwaysTryTypes': true,
59
- 'project': [
60
- './tsconfig.json'
61
- ]
62
- }
63
64
  }
64
- }
65
65
  }
package/.prettierrc.js CHANGED
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
- arrowParens: 'avoid',
3
- bracketSpacing: true,
4
- htmlWhitespaceSensitivity: 'css',
5
- insertPragma: false,
6
- bracketSameLine: false,
7
- jsxSingleQuote: true,
8
- printWidth: 120,
9
- proseWrap: 'preserve',
10
- quoteProps: 'as-needed',
11
- requirePragma: false,
12
- singleQuote: true,
13
- tabWidth: 2,
14
- trailingComma: 'none',
15
- useTabs: false
2
+ arrowParens: 'avoid',
3
+ bracketSpacing: true,
4
+ htmlWhitespaceSensitivity: 'css',
5
+ insertPragma: false,
6
+ bracketSameLine: false,
7
+ jsxSingleQuote: true,
8
+ printWidth: 120,
9
+ proseWrap: 'preserve',
10
+ quoteProps: 'as-needed',
11
+ requirePragma: false,
12
+ singleQuote: true,
13
+ tabWidth: 2,
14
+ trailingComma: 'none',
15
+ useTabs: false
16
16
  }
package/README.md CHANGED
@@ -1,22 +1,41 @@
1
+ ![NPM](https://img.shields.io/npm/l/min-heap-typed)
2
+ ![GitHub top language](https://img.shields.io/github/languages/top/zrwusa/data-structure-typed)
3
+ ![npm](https://img.shields.io/npm/dw/min-heap-typed)
4
+ ![eslint](https://aleen42.github.io/badges/src/eslint.svg)
5
+ ![npm package minimized gzipped size (select exports)](https://img.shields.io/bundlejs/size/min-heap-typed)
6
+ ![npm bundle size](https://img.shields.io/bundlephobia/min/min-heap-typed)
7
+ ![npm](https://img.shields.io/npm/v/min-heap-typed)
8
+
1
9
  # What
10
+
2
11
  ## Brief
3
- This is a standalone Min Heap data structure from the data-structure-typed collection. If you wish to access more data structures or advanced features, you can transition to directly installing the complete [data-structure-typed](https://www.npmjs.com/package/data-structure-typed) package
4
12
 
13
+ This is a standalone Min Heap data structure from the data-structure-typed collection. If you wish to access more data
14
+ structures or advanced features, you can transition to directly installing the
15
+ complete [data-structure-typed](https://www.npmjs.com/package/data-structure-typed) package
5
16
 
6
17
  # How
7
18
 
8
19
  ## install
20
+
9
21
  ### npm
22
+
10
23
  ```bash
11
24
  npm i min-heap-typed --save
12
25
  ```
26
+
13
27
  ### yarn
28
+
14
29
  ```bash
15
30
  yarn add min-heap-typed
16
31
  ```
32
+
17
33
  ### methods
34
+
18
35
  ![](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/methods-8bit/min-heap.png?raw=true)
36
+
19
37
  ### snippet
38
+
20
39
  #### TS
21
40
 
22
41
  ```typescript
@@ -65,7 +84,6 @@ yarn add min-heap-typed
65
84
  minNumHeap.sort() // [2, 5, 6, 9]
66
85
  ```
67
86
 
68
-
69
87
  ## API docs & Examples
70
88
 
71
89
  [API Docs](https://data-structure-typed-docs.vercel.app)
@@ -267,7 +285,6 @@ yarn add min-heap-typed
267
285
  </tbody>
268
286
  </table>
269
287
 
270
-
271
288
  # Why
272
289
 
273
290
  ## Complexities
@@ -1,10 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <coverage generated="1696760596424" clover="3.2.0">
3
- <project timestamp="1696760596425" name="All files">
4
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2" elements="3" coveredelements="3" complexity="0" loc="1" ncloc="1" packages="1" files="1" classes="1"/>
5
- <file name="index.ts" path="/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts">
6
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2"/>
7
- <line num="8" count="11" type="stmt"/>
8
- </file>
9
- </project>
3
+ <project timestamp="1696760596425" name="All files">
4
+ <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
5
+ coveredmethods="2" elements="3" coveredelements="3" complexity="0" loc="1" ncloc="1" packages="1"
6
+ files="1" classes="1"/>
7
+ <file name="index.ts"
8
+ path="/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts">
9
+ <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
10
+ coveredmethods="2"/>
11
+ <line num="8" count="11" type="stmt"/>
12
+ </file>
13
+ </project>
10
14
  </coverage>
@@ -1,2 +1,96 @@
1
- {"/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts": {"path":"/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts","statementMap":{"0":{"start":{"line":8,"column":0},"end":{"line":8,"column":9}},"1":{"start":{"line":8,"column":9},"end":{"line":8,"column":18}},"2":{"start":{"line":8,"column":18},"end":{"line":8,"column":57}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":8,"column":9},"end":{"line":8,"column":16}},"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":18}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":18},"end":{"line":8,"column":26}},"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":57}}}},"branchMap":{},"s":{"0":1,"1":4,"2":11},"f":{"0":3,"1":10},"b":{}}
1
+ {
2
+ "/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts": {
3
+ "path": "/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts",
4
+ "statementMap": {
5
+ "0": {
6
+ "start": {
7
+ "line": 8,
8
+ "column": 0
9
+ },
10
+ "end": {
11
+ "line": 8,
12
+ "column": 9
13
+ }
14
+ },
15
+ "1": {
16
+ "start": {
17
+ "line": 8,
18
+ "column": 9
19
+ },
20
+ "end": {
21
+ "line": 8,
22
+ "column": 18
23
+ }
24
+ },
25
+ "2": {
26
+ "start": {
27
+ "line": 8,
28
+ "column": 18
29
+ },
30
+ "end": {
31
+ "line": 8,
32
+ "column": 57
33
+ }
34
+ }
35
+ },
36
+ "fnMap": {
37
+ "0": {
38
+ "name": "(anonymous_0)",
39
+ "decl": {
40
+ "start": {
41
+ "line": 8,
42
+ "column": 9
43
+ },
44
+ "end": {
45
+ "line": 8,
46
+ "column": 16
47
+ }
48
+ },
49
+ "loc": {
50
+ "start": {
51
+ "line": 8,
52
+ "column": 9
53
+ },
54
+ "end": {
55
+ "line": 8,
56
+ "column": 18
57
+ }
58
+ }
59
+ },
60
+ "1": {
61
+ "name": "(anonymous_1)",
62
+ "decl": {
63
+ "start": {
64
+ "line": 8,
65
+ "column": 18
66
+ },
67
+ "end": {
68
+ "line": 8,
69
+ "column": 26
70
+ }
71
+ },
72
+ "loc": {
73
+ "start": {
74
+ "line": 8,
75
+ "column": 18
76
+ },
77
+ "end": {
78
+ "line": 8,
79
+ "column": 57
80
+ }
81
+ }
82
+ }
83
+ },
84
+ "branchMap": {},
85
+ "s": {
86
+ "0": 1,
87
+ "1": 4,
88
+ "2": 11
89
+ },
90
+ "f": {
91
+ "0": 3,
92
+ "1": 10
93
+ },
94
+ "b": {}
95
+ }
2
96
  }
@@ -1,3 +1,60 @@
1
- {"total": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2
- ,"/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
1
+ {
2
+ "total": {
3
+ "lines": {
4
+ "total": 1,
5
+ "covered": 1,
6
+ "skipped": 0,
7
+ "pct": 100
8
+ },
9
+ "statements": {
10
+ "total": 3,
11
+ "covered": 3,
12
+ "skipped": 0,
13
+ "pct": 100
14
+ },
15
+ "functions": {
16
+ "total": 2,
17
+ "covered": 2,
18
+ "skipped": 0,
19
+ "pct": 100
20
+ },
21
+ "branches": {
22
+ "total": 0,
23
+ "covered": 0,
24
+ "skipped": 0,
25
+ "pct": 100
26
+ },
27
+ "branchesTrue": {
28
+ "total": 0,
29
+ "covered": 0,
30
+ "skipped": 0,
31
+ "pct": "Unknown"
32
+ }
33
+ },
34
+ "/Users/revone/projects/data-structure-typed-individuals/min-heap-typed/src/index.ts": {
35
+ "lines": {
36
+ "total": 1,
37
+ "covered": 1,
38
+ "skipped": 0,
39
+ "pct": 100
40
+ },
41
+ "functions": {
42
+ "total": 2,
43
+ "covered": 2,
44
+ "skipped": 0,
45
+ "pct": 100
46
+ },
47
+ "statements": {
48
+ "total": 3,
49
+ "covered": 3,
50
+ "skipped": 0,
51
+ "pct": 100
52
+ },
53
+ "branches": {
54
+ "total": 0,
55
+ "covered": 0,
56
+ "skipped": 0,
57
+ "pct": 100
58
+ }
59
+ }
3
60
  }