min-heap-typed 1.38.0 → 1.38.2

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 (334) hide show
  1. package/dist/data-structures/binary-tree/avl-tree.d.ts +100 -0
  2. package/dist/data-structures/binary-tree/avl-tree.js +341 -0
  3. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +144 -0
  4. package/dist/data-structures/binary-tree/binary-indexed-tree.js +261 -0
  5. package/dist/data-structures/binary-tree/binary-tree.d.ts +409 -0
  6. package/dist/data-structures/binary-tree/binary-tree.js +1065 -0
  7. package/dist/data-structures/binary-tree/bst.d.ts +167 -0
  8. package/dist/data-structures/binary-tree/bst.js +512 -0
  9. package/dist/data-structures/binary-tree/index.d.ts +7 -0
  10. package/dist/data-structures/binary-tree/index.js +23 -0
  11. package/dist/data-structures/binary-tree/rb-tree.d.ts +13 -0
  12. package/dist/data-structures/binary-tree/rb-tree.js +27 -0
  13. package/dist/data-structures/binary-tree/segment-tree.d.ts +83 -0
  14. package/dist/data-structures/binary-tree/segment-tree.js +228 -0
  15. package/dist/data-structures/binary-tree/tree-multiset.d.ts +122 -0
  16. package/dist/data-structures/binary-tree/tree-multiset.js +351 -0
  17. package/dist/data-structures/graph/abstract-graph.d.ts +332 -0
  18. package/dist/data-structures/graph/abstract-graph.js +923 -0
  19. package/dist/data-structures/graph/directed-graph.d.ts +200 -0
  20. package/dist/data-structures/graph/directed-graph.js +422 -0
  21. package/dist/data-structures/graph/index.d.ts +4 -0
  22. package/dist/data-structures/graph/index.js +20 -0
  23. package/dist/data-structures/graph/map-graph.d.ts +79 -0
  24. package/dist/data-structures/graph/map-graph.js +111 -0
  25. package/dist/data-structures/graph/undirected-graph.d.ts +127 -0
  26. package/dist/data-structures/graph/undirected-graph.js +252 -0
  27. package/dist/data-structures/hash/coordinate-map.d.ts +45 -0
  28. package/dist/data-structures/hash/coordinate-map.js +65 -0
  29. package/dist/data-structures/hash/coordinate-set.d.ts +37 -0
  30. package/dist/data-structures/hash/coordinate-set.js +55 -0
  31. package/dist/data-structures/hash/hash-map.d.ts +56 -0
  32. package/dist/data-structures/hash/hash-map.js +171 -0
  33. package/dist/data-structures/hash/hash-table.d.ts +106 -0
  34. package/dist/data-structures/hash/hash-table.js +245 -0
  35. package/dist/data-structures/hash/index.d.ts +6 -0
  36. package/dist/data-structures/hash/index.js +22 -0
  37. package/dist/data-structures/hash/tree-map.d.ts +2 -0
  38. package/dist/data-structures/hash/tree-map.js +6 -0
  39. package/dist/data-structures/hash/tree-set.d.ts +2 -0
  40. package/dist/data-structures/hash/tree-set.js +6 -0
  41. package/dist/data-structures/heap/heap.d.ts +224 -0
  42. package/dist/data-structures/heap/heap.js +497 -0
  43. package/dist/data-structures/heap/index.d.ts +3 -0
  44. package/dist/data-structures/heap/index.js +19 -0
  45. package/dist/data-structures/heap/max-heap.d.ts +12 -0
  46. package/dist/data-structures/heap/max-heap.js +24 -0
  47. package/dist/data-structures/heap/min-heap.d.ts +12 -0
  48. package/dist/data-structures/heap/min-heap.js +24 -0
  49. package/dist/data-structures/index.d.ts +11 -0
  50. package/dist/data-structures/index.js +27 -0
  51. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +234 -0
  52. package/dist/data-structures/linked-list/doubly-linked-list.js +583 -0
  53. package/dist/data-structures/linked-list/index.d.ts +3 -0
  54. package/dist/data-structures/linked-list/index.js +19 -0
  55. package/dist/data-structures/linked-list/singly-linked-list.d.ts +157 -0
  56. package/dist/data-structures/linked-list/singly-linked-list.js +448 -0
  57. package/dist/data-structures/linked-list/skip-linked-list.d.ts +61 -0
  58. package/dist/data-structures/linked-list/skip-linked-list.js +142 -0
  59. package/dist/data-structures/matrix/index.d.ts +4 -0
  60. package/dist/data-structures/matrix/index.js +20 -0
  61. package/dist/data-structures/matrix/matrix.d.ts +21 -0
  62. package/dist/data-structures/matrix/matrix.js +28 -0
  63. package/dist/data-structures/matrix/matrix2d.d.ts +108 -0
  64. package/dist/data-structures/matrix/matrix2d.js +203 -0
  65. package/dist/data-structures/matrix/navigator.d.ts +52 -0
  66. package/dist/data-structures/matrix/navigator.js +106 -0
  67. package/dist/data-structures/matrix/vector2d.d.ts +201 -0
  68. package/dist/data-structures/matrix/vector2d.js +291 -0
  69. package/dist/data-structures/priority-queue/index.d.ts +3 -0
  70. package/dist/data-structures/priority-queue/index.js +19 -0
  71. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +12 -0
  72. package/dist/data-structures/priority-queue/max-priority-queue.js +24 -0
  73. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +12 -0
  74. package/dist/data-structures/priority-queue/min-priority-queue.js +24 -0
  75. package/dist/data-structures/priority-queue/priority-queue.d.ts +12 -0
  76. package/dist/data-structures/priority-queue/priority-queue.js +17 -0
  77. package/dist/data-structures/queue/deque.d.ts +165 -0
  78. package/dist/data-structures/queue/deque.js +276 -0
  79. package/dist/data-structures/queue/index.d.ts +2 -0
  80. package/dist/data-structures/queue/index.js +18 -0
  81. package/dist/data-structures/queue/queue.d.ts +107 -0
  82. package/dist/data-structures/queue/queue.js +170 -0
  83. package/dist/data-structures/stack/index.d.ts +1 -0
  84. package/dist/data-structures/stack/index.js +17 -0
  85. package/dist/data-structures/stack/stack.d.ts +63 -0
  86. package/dist/data-structures/stack/stack.js +91 -0
  87. package/dist/data-structures/tree/index.d.ts +1 -0
  88. package/dist/data-structures/tree/index.js +17 -0
  89. package/dist/data-structures/tree/tree.d.ts +14 -0
  90. package/dist/data-structures/tree/tree.js +58 -0
  91. package/dist/data-structures/trie/index.d.ts +1 -0
  92. package/dist/data-structures/trie/index.js +17 -0
  93. package/dist/data-structures/trie/trie.d.ts +84 -0
  94. package/dist/data-structures/trie/trie.js +268 -0
  95. package/dist/index.d.ts +3 -3
  96. package/dist/index.js +3 -3
  97. package/dist/interfaces/binary-tree.d.ts +7 -0
  98. package/dist/interfaces/binary-tree.js +2 -0
  99. package/dist/interfaces/doubly-linked-list.d.ts +1 -0
  100. package/dist/interfaces/doubly-linked-list.js +2 -0
  101. package/dist/interfaces/graph.d.ts +5 -0
  102. package/dist/interfaces/graph.js +2 -0
  103. package/dist/interfaces/heap.d.ts +1 -0
  104. package/dist/interfaces/heap.js +2 -0
  105. package/dist/interfaces/index.d.ts +8 -0
  106. package/dist/interfaces/index.js +24 -0
  107. package/dist/interfaces/navigator.d.ts +1 -0
  108. package/dist/interfaces/navigator.js +2 -0
  109. package/dist/interfaces/priority-queue.d.ts +1 -0
  110. package/dist/interfaces/priority-queue.js +2 -0
  111. package/dist/interfaces/segment-tree.d.ts +1 -0
  112. package/dist/interfaces/segment-tree.js +2 -0
  113. package/dist/interfaces/singly-linked-list.d.ts +1 -0
  114. package/dist/interfaces/singly-linked-list.js +2 -0
  115. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
  116. package/dist/types/data-structures/binary-tree/avl-tree.js +2 -0
  117. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
  118. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  119. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +31 -0
  120. package/dist/types/data-structures/binary-tree/binary-tree.js +24 -0
  121. package/dist/types/data-structures/binary-tree/bst.d.ts +7 -0
  122. package/dist/types/data-structures/binary-tree/bst.js +2 -0
  123. package/dist/types/data-structures/binary-tree/index.d.ts +6 -0
  124. package/dist/types/data-structures/binary-tree/index.js +22 -0
  125. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +8 -0
  126. package/dist/types/data-structures/binary-tree/rb-tree.js +8 -0
  127. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +1 -0
  128. package/dist/types/data-structures/binary-tree/segment-tree.js +2 -0
  129. package/dist/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
  130. package/dist/types/data-structures/binary-tree/tree-multiset.js +2 -0
  131. package/dist/types/data-structures/graph/abstract-graph.d.ts +10 -0
  132. package/dist/types/data-structures/graph/abstract-graph.js +2 -0
  133. package/dist/types/data-structures/graph/directed-graph.d.ts +6 -0
  134. package/dist/types/data-structures/graph/directed-graph.js +9 -0
  135. package/dist/types/data-structures/graph/index.d.ts +3 -0
  136. package/dist/types/data-structures/graph/index.js +19 -0
  137. package/dist/types/data-structures/graph/map-graph.d.ts +1 -0
  138. package/dist/types/data-structures/graph/map-graph.js +2 -0
  139. package/dist/types/data-structures/graph/undirected-graph.d.ts +1 -0
  140. package/dist/types/data-structures/graph/undirected-graph.js +2 -0
  141. package/dist/types/data-structures/hash/coordinate-map.d.ts +1 -0
  142. package/dist/types/data-structures/hash/coordinate-map.js +2 -0
  143. package/dist/types/data-structures/hash/coordinate-set.d.ts +1 -0
  144. package/dist/types/data-structures/hash/coordinate-set.js +2 -0
  145. package/dist/types/data-structures/hash/hash-map.d.ts +1 -0
  146. package/dist/types/data-structures/hash/hash-map.js +2 -0
  147. package/dist/types/data-structures/hash/hash-table.d.ts +1 -0
  148. package/dist/types/data-structures/hash/hash-table.js +2 -0
  149. package/dist/types/data-structures/hash/index.d.ts +1 -0
  150. package/dist/types/data-structures/hash/index.js +2 -0
  151. package/dist/types/data-structures/hash/tree-map.d.ts +1 -0
  152. package/dist/types/data-structures/hash/tree-map.js +2 -0
  153. package/dist/types/data-structures/hash/tree-set.d.ts +1 -0
  154. package/dist/types/data-structures/hash/tree-set.js +2 -0
  155. package/dist/types/data-structures/heap/heap.d.ts +1 -0
  156. package/dist/types/data-structures/heap/heap.js +2 -0
  157. package/dist/types/data-structures/heap/index.d.ts +1 -0
  158. package/dist/types/data-structures/heap/index.js +17 -0
  159. package/dist/types/data-structures/heap/max-heap.d.ts +1 -0
  160. package/dist/types/data-structures/heap/max-heap.js +2 -0
  161. package/dist/types/data-structures/heap/min-heap.d.ts +1 -0
  162. package/dist/types/data-structures/heap/min-heap.js +2 -0
  163. package/dist/types/data-structures/index.d.ts +11 -0
  164. package/dist/types/data-structures/index.js +27 -0
  165. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
  166. package/dist/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  167. package/dist/types/data-structures/linked-list/index.d.ts +2 -0
  168. package/dist/types/data-structures/linked-list/index.js +18 -0
  169. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
  170. package/dist/types/data-structures/linked-list/singly-linked-list.js +2 -0
  171. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
  172. package/dist/types/data-structures/linked-list/skip-linked-list.js +2 -0
  173. package/dist/types/data-structures/matrix/index.d.ts +1 -0
  174. package/dist/types/data-structures/matrix/index.js +17 -0
  175. package/dist/types/data-structures/matrix/matrix.d.ts +1 -0
  176. package/dist/types/data-structures/matrix/matrix.js +2 -0
  177. package/dist/types/data-structures/matrix/matrix2d.d.ts +1 -0
  178. package/dist/types/data-structures/matrix/matrix2d.js +2 -0
  179. package/dist/types/data-structures/matrix/navigator.d.ts +14 -0
  180. package/dist/types/data-structures/matrix/navigator.js +2 -0
  181. package/dist/types/data-structures/matrix/vector2d.d.ts +1 -0
  182. package/dist/types/data-structures/matrix/vector2d.js +2 -0
  183. package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
  184. package/dist/types/data-structures/priority-queue/index.js +19 -0
  185. package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
  186. package/dist/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  187. package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
  188. package/dist/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  189. package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  190. package/dist/types/data-structures/priority-queue/priority-queue.js +2 -0
  191. package/dist/types/data-structures/queue/deque.d.ts +1 -0
  192. package/dist/types/data-structures/queue/deque.js +2 -0
  193. package/dist/types/data-structures/queue/index.d.ts +2 -0
  194. package/dist/types/data-structures/queue/index.js +18 -0
  195. package/dist/types/data-structures/queue/queue.d.ts +1 -0
  196. package/dist/types/data-structures/queue/queue.js +2 -0
  197. package/dist/types/data-structures/stack/index.d.ts +1 -0
  198. package/dist/types/data-structures/stack/index.js +17 -0
  199. package/dist/types/data-structures/stack/stack.d.ts +1 -0
  200. package/dist/types/data-structures/stack/stack.js +2 -0
  201. package/dist/types/data-structures/tree/index.d.ts +1 -0
  202. package/dist/types/data-structures/tree/index.js +17 -0
  203. package/dist/types/data-structures/tree/tree.d.ts +1 -0
  204. package/dist/types/data-structures/tree/tree.js +2 -0
  205. package/dist/types/data-structures/trie/index.d.ts +1 -0
  206. package/dist/types/data-structures/trie/index.js +17 -0
  207. package/dist/types/data-structures/trie/trie.d.ts +1 -0
  208. package/dist/types/data-structures/trie/trie.js +2 -0
  209. package/dist/types/helpers.d.ts +9 -0
  210. package/dist/types/helpers.js +9 -0
  211. package/dist/types/index.d.ts +3 -0
  212. package/dist/types/index.js +19 -0
  213. package/dist/types/utils/index.d.ts +2 -0
  214. package/dist/types/utils/index.js +18 -0
  215. package/dist/types/utils/utils.d.ts +7 -0
  216. package/dist/types/utils/utils.js +2 -0
  217. package/dist/types/utils/validate-type.d.ts +19 -0
  218. package/dist/types/utils/validate-type.js +2 -0
  219. package/dist/utils/index.d.ts +1 -0
  220. package/dist/utils/index.js +17 -0
  221. package/dist/utils/utils.d.ts +20 -0
  222. package/dist/utils/utils.js +73 -0
  223. package/package.json +1 -4
  224. package/src/data-structures/binary-tree/avl-tree.ts +342 -0
  225. package/src/data-structures/binary-tree/binary-indexed-tree.ts +298 -0
  226. package/src/data-structures/binary-tree/binary-tree.ts +1141 -0
  227. package/src/data-structures/binary-tree/bst.ts +529 -0
  228. package/src/data-structures/binary-tree/index.ts +7 -0
  229. package/src/data-structures/binary-tree/rb-tree.ts +366 -0
  230. package/src/data-structures/binary-tree/segment-tree.ts +257 -0
  231. package/src/data-structures/binary-tree/tree-multiset.ts +374 -0
  232. package/src/data-structures/graph/abstract-graph.ts +1043 -0
  233. package/src/data-structures/graph/directed-graph.ts +469 -0
  234. package/src/data-structures/graph/index.ts +4 -0
  235. package/src/data-structures/graph/map-graph.ts +134 -0
  236. package/src/data-structures/graph/undirected-graph.ts +273 -0
  237. package/src/data-structures/hash/coordinate-map.ts +67 -0
  238. package/src/data-structures/hash/coordinate-set.ts +56 -0
  239. package/src/data-structures/hash/hash-map.ts +209 -0
  240. package/src/data-structures/hash/hash-table.ts +280 -0
  241. package/src/data-structures/hash/index.ts +6 -0
  242. package/src/data-structures/hash/tree-map.ts +2 -0
  243. package/src/data-structures/hash/tree-set.ts +2 -0
  244. package/src/data-structures/heap/heap.ts +561 -0
  245. package/src/data-structures/heap/index.ts +3 -0
  246. package/src/data-structures/heap/max-heap.ts +24 -0
  247. package/src/data-structures/heap/min-heap.ts +24 -0
  248. package/src/data-structures/index.ts +11 -0
  249. package/src/data-structures/linked-list/doubly-linked-list.ts +636 -0
  250. package/src/data-structures/linked-list/index.ts +3 -0
  251. package/src/data-structures/linked-list/singly-linked-list.ts +501 -0
  252. package/src/data-structures/linked-list/skip-linked-list.ts +173 -0
  253. package/src/data-structures/matrix/index.ts +4 -0
  254. package/src/data-structures/matrix/matrix.ts +27 -0
  255. package/src/data-structures/matrix/matrix2d.ts +213 -0
  256. package/src/data-structures/matrix/navigator.ts +121 -0
  257. package/src/data-structures/matrix/vector2d.ts +317 -0
  258. package/src/data-structures/priority-queue/index.ts +3 -0
  259. package/src/data-structures/priority-queue/max-priority-queue.ts +23 -0
  260. package/src/data-structures/priority-queue/min-priority-queue.ts +23 -0
  261. package/src/data-structures/priority-queue/priority-queue.ts +16 -0
  262. package/src/data-structures/queue/deque.ts +298 -0
  263. package/src/data-structures/queue/index.ts +2 -0
  264. package/src/data-structures/queue/queue.ts +191 -0
  265. package/src/data-structures/stack/index.ts +1 -0
  266. package/src/data-structures/stack/stack.ts +98 -0
  267. package/src/data-structures/tree/index.ts +1 -0
  268. package/src/data-structures/tree/tree.ts +67 -0
  269. package/src/data-structures/trie/index.ts +1 -0
  270. package/src/data-structures/trie/trie.ts +286 -0
  271. package/src/index.ts +3 -3
  272. package/src/interfaces/binary-tree.ts +10 -0
  273. package/src/interfaces/doubly-linked-list.ts +1 -0
  274. package/src/interfaces/graph.ts +7 -0
  275. package/src/interfaces/heap.ts +1 -0
  276. package/src/interfaces/index.ts +8 -0
  277. package/src/interfaces/navigator.ts +1 -0
  278. package/src/interfaces/priority-queue.ts +1 -0
  279. package/src/interfaces/segment-tree.ts +1 -0
  280. package/src/interfaces/singly-linked-list.ts +1 -0
  281. package/src/types/data-structures/binary-tree/avl-tree.ts +5 -0
  282. package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
  283. package/src/types/data-structures/binary-tree/binary-tree.ts +35 -0
  284. package/src/types/data-structures/binary-tree/bst.ts +11 -0
  285. package/src/types/data-structures/binary-tree/index.ts +6 -0
  286. package/src/types/data-structures/binary-tree/rb-tree.ts +8 -0
  287. package/src/types/data-structures/binary-tree/segment-tree.ts +1 -0
  288. package/src/types/data-structures/binary-tree/tree-multiset.ts +6 -0
  289. package/src/types/data-structures/graph/abstract-graph.ts +11 -0
  290. package/src/types/data-structures/graph/directed-graph.ts +8 -0
  291. package/src/types/data-structures/graph/index.ts +3 -0
  292. package/src/types/data-structures/graph/map-graph.ts +1 -0
  293. package/src/types/data-structures/graph/undirected-graph.ts +1 -0
  294. package/src/types/data-structures/hash/coordinate-map.ts +1 -0
  295. package/src/types/data-structures/hash/coordinate-set.ts +1 -0
  296. package/src/types/data-structures/hash/hash-map.ts +1 -0
  297. package/src/types/data-structures/hash/hash-table.ts +1 -0
  298. package/src/types/data-structures/hash/index.ts +1 -0
  299. package/src/types/data-structures/hash/tree-map.ts +1 -0
  300. package/src/types/data-structures/hash/tree-set.ts +1 -0
  301. package/src/types/data-structures/heap/heap.ts +1 -0
  302. package/src/types/data-structures/heap/index.ts +1 -0
  303. package/src/types/data-structures/heap/max-heap.ts +1 -0
  304. package/src/types/data-structures/heap/min-heap.ts +1 -0
  305. package/src/types/data-structures/index.ts +11 -0
  306. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
  307. package/src/types/data-structures/linked-list/index.ts +2 -0
  308. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
  309. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
  310. package/src/types/data-structures/matrix/index.ts +1 -0
  311. package/src/types/data-structures/matrix/matrix.ts +1 -0
  312. package/src/types/data-structures/matrix/matrix2d.ts +1 -0
  313. package/src/types/data-structures/matrix/navigator.ts +14 -0
  314. package/src/types/data-structures/matrix/vector2d.ts +1 -0
  315. package/src/types/data-structures/priority-queue/index.ts +3 -0
  316. package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
  317. package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
  318. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  319. package/src/types/data-structures/queue/deque.ts +1 -0
  320. package/src/types/data-structures/queue/index.ts +2 -0
  321. package/src/types/data-structures/queue/queue.ts +1 -0
  322. package/src/types/data-structures/stack/index.ts +1 -0
  323. package/src/types/data-structures/stack/stack.ts +1 -0
  324. package/src/types/data-structures/tree/index.ts +1 -0
  325. package/src/types/data-structures/tree/tree.ts +1 -0
  326. package/src/types/data-structures/trie/index.ts +1 -0
  327. package/src/types/data-structures/trie/trie.ts +1 -0
  328. package/src/types/helpers.ts +13 -0
  329. package/src/types/index.ts +3 -0
  330. package/src/types/utils/index.ts +2 -0
  331. package/src/types/utils/utils.ts +6 -0
  332. package/src/types/utils/validate-type.ts +35 -0
  333. package/src/utils/index.ts +1 -0
  334. package/src/utils/utils.ts +86 -0
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ /**
3
+ * data-structure-typed
4
+ *
5
+ * @author Tyler Zeng
6
+ * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
7
+ * @license MIT License
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Trie = exports.TrieNode = void 0;
11
+ /**
12
+ * TrieNode represents a node in the Trie data structure. It holds a character key, a map of children nodes,
13
+ * and a flag indicating whether it's the end of a word.
14
+ */
15
+ class TrieNode {
16
+ constructor(key) {
17
+ this._key = key;
18
+ this._isEnd = false;
19
+ this._children = new Map();
20
+ }
21
+ get key() {
22
+ return this._key;
23
+ }
24
+ set key(v) {
25
+ this._key = v;
26
+ }
27
+ get children() {
28
+ return this._children;
29
+ }
30
+ set children(v) {
31
+ this._children = v;
32
+ }
33
+ get isEnd() {
34
+ return this._isEnd;
35
+ }
36
+ set isEnd(v) {
37
+ this._isEnd = v;
38
+ }
39
+ }
40
+ exports.TrieNode = TrieNode;
41
+ /**
42
+ * Trie represents a Trie data structure. It provides basic Trie operations and additional methods.
43
+ */
44
+ class Trie {
45
+ constructor(words, caseSensitive = true) {
46
+ this._root = new TrieNode('');
47
+ this._caseSensitive = caseSensitive;
48
+ if (words) {
49
+ for (const i of words) {
50
+ this.add(i);
51
+ }
52
+ }
53
+ }
54
+ get root() {
55
+ return this._root;
56
+ }
57
+ set root(v) {
58
+ this._root = v;
59
+ }
60
+ /**
61
+ * Add a word to the Trie structure.
62
+ * @param {string} word - The word to add.
63
+ * @returns {boolean} True if the word was successfully added.
64
+ */
65
+ add(word) {
66
+ word = this._caseProcess(word);
67
+ let cur = this.root;
68
+ for (const c of word) {
69
+ let nodeC = cur.children.get(c);
70
+ if (!nodeC) {
71
+ nodeC = new TrieNode(c);
72
+ cur.children.set(c, nodeC);
73
+ }
74
+ cur = nodeC;
75
+ }
76
+ cur.isEnd = true;
77
+ return true;
78
+ }
79
+ /**
80
+ * Check if the Trie contains a given word.
81
+ * @param {string} word - The word to check for.
82
+ * @returns {boolean} True if the word is present in the Trie.
83
+ */
84
+ has(word) {
85
+ word = this._caseProcess(word);
86
+ let cur = this.root;
87
+ for (const c of word) {
88
+ const nodeC = cur.children.get(c);
89
+ if (!nodeC)
90
+ return false;
91
+ cur = nodeC;
92
+ }
93
+ return cur.isEnd;
94
+ }
95
+ /**
96
+ * Remove a word from the Trie structure.
97
+ * @param{string} word - The word to delete.
98
+ * @returns {boolean} True if the word was successfully removed.
99
+ */
100
+ delete(word) {
101
+ word = this._caseProcess(word);
102
+ let isDeleted = false;
103
+ const dfs = (cur, i) => {
104
+ const char = word[i];
105
+ const child = cur.children.get(char);
106
+ if (child) {
107
+ if (i === word.length - 1) {
108
+ if (child.isEnd) {
109
+ if (child.children.size > 0) {
110
+ child.isEnd = false;
111
+ }
112
+ else {
113
+ cur.children.delete(char);
114
+ }
115
+ isDeleted = true;
116
+ return true;
117
+ }
118
+ return false;
119
+ }
120
+ const res = dfs(child, i + 1);
121
+ if (res && !cur.isEnd && child.children.size === 0) {
122
+ cur.children.delete(char);
123
+ return true;
124
+ }
125
+ return false;
126
+ }
127
+ return false;
128
+ };
129
+ dfs(this.root, 0);
130
+ return isDeleted;
131
+ }
132
+ getHeight() {
133
+ const beginRoot = this.root;
134
+ let maxDepth = 0;
135
+ if (beginRoot) {
136
+ const bfs = (node, level) => {
137
+ if (level > maxDepth) {
138
+ maxDepth = level;
139
+ }
140
+ const { children } = node;
141
+ if (children) {
142
+ for (const child of children.entries()) {
143
+ bfs(child[1], level + 1);
144
+ }
145
+ }
146
+ };
147
+ bfs(beginRoot, 0);
148
+ }
149
+ return maxDepth;
150
+ }
151
+ // --- start additional methods ---
152
+ /**
153
+ * Check if a given input string has an absolute prefix in the Trie, meaning it's not a complete word.
154
+ * @param {string} input - The input string to check.
155
+ * @returns {boolean} True if it's an absolute prefix in the Trie.
156
+ */
157
+ hasPurePrefix(input) {
158
+ input = this._caseProcess(input);
159
+ let cur = this.root;
160
+ for (const c of input) {
161
+ const nodeC = cur.children.get(c);
162
+ if (!nodeC)
163
+ return false;
164
+ cur = nodeC;
165
+ }
166
+ return !cur.isEnd;
167
+ }
168
+ /**
169
+ * Check if a given input string is a prefix of any existing word in the Trie, whether as an absolute prefix or a complete word.
170
+ * @param {string} input - The input string representing the prefix to check.
171
+ * @returns {boolean} True if it's a prefix in the Trie.
172
+ */
173
+ hasPrefix(input) {
174
+ input = this._caseProcess(input);
175
+ let cur = this.root;
176
+ for (const c of input) {
177
+ const nodeC = cur.children.get(c);
178
+ if (!nodeC)
179
+ return false;
180
+ cur = nodeC;
181
+ }
182
+ return true;
183
+ }
184
+ /**
185
+ * Check if the input string is a common prefix in the Trie, meaning it's a prefix shared by all words in the Trie.
186
+ * @param {string} input - The input string representing the common prefix to check for.
187
+ * @returns {boolean} True if it's a common prefix in the Trie.
188
+ */
189
+ hasCommonPrefix(input) {
190
+ input = this._caseProcess(input);
191
+ let commonPre = '';
192
+ const dfs = (cur) => {
193
+ commonPre += cur.key;
194
+ if (commonPre === input)
195
+ return;
196
+ if (cur.isEnd)
197
+ return;
198
+ if (cur && cur.children && cur.children.size === 1)
199
+ dfs(Array.from(cur.children.values())[0]);
200
+ else
201
+ return;
202
+ };
203
+ dfs(this.root);
204
+ return commonPre === input;
205
+ }
206
+ /**
207
+ * Get the longest common prefix among all the words stored in the Trie.
208
+ * @returns {string} The longest common prefix found in the Trie.
209
+ */
210
+ getLongestCommonPrefix() {
211
+ let commonPre = '';
212
+ const dfs = (cur) => {
213
+ commonPre += cur.key;
214
+ if (cur.isEnd)
215
+ return;
216
+ if (cur && cur.children && cur.children.size === 1)
217
+ dfs(Array.from(cur.children.values())[0]);
218
+ else
219
+ return;
220
+ };
221
+ dfs(this.root);
222
+ return commonPre;
223
+ }
224
+ /**
225
+ * The `getAll` function returns an array of all words in a Trie data structure that start with a given prefix.
226
+ * @param {string} prefix - The `prefix` parameter is a string that represents the prefix that we want to search for in the
227
+ * trie. It is an optional parameter, so if no prefix is provided, it will default to an empty string.
228
+ * @param {number} max - The max count of words will be found
229
+ * @returns {string[]} an array of strings.
230
+ */
231
+ getWords(prefix = '', max = Number.MAX_SAFE_INTEGER) {
232
+ prefix = this._caseProcess(prefix);
233
+ const words = [];
234
+ let found = 0;
235
+ function dfs(node, word) {
236
+ for (const char of node.children.keys()) {
237
+ const charNode = node.children.get(char);
238
+ if (charNode !== undefined) {
239
+ dfs(charNode, word.concat(char));
240
+ }
241
+ }
242
+ if (node.isEnd) {
243
+ if (found > max - 1)
244
+ return;
245
+ words.push(word);
246
+ found++;
247
+ }
248
+ }
249
+ let startNode = this.root;
250
+ if (prefix) {
251
+ for (const c of prefix) {
252
+ const nodeC = startNode.children.get(c);
253
+ if (nodeC)
254
+ startNode = nodeC;
255
+ }
256
+ }
257
+ if (startNode !== this.root)
258
+ dfs(startNode, prefix);
259
+ return words;
260
+ }
261
+ _caseProcess(str) {
262
+ if (!this._caseSensitive) {
263
+ str = str.toLowerCase(); // Convert str to lowercase if case-insensitive
264
+ }
265
+ return str;
266
+ }
267
+ }
268
+ exports.Trie = Trie;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,6 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- export * from 'data-structure-typed/src/data-structures/heap/min-heap';
9
- export * from 'data-structure-typed/src/types/data-structures/heap/min-heap';
10
- export * from 'data-structure-typed/src/types/helpers';
8
+ export * from './data-structures/heap/min-heap';
9
+ export * from './types/data-structures/heap/min-heap';
10
+ export * from './types/helpers';
package/dist/index.js CHANGED
@@ -22,6 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  * @license MIT License
23
23
  */
24
24
  // export { MinHeap } from 'data-structure-typed';
25
- __exportStar(require("data-structure-typed/src/data-structures/heap/min-heap"), exports);
26
- __exportStar(require("data-structure-typed/src/types/data-structures/heap/min-heap"), exports);
27
- __exportStar(require("data-structure-typed/src/types/helpers"), exports);
25
+ __exportStar(require("./data-structures/heap/min-heap"), exports);
26
+ __exportStar(require("./types/data-structures/heap/min-heap"), exports);
27
+ __exportStar(require("./types/helpers"), exports);
@@ -0,0 +1,7 @@
1
+ import { BinaryTreeNode } from '../data-structures';
2
+ import { BinaryTreeDeletedResult, BinaryTreeNodeKey } from '../types';
3
+ export interface IBinaryTree<N extends BinaryTreeNode<N['val'], N>> {
4
+ createNode(key: BinaryTreeNodeKey, val?: N['val']): N;
5
+ add(keyOrNode: BinaryTreeNodeKey | N | null, val?: N['val']): N | null | undefined;
6
+ delete(nodeOrKey: N | BinaryTreeNodeKey): BinaryTreeDeletedResult<N>[];
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { VertexKey } from '../types';
2
+ export interface IGraph<V, E> {
3
+ createVertex(key: VertexKey, val?: V): V;
4
+ createEdge(srcOrV1: VertexKey | string, destOrV2: VertexKey | string, weight?: number, val?: E): E;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export * from './graph';
2
+ export * from './binary-tree';
3
+ export * from './doubly-linked-list';
4
+ export * from './heap';
5
+ export * from './navigator';
6
+ export * from './priority-queue';
7
+ export * from './segment-tree';
8
+ export * from './singly-linked-list';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./graph"), exports);
18
+ __exportStar(require("./binary-tree"), exports);
19
+ __exportStar(require("./doubly-linked-list"), exports);
20
+ __exportStar(require("./heap"), exports);
21
+ __exportStar(require("./navigator"), exports);
22
+ __exportStar(require("./priority-queue"), exports);
23
+ __exportStar(require("./segment-tree"), exports);
24
+ __exportStar(require("./singly-linked-list"), exports);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { AVLTreeNode } from '../../../data-structures';
2
+ import { BSTOptions } from './bst';
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
+ export type AVLTreeOptions = BSTOptions & {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { BinaryTreeNode } from '../../../data-structures';
2
+ /**
3
+ * Enum representing different loop types.
4
+ *
5
+ * - `iterative`: Indicates the iterative loop type (with loops that use iterations).
6
+ * - `recursive`: Indicates the recursive loop type (with loops that call themselves).
7
+ */
8
+ export declare enum IterationType {
9
+ ITERATIVE = "ITERATIVE",
10
+ RECURSIVE = "RECURSIVE"
11
+ }
12
+ export declare enum FamilyPosition {
13
+ ROOT = "ROOT",
14
+ LEFT = "LEFT",
15
+ RIGHT = "RIGHT",
16
+ ROOT_LEFT = "ROOT_LEFT",
17
+ ROOT_RIGHT = "ROOT_RIGHT",
18
+ ISOLATED = "ISOLATED",
19
+ MAL_NODE = "MAL_NODE"
20
+ }
21
+ export type BinaryTreeNodeKey = number;
22
+ export type BFSCallback<N> = (node: N, level?: number) => any;
23
+ export type BFSCallbackReturn<N> = ReturnType<BFSCallback<N>>;
24
+ export type BinaryTreeDeletedResult<N> = {
25
+ deleted: N | null | undefined;
26
+ needBalanced: N | null;
27
+ };
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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
29
+ export type BinaryTreeOptions = {
30
+ iterationType?: IterationType;
31
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FamilyPosition = exports.IterationType = void 0;
4
+ /**
5
+ * Enum representing different loop types.
6
+ *
7
+ * - `iterative`: Indicates the iterative loop type (with loops that use iterations).
8
+ * - `recursive`: Indicates the recursive loop type (with loops that call themselves).
9
+ */
10
+ var IterationType;
11
+ (function (IterationType) {
12
+ IterationType["ITERATIVE"] = "ITERATIVE";
13
+ IterationType["RECURSIVE"] = "RECURSIVE";
14
+ })(IterationType = exports.IterationType || (exports.IterationType = {}));
15
+ var FamilyPosition;
16
+ (function (FamilyPosition) {
17
+ FamilyPosition["ROOT"] = "ROOT";
18
+ FamilyPosition["LEFT"] = "LEFT";
19
+ FamilyPosition["RIGHT"] = "RIGHT";
20
+ FamilyPosition["ROOT_LEFT"] = "ROOT_LEFT";
21
+ FamilyPosition["ROOT_RIGHT"] = "ROOT_RIGHT";
22
+ FamilyPosition["ISOLATED"] = "ISOLATED";
23
+ FamilyPosition["MAL_NODE"] = "MAL_NODE";
24
+ })(FamilyPosition = exports.FamilyPosition || (exports.FamilyPosition = {}));
@@ -0,0 +1,7 @@
1
+ import { BSTNode } from '../../../data-structures';
2
+ import type { BinaryTreeNodeKey, BinaryTreeOptions } from './binary-tree';
3
+ export type BSTComparator = (a: BinaryTreeNodeKey, b: BinaryTreeNodeKey) => number;
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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
5
+ export type BSTOptions = BinaryTreeOptions & {
6
+ comparator?: BSTComparator;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./binary-tree"), exports);
18
+ __exportStar(require("./bst"), exports);
19
+ __exportStar(require("./avl-tree"), exports);
20
+ __exportStar(require("./segment-tree"), exports);
21
+ __exportStar(require("./tree-multiset"), exports);
22
+ __exportStar(require("./rb-tree"), exports);
@@ -0,0 +1,8 @@
1
+ import { BinaryTreeOptions } from './binary-tree';
2
+ import { RBTreeNode } from '../../../data-structures';
3
+ export declare enum RBColor {
4
+ RED = "RED",
5
+ BLACK = "BLACK"
6
+ }
7
+ export type RBTreeNodeNested<T> = RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, RBTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
8
+ export type RBTreeOptions = BinaryTreeOptions & {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RBColor = void 0;
4
+ var RBColor;
5
+ (function (RBColor) {
6
+ RBColor["RED"] = "RED";
7
+ RBColor["BLACK"] = "BLACK";
8
+ })(RBColor = exports.RBColor || (exports.RBColor = {}));
@@ -0,0 +1 @@
1
+ export type SegmentTreeNodeVal = number;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { TreeMultisetNode } from '../../../data-structures';
2
+ import { AVLTreeOptions } from './avl-tree';
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
+ export type TreeMultisetOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedNodeByKey'> & {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ export type VertexKey = string | number;
2
+ export type DijkstraResult<V> = {
3
+ distMap: Map<V, number>;
4
+ distPaths?: Map<V, V[]>;
5
+ preMap: Map<V, V | null>;
6
+ seen: Set<V>;
7
+ paths: V[][];
8
+ minDist: number;
9
+ minPath: V[];
10
+ } | null;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export type TopologicalStatus = 0 | 1 | 2;
2
+ export declare enum TopologicalProperty {
3
+ VAL = "VAL",
4
+ NODE = "NODE",
5
+ ID = "ID"
6
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TopologicalProperty = void 0;
4
+ var TopologicalProperty;
5
+ (function (TopologicalProperty) {
6
+ TopologicalProperty["VAL"] = "VAL";
7
+ TopologicalProperty["NODE"] = "NODE";
8
+ TopologicalProperty["ID"] = "ID";
9
+ })(TopologicalProperty = exports.TopologicalProperty || (exports.TopologicalProperty = {}));
@@ -0,0 +1,3 @@
1
+ export * from './abstract-graph';
2
+ export * from './map-graph';
3
+ export * from './directed-graph';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./abstract-graph"), exports);
18
+ __exportStar(require("./map-graph"), exports);
19
+ __exportStar(require("./directed-graph"), exports);
@@ -0,0 +1 @@
1
+ export type MapGraphCoordinate = [number, number];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });