data-structure-typed 1.37.3 → 1.37.5

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 (346) hide show
  1. package/dist/data-structures/binary-tree/avl-tree.d.ts +42 -34
  2. package/dist/data-structures/binary-tree/avl-tree.js +42 -34
  3. package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
  4. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +141 -43
  5. package/dist/data-structures/binary-tree/binary-indexed-tree.js +230 -42
  6. package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +1 -1
  7. package/dist/data-structures/binary-tree/binary-tree.d.ts +265 -168
  8. package/dist/data-structures/binary-tree/binary-tree.js +257 -170
  9. package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
  10. package/dist/data-structures/binary-tree/bst.d.ts +104 -59
  11. package/dist/data-structures/binary-tree/bst.js +105 -60
  12. package/dist/data-structures/binary-tree/bst.js.map +1 -1
  13. package/dist/data-structures/binary-tree/tree-multiset.d.ts +47 -39
  14. package/dist/data-structures/binary-tree/tree-multiset.js +47 -39
  15. package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
  16. package/{lib/types/data-structures → dist/types/data-structures/binary-tree}/avl-tree.d.ts +1 -1
  17. package/dist/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  18. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  19. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  20. package/dist/types/data-structures/{binary-tree.d.ts → binary-tree/binary-tree.d.ts} +1 -5
  21. package/dist/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  22. package/dist/types/data-structures/{bst.d.ts → binary-tree/bst.d.ts} +1 -1
  23. package/dist/types/data-structures/binary-tree/bst.js.map +1 -0
  24. package/dist/types/data-structures/binary-tree/index.d.ts +6 -0
  25. package/dist/types/data-structures/binary-tree/index.js +23 -0
  26. package/dist/types/data-structures/binary-tree/index.js.map +1 -0
  27. package/dist/types/data-structures/{rb-tree.d.ts → binary-tree/rb-tree.d.ts} +1 -1
  28. package/dist/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  29. package/dist/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  30. package/dist/types/data-structures/{tree-multiset.d.ts → binary-tree/tree-multiset.d.ts} +1 -1
  31. package/dist/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  32. package/dist/types/data-structures/graph/abstract-graph.js.map +1 -0
  33. package/dist/types/data-structures/graph/directed-graph.js.map +1 -0
  34. package/dist/types/data-structures/graph/index.d.ts +3 -0
  35. package/dist/types/data-structures/graph/index.js +20 -0
  36. package/dist/types/data-structures/graph/index.js.map +1 -0
  37. package/dist/types/data-structures/graph/map-graph.js.map +1 -0
  38. package/dist/types/data-structures/graph/undirected-graph.js +3 -0
  39. package/dist/types/data-structures/graph/undirected-graph.js.map +1 -0
  40. package/dist/types/data-structures/hash/coordinate-map.js +3 -0
  41. package/dist/types/data-structures/hash/coordinate-map.js.map +1 -0
  42. package/dist/types/data-structures/hash/coordinate-set.js +3 -0
  43. package/dist/types/data-structures/hash/coordinate-set.js.map +1 -0
  44. package/dist/types/data-structures/hash/hash-map.js +3 -0
  45. package/dist/types/data-structures/hash/hash-map.js.map +1 -0
  46. package/dist/types/data-structures/hash/hash-table.js +3 -0
  47. package/dist/types/data-structures/hash/hash-table.js.map +1 -0
  48. package/dist/types/data-structures/hash/index.js +3 -0
  49. package/dist/types/data-structures/hash/index.js.map +1 -0
  50. package/dist/types/data-structures/hash/tree-map.js +3 -0
  51. package/dist/types/data-structures/hash/tree-map.js.map +1 -0
  52. package/dist/types/data-structures/hash/tree-set.js +3 -0
  53. package/dist/types/data-structures/hash/tree-set.js.map +1 -0
  54. package/dist/types/data-structures/heap/heap.js.map +1 -0
  55. package/dist/types/data-structures/heap/index.d.ts +1 -0
  56. package/dist/types/data-structures/heap/index.js +18 -0
  57. package/dist/types/data-structures/heap/index.js.map +1 -0
  58. package/dist/types/data-structures/heap/max-heap.js +3 -0
  59. package/dist/types/data-structures/heap/max-heap.js.map +1 -0
  60. package/dist/types/data-structures/heap/min-heap.js +3 -0
  61. package/dist/types/data-structures/heap/min-heap.js.map +1 -0
  62. package/dist/types/data-structures/index.d.ts +8 -13
  63. package/dist/types/data-structures/index.js +8 -11
  64. package/dist/types/data-structures/index.js.map +1 -1
  65. package/dist/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  66. package/dist/types/data-structures/linked-list/index.d.ts +2 -0
  67. package/dist/types/data-structures/linked-list/index.js +19 -0
  68. package/dist/types/data-structures/linked-list/index.js.map +1 -0
  69. package/dist/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  70. package/dist/types/data-structures/linked-list/skip-linked-list.js +3 -0
  71. package/dist/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  72. package/dist/types/data-structures/matrix/index.d.ts +1 -0
  73. package/dist/types/data-structures/matrix/index.js +18 -0
  74. package/dist/types/data-structures/matrix/index.js.map +1 -0
  75. package/dist/types/data-structures/matrix/matrix.js +3 -0
  76. package/dist/types/data-structures/matrix/matrix.js.map +1 -0
  77. package/dist/types/data-structures/matrix/matrix2d.js +3 -0
  78. package/dist/types/data-structures/matrix/matrix2d.js.map +1 -0
  79. package/dist/types/data-structures/matrix/navigator.js.map +1 -0
  80. package/dist/types/data-structures/matrix/vector2d.js +3 -0
  81. package/dist/types/data-structures/matrix/vector2d.js.map +1 -0
  82. package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
  83. package/dist/types/data-structures/priority-queue/index.js +20 -0
  84. package/dist/types/data-structures/priority-queue/index.js.map +1 -0
  85. package/dist/types/data-structures/priority-queue/max-priority-queue.js +3 -0
  86. package/dist/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  87. package/dist/types/data-structures/priority-queue/min-priority-queue.js +3 -0
  88. package/dist/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  89. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  90. package/dist/types/data-structures/priority-queue/priority-queue.js +3 -0
  91. package/dist/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  92. package/dist/types/data-structures/queue/deque.d.ts +1 -0
  93. package/dist/types/data-structures/queue/deque.js +3 -0
  94. package/dist/types/data-structures/queue/deque.js.map +1 -0
  95. package/dist/types/data-structures/queue/index.d.ts +2 -0
  96. package/dist/types/data-structures/queue/index.js +19 -0
  97. package/dist/types/data-structures/queue/index.js.map +1 -0
  98. package/dist/types/data-structures/queue/queue.d.ts +1 -0
  99. package/dist/types/data-structures/queue/queue.js +3 -0
  100. package/dist/types/data-structures/queue/queue.js.map +1 -0
  101. package/dist/types/data-structures/stack/index.d.ts +1 -0
  102. package/dist/types/data-structures/stack/index.js +18 -0
  103. package/dist/types/data-structures/stack/index.js.map +1 -0
  104. package/dist/types/data-structures/stack/stack.d.ts +1 -0
  105. package/dist/types/data-structures/stack/stack.js +3 -0
  106. package/dist/types/data-structures/stack/stack.js.map +1 -0
  107. package/dist/types/data-structures/tree/index.d.ts +1 -0
  108. package/dist/types/data-structures/tree/index.js +18 -0
  109. package/dist/types/data-structures/tree/index.js.map +1 -0
  110. package/dist/types/data-structures/tree/tree.d.ts +1 -0
  111. package/dist/types/data-structures/{hash.js → tree/tree.js} +1 -1
  112. package/dist/types/data-structures/tree/tree.js.map +1 -0
  113. package/dist/types/data-structures/trie/index.d.ts +1 -0
  114. package/dist/types/data-structures/trie/index.js +18 -0
  115. package/dist/types/data-structures/trie/index.js.map +1 -0
  116. package/dist/types/data-structures/trie/trie.d.ts +1 -0
  117. package/dist/types/data-structures/trie/trie.js +3 -0
  118. package/dist/types/data-structures/trie/trie.js.map +1 -0
  119. package/dist/types/helpers.d.ts +2 -0
  120. package/dist/utils/utils.d.ts +1 -0
  121. package/dist/utils/utils.js +8 -1
  122. package/dist/utils/utils.js.map +1 -1
  123. package/lib/data-structures/binary-tree/avl-tree.d.ts +42 -34
  124. package/lib/data-structures/binary-tree/avl-tree.js +42 -34
  125. package/lib/data-structures/binary-tree/binary-indexed-tree.d.ts +141 -43
  126. package/lib/data-structures/binary-tree/binary-indexed-tree.js +230 -42
  127. package/lib/data-structures/binary-tree/binary-tree.d.ts +265 -168
  128. package/lib/data-structures/binary-tree/binary-tree.js +257 -170
  129. package/lib/data-structures/binary-tree/bst.d.ts +104 -59
  130. package/lib/data-structures/binary-tree/bst.js +105 -60
  131. package/lib/data-structures/binary-tree/tree-multiset.d.ts +47 -39
  132. package/lib/data-structures/binary-tree/tree-multiset.js +47 -39
  133. package/{dist/types/data-structures → lib/types/data-structures/binary-tree}/avl-tree.d.ts +1 -1
  134. package/lib/types/data-structures/binary-tree/avl-tree.js +1 -0
  135. package/lib/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
  136. package/lib/types/data-structures/binary-tree/binary-indexed-tree.js +1 -0
  137. package/lib/types/data-structures/{binary-tree.d.ts → binary-tree/binary-tree.d.ts} +1 -5
  138. package/lib/types/data-structures/{bst.d.ts → binary-tree/bst.d.ts} +1 -1
  139. package/lib/types/data-structures/binary-tree/index.d.ts +6 -0
  140. package/lib/types/data-structures/binary-tree/index.js +6 -0
  141. package/lib/types/data-structures/{rb-tree.d.ts → binary-tree/rb-tree.d.ts} +1 -1
  142. package/lib/types/data-structures/binary-tree/segment-tree.js +1 -0
  143. package/lib/types/data-structures/{tree-multiset.d.ts → binary-tree/tree-multiset.d.ts} +1 -1
  144. package/lib/types/data-structures/binary-tree/tree-multiset.js +1 -0
  145. package/lib/types/data-structures/graph/abstract-graph.js +1 -0
  146. package/lib/types/data-structures/graph/index.d.ts +3 -0
  147. package/lib/types/data-structures/graph/index.js +3 -0
  148. package/lib/types/data-structures/graph/map-graph.js +1 -0
  149. package/lib/types/data-structures/graph/undirected-graph.d.ts +1 -0
  150. package/lib/types/data-structures/graph/undirected-graph.js +1 -0
  151. package/lib/types/data-structures/hash/coordinate-map.d.ts +1 -0
  152. package/lib/types/data-structures/hash/coordinate-map.js +1 -0
  153. package/lib/types/data-structures/hash/coordinate-set.d.ts +1 -0
  154. package/lib/types/data-structures/hash/coordinate-set.js +1 -0
  155. package/lib/types/data-structures/hash/hash-map.d.ts +1 -0
  156. package/lib/types/data-structures/hash/hash-map.js +1 -0
  157. package/lib/types/data-structures/hash/hash-table.d.ts +1 -0
  158. package/lib/types/data-structures/hash/hash-table.js +1 -0
  159. package/lib/types/data-structures/hash/index.js +1 -0
  160. package/lib/types/data-structures/hash/tree-map.d.ts +1 -0
  161. package/lib/types/data-structures/hash/tree-map.js +1 -0
  162. package/lib/types/data-structures/hash/tree-set.d.ts +1 -0
  163. package/lib/types/data-structures/hash/tree-set.js +1 -0
  164. package/lib/types/data-structures/heap/heap.d.ts +1 -0
  165. package/lib/types/data-structures/heap/heap.js +1 -0
  166. package/lib/types/data-structures/heap/index.d.ts +1 -0
  167. package/lib/types/data-structures/heap/index.js +1 -0
  168. package/lib/types/data-structures/heap/max-heap.d.ts +1 -0
  169. package/lib/types/data-structures/heap/max-heap.js +1 -0
  170. package/lib/types/data-structures/heap/min-heap.d.ts +1 -0
  171. package/lib/types/data-structures/heap/min-heap.js +1 -0
  172. package/lib/types/data-structures/index.d.ts +8 -13
  173. package/lib/types/data-structures/index.js +8 -11
  174. package/lib/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
  175. package/lib/types/data-structures/linked-list/doubly-linked-list.js +1 -0
  176. package/lib/types/data-structures/linked-list/index.d.ts +2 -0
  177. package/lib/types/data-structures/linked-list/index.js +2 -0
  178. package/lib/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
  179. package/lib/types/data-structures/linked-list/singly-linked-list.js +1 -0
  180. package/lib/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  181. package/lib/types/data-structures/linked-list/skip-linked-list.js +1 -0
  182. package/lib/types/data-structures/matrix/index.d.ts +1 -0
  183. package/lib/types/data-structures/matrix/index.js +1 -0
  184. package/lib/types/data-structures/matrix/matrix.d.ts +1 -0
  185. package/lib/types/data-structures/matrix/matrix.js +1 -0
  186. package/lib/types/data-structures/matrix/matrix2d.d.ts +1 -0
  187. package/lib/types/data-structures/matrix/matrix2d.js +1 -0
  188. package/lib/types/data-structures/matrix/navigator.js +1 -0
  189. package/lib/types/data-structures/matrix/vector2d.d.ts +1 -0
  190. package/lib/types/data-structures/matrix/vector2d.js +1 -0
  191. package/lib/types/data-structures/priority-queue/index.d.ts +3 -0
  192. package/lib/types/data-structures/priority-queue/index.js +3 -0
  193. package/lib/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  194. package/lib/types/data-structures/priority-queue/max-priority-queue.js +1 -0
  195. package/lib/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  196. package/lib/types/data-structures/priority-queue/min-priority-queue.js +1 -0
  197. package/lib/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  198. package/lib/types/data-structures/priority-queue/priority-queue.js +1 -0
  199. package/lib/types/data-structures/queue/deque.d.ts +1 -0
  200. package/lib/types/data-structures/queue/deque.js +1 -0
  201. package/lib/types/data-structures/queue/index.d.ts +2 -0
  202. package/lib/types/data-structures/queue/index.js +2 -0
  203. package/lib/types/data-structures/queue/queue.d.ts +1 -0
  204. package/lib/types/data-structures/queue/queue.js +1 -0
  205. package/lib/types/data-structures/stack/index.d.ts +1 -0
  206. package/lib/types/data-structures/stack/index.js +1 -0
  207. package/lib/types/data-structures/stack/stack.d.ts +1 -0
  208. package/lib/types/data-structures/stack/stack.js +1 -0
  209. package/lib/types/data-structures/tree/index.d.ts +1 -0
  210. package/lib/types/data-structures/tree/index.js +1 -0
  211. package/lib/types/data-structures/tree/tree.d.ts +1 -0
  212. package/lib/types/data-structures/tree/tree.js +1 -0
  213. package/lib/types/data-structures/trie/index.d.ts +1 -0
  214. package/lib/types/data-structures/trie/index.js +1 -0
  215. package/lib/types/data-structures/trie/trie.d.ts +1 -0
  216. package/lib/types/data-structures/trie/trie.js +1 -0
  217. package/lib/types/helpers.d.ts +2 -0
  218. package/lib/utils/utils.d.ts +1 -0
  219. package/lib/utils/utils.js +6 -0
  220. package/package.json +6 -6
  221. package/src/data-structures/binary-tree/avl-tree.ts +42 -34
  222. package/src/data-structures/binary-tree/binary-indexed-tree.ts +264 -42
  223. package/src/data-structures/binary-tree/binary-tree.ts +267 -172
  224. package/src/data-structures/binary-tree/bst.ts +111 -60
  225. package/src/data-structures/binary-tree/tree-multiset.ts +47 -39
  226. package/src/types/data-structures/{avl-tree.ts → binary-tree/avl-tree.ts} +1 -1
  227. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  228. package/src/types/data-structures/{binary-tree.ts → binary-tree/binary-tree.ts} +1 -13
  229. package/src/types/data-structures/{bst.ts → binary-tree/bst.ts} +1 -1
  230. package/src/types/data-structures/binary-tree/index.ts +6 -0
  231. package/src/types/data-structures/{rb-tree.ts → binary-tree/rb-tree.ts} +2 -2
  232. package/src/types/data-structures/{tree-multiset.ts → binary-tree/tree-multiset.ts} +1 -1
  233. package/src/types/data-structures/graph/index.ts +3 -0
  234. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  235. package/src/types/data-structures/hash/coordinate-map.ts +1 -0
  236. package/src/types/data-structures/hash/coordinate-set.ts +1 -0
  237. package/src/types/data-structures/hash/hash-map.ts +1 -0
  238. package/src/types/data-structures/hash/hash-table.ts +1 -0
  239. package/src/types/data-structures/hash/tree-map.ts +1 -0
  240. package/src/types/data-structures/hash/tree-set.ts +1 -0
  241. package/src/types/data-structures/heap/heap.ts +1 -0
  242. package/src/types/data-structures/heap/index.ts +1 -0
  243. package/src/types/data-structures/heap/max-heap.ts +1 -0
  244. package/src/types/data-structures/heap/min-heap.ts +1 -0
  245. package/src/types/data-structures/index.ts +8 -14
  246. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
  247. package/src/types/data-structures/linked-list/index.ts +2 -0
  248. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
  249. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  250. package/src/types/data-structures/matrix/index.ts +1 -0
  251. package/src/types/data-structures/matrix/matrix.ts +1 -0
  252. package/src/types/data-structures/matrix/matrix2d.ts +1 -0
  253. package/src/types/data-structures/matrix/vector2d.ts +1 -0
  254. package/src/types/data-structures/priority-queue/index.ts +3 -0
  255. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  256. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  257. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  258. package/src/types/data-structures/queue/deque.ts +1 -0
  259. package/src/types/data-structures/queue/index.ts +2 -0
  260. package/src/types/data-structures/queue/queue.ts +1 -0
  261. package/src/types/data-structures/stack/index.ts +1 -0
  262. package/src/types/data-structures/stack/stack.ts +1 -0
  263. package/src/types/data-structures/tree/index.ts +1 -0
  264. package/src/types/data-structures/tree/tree.ts +1 -0
  265. package/src/types/data-structures/trie/index.ts +1 -0
  266. package/src/types/data-structures/trie/trie.ts +1 -0
  267. package/src/types/helpers.ts +4 -1
  268. package/src/utils/utils.ts +7 -0
  269. package/test/config.js +4 -0
  270. package/test/types/index.js +29 -0
  271. package/test/types/utils/big-o.js +2 -0
  272. package/test/types/utils/index.js +29 -0
  273. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +284 -0
  274. package/test/utils/big-o.js +212 -0
  275. package/test/utils/index.js +30 -0
  276. package/test/utils/number.js +14 -0
  277. package/umd/bundle.min.js +1 -1
  278. package/umd/bundle.min.js.map +1 -1
  279. package/dist/types/data-structures/abstract-graph.js.map +0 -1
  280. package/dist/types/data-structures/avl-tree.js.map +0 -1
  281. package/dist/types/data-structures/binary-tree.js.map +0 -1
  282. package/dist/types/data-structures/bst.js.map +0 -1
  283. package/dist/types/data-structures/directed-graph.js.map +0 -1
  284. package/dist/types/data-structures/doubly-linked-list.js.map +0 -1
  285. package/dist/types/data-structures/hash.js.map +0 -1
  286. package/dist/types/data-structures/heap.js.map +0 -1
  287. package/dist/types/data-structures/map-graph.js.map +0 -1
  288. package/dist/types/data-structures/navigator.js.map +0 -1
  289. package/dist/types/data-structures/rb-tree.js.map +0 -1
  290. package/dist/types/data-structures/segment-tree.js.map +0 -1
  291. package/dist/types/data-structures/singly-linked-list.js.map +0 -1
  292. package/dist/types/data-structures/tree-multiset.js.map +0 -1
  293. /package/dist/types/data-structures/{avl-tree.js → binary-tree/avl-tree.js} +0 -0
  294. /package/dist/types/data-structures/{doubly-linked-list.d.ts → binary-tree/binary-indexed-tree.d.ts} +0 -0
  295. /package/dist/types/data-structures/{binary-tree.js → binary-tree/binary-tree.js} +0 -0
  296. /package/dist/types/data-structures/{bst.js → binary-tree/bst.js} +0 -0
  297. /package/dist/types/data-structures/{rb-tree.js → binary-tree/rb-tree.js} +0 -0
  298. /package/dist/types/data-structures/{segment-tree.d.ts → binary-tree/segment-tree.d.ts} +0 -0
  299. /package/dist/types/data-structures/{segment-tree.js → binary-tree/segment-tree.js} +0 -0
  300. /package/dist/types/data-structures/{tree-multiset.js → binary-tree/tree-multiset.js} +0 -0
  301. /package/dist/types/data-structures/{abstract-graph.d.ts → graph/abstract-graph.d.ts} +0 -0
  302. /package/dist/types/data-structures/{abstract-graph.js → graph/abstract-graph.js} +0 -0
  303. /package/dist/types/data-structures/{directed-graph.d.ts → graph/directed-graph.d.ts} +0 -0
  304. /package/dist/types/data-structures/{directed-graph.js → graph/directed-graph.js} +0 -0
  305. /package/dist/types/data-structures/{map-graph.d.ts → graph/map-graph.d.ts} +0 -0
  306. /package/dist/types/data-structures/{map-graph.js → graph/map-graph.js} +0 -0
  307. /package/dist/types/data-structures/{heap.d.ts → graph/undirected-graph.d.ts} +0 -0
  308. /package/dist/types/data-structures/{singly-linked-list.d.ts → hash/coordinate-map.d.ts} +0 -0
  309. /package/{lib/types/data-structures/abstract-graph.js → dist/types/data-structures/hash/coordinate-set.d.ts} +0 -0
  310. /package/{lib/types/data-structures/avl-tree.js → dist/types/data-structures/hash/hash-map.d.ts} +0 -0
  311. /package/{lib/types/data-structures/doubly-linked-list.d.ts → dist/types/data-structures/hash/hash-table.d.ts} +0 -0
  312. /package/dist/types/data-structures/{hash.d.ts → hash/index.d.ts} +0 -0
  313. /package/{lib/types/data-structures/doubly-linked-list.js → dist/types/data-structures/hash/tree-map.d.ts} +0 -0
  314. /package/{lib/types/data-structures/hash.js → dist/types/data-structures/hash/tree-set.d.ts} +0 -0
  315. /package/{lib/types/data-structures → dist/types/data-structures/heap}/heap.d.ts +0 -0
  316. /package/dist/types/data-structures/{heap.js → heap/heap.js} +0 -0
  317. /package/{lib/types/data-structures/heap.js → dist/types/data-structures/heap/max-heap.d.ts} +0 -0
  318. /package/{lib/types/data-structures/map-graph.js → dist/types/data-structures/heap/min-heap.d.ts} +0 -0
  319. /package/{lib/types/data-structures/navigator.js → dist/types/data-structures/linked-list/doubly-linked-list.d.ts} +0 -0
  320. /package/dist/types/data-structures/{doubly-linked-list.js → linked-list/doubly-linked-list.js} +0 -0
  321. /package/{lib/types/data-structures → dist/types/data-structures/linked-list}/singly-linked-list.d.ts +0 -0
  322. /package/dist/types/data-structures/{singly-linked-list.js → linked-list/singly-linked-list.js} +0 -0
  323. /package/{lib/types/data-structures/segment-tree.js → dist/types/data-structures/linked-list/skip-linked-list.d.ts} +0 -0
  324. /package/{lib/types/data-structures/singly-linked-list.js → dist/types/data-structures/matrix/matrix.d.ts} +0 -0
  325. /package/{lib/types/data-structures/tree-multiset.js → dist/types/data-structures/matrix/matrix2d.d.ts} +0 -0
  326. /package/dist/types/data-structures/{navigator.d.ts → matrix/navigator.d.ts} +0 -0
  327. /package/dist/types/data-structures/{navigator.js → matrix/navigator.js} +0 -0
  328. /package/{src/types/data-structures/doubly-linked-list.ts → dist/types/data-structures/matrix/vector2d.d.ts} +0 -0
  329. /package/{src/types/data-structures/heap.ts → dist/types/data-structures/priority-queue/max-priority-queue.d.ts} +0 -0
  330. /package/{src/types/data-structures/singly-linked-list.ts → dist/types/data-structures/priority-queue/min-priority-queue.d.ts} +0 -0
  331. /package/lib/types/data-structures/{binary-tree.js → binary-tree/binary-tree.js} +0 -0
  332. /package/lib/types/data-structures/{bst.js → binary-tree/bst.js} +0 -0
  333. /package/lib/types/data-structures/{rb-tree.js → binary-tree/rb-tree.js} +0 -0
  334. /package/lib/types/data-structures/{segment-tree.d.ts → binary-tree/segment-tree.d.ts} +0 -0
  335. /package/lib/types/data-structures/{abstract-graph.d.ts → graph/abstract-graph.d.ts} +0 -0
  336. /package/lib/types/data-structures/{directed-graph.d.ts → graph/directed-graph.d.ts} +0 -0
  337. /package/lib/types/data-structures/{directed-graph.js → graph/directed-graph.js} +0 -0
  338. /package/lib/types/data-structures/{map-graph.d.ts → graph/map-graph.d.ts} +0 -0
  339. /package/lib/types/data-structures/{hash.d.ts → hash/index.d.ts} +0 -0
  340. /package/lib/types/data-structures/{navigator.d.ts → matrix/navigator.d.ts} +0 -0
  341. /package/src/types/data-structures/{segment-tree.ts → binary-tree/segment-tree.ts} +0 -0
  342. /package/src/types/data-structures/{abstract-graph.ts → graph/abstract-graph.ts} +0 -0
  343. /package/src/types/data-structures/{directed-graph.ts → graph/directed-graph.ts} +0 -0
  344. /package/src/types/data-structures/{map-graph.ts → graph/map-graph.ts} +0 -0
  345. /package/src/types/data-structures/{hash.ts → hash/index.ts} +0 -0
  346. /package/src/types/data-structures/{navigator.ts → matrix/navigator.ts} +0 -0
@@ -46,11 +46,11 @@ export class TreeMultiset extends AVLTree {
46
46
  return new TreeMultisetNode(key, val, count);
47
47
  }
48
48
  /**
49
- * The function swaps the location of two nodes in a tree data structure.
50
- * @param {N} srcNode - The source node that we want to _swap with the destination node.
51
- * @param {N} destNode - The `destNode` parameter represents the destination node where the values from `srcNode` will
52
- * be swapped with.
53
- * @returns the `destNode` after swapping its values with the `srcNode`.
49
+ * The function swaps the values of two nodes in a binary tree.
50
+ * @param {N} srcNode - The source node that needs to be swapped with the destination node.
51
+ * @param {N} destNode - The `destNode` parameter represents the destination node where the values
52
+ * from `srcNode` will be swapped into.
53
+ * @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
54
54
  */
55
55
  _swap(srcNode, destNode) {
56
56
  const { key, val, count, height } = destNode;
@@ -69,14 +69,17 @@ export class TreeMultiset extends AVLTree {
69
69
  return destNode;
70
70
  }
71
71
  /**
72
- * The `add` function adds a new node to a binary search tree, maintaining the tree's properties and balancing if
73
- * necessary.
74
- * @param {BinaryTreeNodeKey | N} keyOrNode - The `keyOrNode` parameter can be either a `BinaryTreeNodeKey` or a `N` (which
75
- * represents a `BinaryTreeNode`).
76
- * @param [val] - The `val` parameter represents the value to be added to the binary tree node.
77
- * @param {number} [count] - The `count` parameter is an optional parameter that specifies the number of times the
78
- * value should be added to the binary tree. If the `count` parameter is not provided, it defaults to 1.
79
- * @returns The method `add` returns either the inserted node (`N`), `null`, or `undefined`.
72
+ * The `add` function adds a new node to a binary search tree, updating the count if the key already
73
+ * exists, and balancing the tree if necessary.
74
+ * @param {BinaryTreeNodeKey | N | null} keyOrNode - The `keyOrNode` parameter can be either a
75
+ * `BinaryTreeNodeKey` (which represents the key of the node to be added), a `N` (which represents a
76
+ * node to be added), or `null` (which represents a null node).
77
+ * @param [val] - The `val` parameter represents the value associated with the key that is being
78
+ * added to the binary tree.
79
+ * @param [count=1] - The `count` parameter represents the number of occurrences of the key/value
80
+ * pair that will be added to the binary tree. It has a default value of 1, which means that if no
81
+ * count is specified, the default count will be 1.
82
+ * @returns The function `add` returns a value of type `N | null | undefined`.
80
83
  */
81
84
  add(keyOrNode, val, count = 1) {
82
85
  let inserted = undefined, newNode;
@@ -155,13 +158,12 @@ export class TreeMultiset extends AVLTree {
155
158
  return inserted;
156
159
  }
157
160
  /**
158
- * The function adds a new node to a binary tree if there is an available slot on the left or right side of the parent
159
- * node.
160
- * @param {N | null} newNode - The `newNode` parameter represents the node that needs to be added to the tree. It can
161
- * be either a node object (`N`) or `null`.
162
- * @param {N} parent - The `parent` parameter represents the parent node to which the new node will be added as a
163
- * child.
164
- * @returns The method returns either the `parent.left`, `parent.right`, or `undefined`.
161
+ * The function adds a new node to a binary tree if there is an available slot in the parent node.
162
+ * @param {N | null} newNode - The `newNode` parameter represents the node that needs to be added to
163
+ * the tree. It can be either a node object (`N`) or `null`.
164
+ * @param {N} parent - The `parent` parameter represents the parent node to which the new node will
165
+ * be added as a child.
166
+ * @returns The method `_addTo` returns either the `parent.left`, `parent.right`, or `undefined`.
165
167
  */
166
168
  _addTo(newNode, parent) {
167
169
  if (parent) {
@@ -190,13 +192,13 @@ export class TreeMultiset extends AVLTree {
190
192
  }
191
193
  }
192
194
  /**
193
- * The `addMany` function takes an array of node IDs or nodes and adds them to the tree multiset, returning an array of
194
- * the inserted nodes.
195
- * @param {(BinaryTreeNodeKey | null)[] | (N | null)[]} keysOrNodes - An array of BinaryTreeNodeKey or BinaryTreeNode
196
- * objects, or null values.
197
- * @param {N['val'][]} [data] - The `data` parameter is an optional array of values (`N['val'][]`) that corresponds to
198
- * the nodes being added. It is used when adding nodes using the `keyOrNode` and `data` arguments in the `this.add()`
199
- * method. If provided, the `data` array should
195
+ * The `addMany` function adds multiple keys or nodes to a TreeMultiset and returns an array of the
196
+ * inserted nodes.
197
+ * @param {(BinaryTreeNodeKey | null)[] | (N | null)[]} keysOrNodes - An array of keys or nodes to be
198
+ * added to the multiset. Each element can be either a BinaryTreeNodeKey or a TreeMultisetNode.
199
+ * @param {N['val'][]} [data] - The `data` parameter is an optional array of values that correspond
200
+ * to the keys or nodes being added to the multiset. It is used to associate additional data with
201
+ * each key or node.
200
202
  * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
201
203
  */
202
204
  addMany(keysOrNodes, data) {
@@ -216,9 +218,12 @@ export class TreeMultiset extends AVLTree {
216
218
  return inserted;
217
219
  }
218
220
  /**
219
- * The `perfectlyBalance` function takes a binary tree, performs a depth-first search to sort the nodes, and then
220
- * constructs a balanced binary search tree using either a recursive or iterative approach.
221
- * @returns The function `perfectlyBalance()` returns a boolean value.
221
+ * The `perfectlyBalance` function in TypeScript takes a sorted array of nodes and builds a balanced
222
+ * binary search tree using either a recursive or iterative approach.
223
+ * @param iterationType - The `iterationType` parameter is an optional parameter that specifies the
224
+ * type of iteration to use when building a balanced binary search tree. It can have two possible
225
+ * values:
226
+ * @returns a boolean value.
222
227
  */
223
228
  perfectlyBalance(iterationType = this.iterationType) {
224
229
  const sorted = this.dfs(node => node, 'in'), n = sorted.length;
@@ -257,13 +262,16 @@ export class TreeMultiset extends AVLTree {
257
262
  }
258
263
  }
259
264
  /**
260
- * The `delete` function removes a node from a binary search tree and returns the deleted node along with the parent
261
- * node that needs to be balanced.
262
- * @param {N | BinaryTreeNodeKey | null} nodeOrKey - The `nodeOrKey` parameter can be one of the following:
263
- * @param {boolean} [ignoreCount] - The `ignoreCount` parameter is an optional boolean parameter that determines
264
- * whether to ignore the count of the node being removed. If `ignoreCount` is set to `true`, the count of the node will
265
- * not be taken into account when removing it. If `ignoreCount` is set to `false
266
- * @returns The function `delete` returns an array of `BinaryTreeDeletedResult<N>` objects.
265
+ * The `delete` function in a binary search tree deletes a node from the tree and returns the deleted
266
+ * node along with the parent node that needs to be balanced.
267
+ * @param {N | BinaryTreeNodeKey} nodeOrKey - The `nodeOrKey` parameter can be either a node object
268
+ * (`N`) or a key value (`BinaryTreeNodeKey`). It represents the node or key that needs to be deleted
269
+ * from the binary tree.
270
+ * @param [ignoreCount=false] - A boolean flag indicating whether to ignore the count of the node
271
+ * being deleted. If set to true, the count of the node will not be considered and the node will be
272
+ * deleted regardless of its count. If set to false (default), the count of the node will be
273
+ * decremented by 1 and
274
+ * @returns The method `delete` returns an array of `BinaryTreeDeletedResult<N>` objects.
267
275
  */
268
276
  delete(nodeOrKey, ignoreCount = false) {
269
277
  const bstDeletedResult = [];
@@ -322,14 +330,14 @@ export class TreeMultiset extends AVLTree {
322
330
  return bstDeletedResult;
323
331
  }
324
332
  /**
325
- * The clear() function clears the data and sets the count to 0.
333
+ * The clear() function clears the contents of a data structure and sets the count to zero.
326
334
  */
327
335
  clear() {
328
336
  super.clear();
329
337
  this._setCount(0);
330
338
  }
331
339
  /**
332
- * The function "_setCount" is used to set the value of the "_count" property.
340
+ * The function sets the value of the "_count" property.
333
341
  * @param {number} v - number
334
342
  */
335
343
  _setCount(v) {
@@ -1,4 +1,4 @@
1
- import { AVLTreeNode } from '../../data-structures';
1
+ import { AVLTreeNode } from '../../../data-structures';
2
2
  import { BSTOptions } from './bst';
3
3
  export type AVLTreeNodeNested<T> = AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
4
  export type AVLTreeOptions = BSTOptions & {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { BinaryTreeNode } from '../../data-structures/binary-tree';
1
+ import { BinaryTreeNode } from '../../../data-structures';
2
2
  /**
3
3
  * Enum representing different loop types.
4
4
  *
@@ -18,17 +18,13 @@ export declare enum FamilyPosition {
18
18
  ISOLATED = "ISOLATED",
19
19
  MAL_NODE = "MAL_NODE"
20
20
  }
21
- export type BinaryTreeNodePropertyName = 'key' | 'val';
22
- export type NodeOrPropertyName = 'node' | BinaryTreeNodePropertyName;
23
21
  export type BinaryTreeNodeKey = number;
24
22
  export type BFSCallback<N> = (node: N, level?: number) => any;
25
23
  export type BFSCallbackReturn<N> = ReturnType<BFSCallback<N>>;
26
- export type BinaryTreeNodeProperty<N extends BinaryTreeNode<N['val'], N>> = N['val'] | N | number | BinaryTreeNodeKey;
27
24
  export type BinaryTreeDeletedResult<N> = {
28
25
  deleted: N | null | undefined;
29
26
  needBalanced: N | null;
30
27
  };
31
- export type BinaryTreeNodeProperties<N extends BinaryTreeNode<N['val'], N>> = BinaryTreeNodeProperty<N>[];
32
28
  export type BinaryTreeNodeNested<T> = BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
33
29
  export type BinaryTreeOptions = {
34
30
  iterationType?: IterationType;
@@ -1,4 +1,4 @@
1
- import { BSTNode } from '../../data-structures/binary-tree';
1
+ import { BSTNode } from '../../../data-structures';
2
2
  import type { BinaryTreeNodeKey, BinaryTreeOptions } from './binary-tree';
3
3
  export type BSTComparator = (a: BinaryTreeNodeKey, b: BinaryTreeNodeKey) => number;
4
4
  export type BSTNodeNested<T> = BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
@@ -0,0 +1,6 @@
1
+ export * from './binary-tree';
2
+ export * from './bst';
3
+ export * from './avl-tree';
4
+ export * from './segment-tree';
5
+ export * from './tree-multiset';
6
+ export * from './rb-tree';
@@ -0,0 +1,6 @@
1
+ export * from './binary-tree';
2
+ export * from './bst';
3
+ export * from './avl-tree';
4
+ export * from './segment-tree';
5
+ export * from './tree-multiset';
6
+ export * from './rb-tree';
@@ -1,5 +1,5 @@
1
1
  import { BinaryTreeOptions } from './binary-tree';
2
- import { RBTreeNode } from '../../data-structures/binary-tree';
2
+ import { RBTreeNode } from '../../../data-structures';
3
3
  export declare enum RBColor {
4
4
  RED = "RED",
5
5
  BLACK = "BLACK"
@@ -1,4 +1,4 @@
1
- import { TreeMultisetNode } from '../../data-structures/binary-tree';
1
+ import { TreeMultisetNode } from '../../../data-structures';
2
2
  import { AVLTreeOptions } from './avl-tree';
3
3
  export type TreeMultisetNodeNested<T> = TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
4
  export type TreeMultisetOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedNodeByKey'> & {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './abstract-graph';
2
+ export * from './map-graph';
3
+ export * from './directed-graph';
@@ -0,0 +1,3 @@
1
+ export * from './abstract-graph';
2
+ export * from './map-graph';
3
+ export * from './directed-graph';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './heap';
@@ -0,0 +1 @@
1
+ export * from './heap';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,16 +1,11 @@
1
1
  export * from './binary-tree';
2
- export * from './bst';
3
- export * from './avl-tree';
4
- export * from './segment-tree';
5
- export * from './tree-multiset';
6
- export * from './abstract-graph';
7
- export * from './map-graph';
8
- export * from './rb-tree';
9
- export * from './directed-graph';
2
+ export * from './graph';
3
+ export * from './linked-list';
10
4
  export * from './heap';
11
- export * from './singly-linked-list';
12
- export * from './doubly-linked-list';
13
- export * from './navigator';
5
+ export * from './matrix';
14
6
  export * from './hash';
15
- export type MapCallback<N> = (node: N) => any;
16
- export type MapCallbackReturn<N> = ReturnType<MapCallback<N>>;
7
+ export * from './priority-queue';
8
+ export * from './queue';
9
+ export * from './stack';
10
+ export * from './tree';
11
+ export * from './trie';
@@ -1,14 +1,11 @@
1
1
  export * from './binary-tree';
2
- export * from './bst';
3
- export * from './avl-tree';
4
- export * from './segment-tree';
5
- export * from './tree-multiset';
6
- export * from './abstract-graph';
7
- export * from './map-graph';
8
- export * from './rb-tree';
9
- export * from './directed-graph';
2
+ export * from './graph';
3
+ export * from './linked-list';
10
4
  export * from './heap';
11
- export * from './singly-linked-list';
12
- export * from './doubly-linked-list';
13
- export * from './navigator';
5
+ export * from './matrix';
14
6
  export * from './hash';
7
+ export * from './priority-queue';
8
+ export * from './queue';
9
+ export * from './stack';
10
+ export * from './tree';
11
+ export * from './trie';
@@ -0,0 +1,2 @@
1
+ export * from './singly-linked-list';
2
+ export * from './doubly-linked-list';
@@ -0,0 +1,2 @@
1
+ export * from './singly-linked-list';
2
+ export * from './doubly-linked-list';
@@ -0,0 +1 @@
1
+ export * from './navigator';
@@ -0,0 +1 @@
1
+ export * from './navigator';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './priority-queue';
2
+ export * from './min-priority-queue';
3
+ export * from './max-priority-queue';
@@ -0,0 +1,3 @@
1
+ export * from './priority-queue';
2
+ export * from './min-priority-queue';
3
+ export * from './max-priority-queue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './queue';
2
+ export * from './deque';
@@ -0,0 +1,2 @@
1
+ export * from './queue';
2
+ export * from './deque';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './stack';
@@ -0,0 +1 @@
1
+ export * from './stack';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './tree';
@@ -0,0 +1 @@
1
+ export * from './tree';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './trie';
@@ -0,0 +1 @@
1
+ export * from './trie';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,4 @@
1
1
  export type Comparator<T> = (a: T, b: T) => number;
2
2
  export type DFSOrderPattern = 'pre' | 'in' | 'post';
3
+ export type MapCallback<N> = (node: N) => any;
4
+ export type MapCallbackReturn<N> = ReturnType<MapCallback<N>>;
@@ -17,3 +17,4 @@ export declare const trampoline: (fn: TrlFn) => ((...args: [...Parameters<TrlFn>
17
17
  export declare const trampolineAsync: (fn: TrlAsyncFn) => ((...args: [...Parameters<TrlAsyncFn>]) => Promise<any>) & {
18
18
  cont: (...args: [...Parameters<TrlAsyncFn>]) => Thunk;
19
19
  };
20
+ export declare const getMSB: (value: number) => number;
@@ -55,3 +55,9 @@ export const trampolineAsync = (fn) => {
55
55
  return result;
56
56
  }), { cont });
57
57
  };
58
+ export const getMSB = (value) => {
59
+ if (value <= 0) {
60
+ return 0;
61
+ }
62
+ return 1 << (31 - Math.clz32(value));
63
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-structure-typed",
3
- "version": "1.37.3",
3
+ "version": "1.37.5",
4
4
  "description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -27,16 +27,16 @@
27
27
  "fix:src": "npm run lint:src && npm run format:src",
28
28
  "fix:test": "npm run lint:test && npm run format:test",
29
29
  "fix": "npm run fix:src && npm run fix:test",
30
- "update:individuals": "npm i avl-tree-typed binary-tree-typed bst-typed heap-typed --save-dev",
31
- "install:all-individuals": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multiset-typed trie-typed undirected-graph-typed queue-typed --save-dev",
30
+ "update:subs": "npm i avl-tree-typed binary-tree-typed bst-typed heap-typed --save-dev",
31
+ "install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multiset-typed trie-typed undirected-graph-typed queue-typed --save-dev",
32
32
  "test": "jest",
33
33
  "check:deps": "dependency-cruiser src",
34
34
  "changelog": "auto-changelog",
35
35
  "coverage:badge": "istanbul-badges-readme",
36
- "ci": "env && git fetch --tags && npm run lint && npm run build && npm run update:individuals && npm run test && npm run changelog",
37
- "publish:individuals": "sh scripts/publish_all_subs.sh",
36
+ "ci": "env && git fetch --tags && npm run lint && npm run build && npm run update:subs && npm run test && npm run changelog",
37
+ "publish:subs": "sh scripts/publish_all_subs.sh",
38
38
  "publish:docs": "sh scripts/publish_docs.sh",
39
- "publish:all": "npm run ci && npm publish && npm run publish:individuals && npm run publish:docs"
39
+ "publish:all": "npm run ci && npm publish && npm run publish:subs && npm run publish:docs"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",