data-structure-typed 1.38.1 → 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 (783) hide show
  1. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
  2. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  3. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
  4. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
  5. package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
  6. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
  7. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
  8. package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
  9. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
  10. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
  11. package/dist/cjs/data-structures/graph/index.js.map +1 -0
  12. package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
  13. package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
  14. package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
  15. package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
  16. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
  17. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
  18. package/dist/cjs/data-structures/hash/index.js.map +1 -0
  19. package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
  20. package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
  21. package/dist/cjs/data-structures/heap/heap.js.map +1 -0
  22. package/dist/cjs/data-structures/heap/index.js.map +1 -0
  23. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
  24. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
  25. package/dist/cjs/data-structures/index.js.map +1 -0
  26. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  27. package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
  28. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
  29. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
  30. package/dist/cjs/data-structures/matrix/index.js.map +1 -0
  31. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
  32. package/{lib → dist/cjs}/data-structures/matrix/matrix2d.js +13 -5
  33. package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
  34. package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
  35. package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
  36. package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
  37. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  38. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  39. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
  40. package/dist/cjs/data-structures/queue/deque.js.map +1 -0
  41. package/dist/cjs/data-structures/queue/index.js.map +1 -0
  42. package/dist/cjs/data-structures/queue/queue.js.map +1 -0
  43. package/dist/cjs/data-structures/stack/index.js.map +1 -0
  44. package/dist/cjs/data-structures/stack/stack.js.map +1 -0
  45. package/dist/cjs/data-structures/tree/index.js.map +1 -0
  46. package/dist/cjs/data-structures/tree/tree.js.map +1 -0
  47. package/dist/cjs/data-structures/trie/index.js.map +1 -0
  48. package/dist/cjs/data-structures/trie/trie.js.map +1 -0
  49. package/dist/cjs/index.js.map +1 -0
  50. package/dist/cjs/interfaces/binary-tree.js.map +1 -0
  51. package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
  52. package/dist/{interfaces → cjs/interfaces}/graph.js.map +1 -1
  53. package/dist/{interfaces → cjs/interfaces}/heap.js.map +1 -1
  54. package/dist/cjs/interfaces/index.js.map +1 -0
  55. package/dist/{interfaces → cjs/interfaces}/navigator.js.map +1 -1
  56. package/dist/cjs/interfaces/priority-queue.js.map +1 -0
  57. package/dist/cjs/interfaces/segment-tree.js.map +1 -0
  58. package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
  59. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  60. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  61. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  62. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
  63. package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
  64. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  65. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  66. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  67. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
  68. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
  69. package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
  70. package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
  71. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
  72. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
  73. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
  74. package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
  75. package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
  76. package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
  77. package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
  78. package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
  79. package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
  80. package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
  81. package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
  82. package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
  83. package/dist/cjs/types/data-structures/index.js.map +1 -0
  84. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  85. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
  86. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  87. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  88. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
  89. package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
  90. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
  91. package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
  92. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
  93. package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
  94. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  95. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  96. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  97. package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
  98. package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
  99. package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
  100. package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
  101. package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
  102. package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
  103. package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
  104. package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
  105. package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
  106. package/dist/cjs/types/helpers.js.map +1 -0
  107. package/dist/cjs/types/index.js.map +1 -0
  108. package/dist/cjs/types/utils/index.js.map +1 -0
  109. package/dist/{types → cjs/types}/utils/utils.js.map +1 -1
  110. package/dist/cjs/types/utils/validate-type.js.map +1 -0
  111. package/dist/cjs/utils/index.js.map +1 -0
  112. package/dist/cjs/utils/utils.js.map +1 -0
  113. package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.js +10 -4
  114. package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.js +12 -3
  115. package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.js +66 -49
  116. package/{lib → dist/mjs}/data-structures/binary-tree/bst.js +42 -40
  117. package/dist/mjs/data-structures/binary-tree/index.js +23 -0
  118. package/dist/mjs/data-structures/binary-tree/rb-tree.js +28 -0
  119. package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.js +17 -10
  120. package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.js +19 -13
  121. package/{lib → dist/mjs}/data-structures/graph/abstract-graph.js +29 -24
  122. package/{lib → dist/mjs}/data-structures/graph/directed-graph.js +22 -14
  123. package/dist/mjs/data-structures/graph/index.js +20 -0
  124. package/{lib → dist/mjs}/data-structures/graph/map-graph.js +14 -5
  125. package/{lib → dist/mjs}/data-structures/graph/undirected-graph.js +19 -13
  126. package/{lib → dist/mjs}/data-structures/hash/coordinate-map.js +6 -2
  127. package/{lib → dist/mjs}/data-structures/hash/coordinate-set.js +6 -2
  128. package/{lib → dist/mjs}/data-structures/hash/hash-map.js +11 -1
  129. package/{lib → dist/mjs}/data-structures/hash/hash-table.js +16 -4
  130. package/dist/mjs/data-structures/hash/index.js +22 -0
  131. package/dist/mjs/data-structures/hash/tree-map.js +6 -0
  132. package/dist/mjs/data-structures/hash/tree-set.js +6 -0
  133. package/{lib → dist/mjs}/data-structures/heap/heap.js +23 -7
  134. package/dist/mjs/data-structures/heap/index.js +19 -0
  135. package/{lib → dist/mjs}/data-structures/heap/max-heap.js +6 -2
  136. package/{lib → dist/mjs}/data-structures/heap/min-heap.js +6 -2
  137. package/dist/mjs/data-structures/index.js +27 -0
  138. package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.js +15 -6
  139. package/dist/mjs/data-structures/linked-list/index.js +19 -0
  140. package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.js +12 -2
  141. package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.js +14 -2
  142. package/dist/mjs/data-structures/matrix/index.js +20 -0
  143. package/{lib → dist/mjs}/data-structures/matrix/matrix.js +6 -1
  144. package/dist/{data-structures → mjs/data-structures}/matrix/matrix2d.js +5 -2
  145. package/{lib → dist/mjs}/data-structures/matrix/navigator.js +14 -2
  146. package/{lib → dist/mjs}/data-structures/matrix/vector2d.js +9 -2
  147. package/dist/mjs/data-structures/priority-queue/index.js +19 -0
  148. package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.js +6 -2
  149. package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.js +6 -2
  150. package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
  151. package/{lib → dist/mjs}/data-structures/queue/deque.js +21 -22
  152. package/dist/mjs/data-structures/queue/index.js +18 -0
  153. package/{lib → dist/mjs}/data-structures/queue/queue.js +11 -5
  154. package/dist/mjs/data-structures/stack/index.js +17 -0
  155. package/{lib → dist/mjs}/data-structures/stack/stack.js +6 -1
  156. package/dist/mjs/data-structures/tree/index.js +17 -0
  157. package/{lib → dist/mjs}/data-structures/tree/tree.js +8 -1
  158. package/dist/mjs/data-structures/trie/index.js +17 -0
  159. package/{lib → dist/mjs}/data-structures/trie/trie.js +12 -2
  160. package/dist/mjs/index.js +20 -0
  161. package/dist/mjs/interfaces/binary-tree.js +2 -0
  162. package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
  163. package/dist/mjs/interfaces/graph.js +2 -0
  164. package/dist/mjs/interfaces/heap.js +2 -0
  165. package/dist/mjs/interfaces/index.js +24 -0
  166. package/dist/mjs/interfaces/navigator.js +2 -0
  167. package/dist/mjs/interfaces/priority-queue.js +2 -0
  168. package/dist/mjs/interfaces/segment-tree.js +2 -0
  169. package/dist/mjs/interfaces/singly-linked-list.js +2 -0
  170. package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
  171. package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
  172. package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-tree.js +7 -4
  173. package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
  174. package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
  175. package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +8 -0
  176. package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
  177. package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
  178. package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
  179. package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
  180. package/dist/mjs/types/data-structures/graph/index.js +19 -0
  181. package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
  182. package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
  183. package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
  184. package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
  185. package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
  186. package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
  187. package/dist/mjs/types/data-structures/hash/index.js +2 -0
  188. package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
  189. package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
  190. package/dist/mjs/types/data-structures/heap/heap.js +2 -0
  191. package/dist/mjs/types/data-structures/heap/index.js +17 -0
  192. package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
  193. package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
  194. package/dist/mjs/types/data-structures/index.js +27 -0
  195. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
  196. package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
  197. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
  198. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
  199. package/dist/mjs/types/data-structures/matrix/index.js +17 -0
  200. package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
  201. package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
  202. package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
  203. package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
  204. package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
  205. package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
  206. package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
  207. package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
  208. package/dist/mjs/types/data-structures/queue/deque.js +2 -0
  209. package/dist/mjs/types/data-structures/queue/index.js +18 -0
  210. package/dist/mjs/types/data-structures/queue/queue.js +2 -0
  211. package/dist/mjs/types/data-structures/stack/index.js +17 -0
  212. package/dist/mjs/types/data-structures/stack/stack.js +2 -0
  213. package/dist/mjs/types/data-structures/tree/index.js +17 -0
  214. package/dist/mjs/types/data-structures/tree/tree.js +2 -0
  215. package/dist/mjs/types/data-structures/trie/index.js +17 -0
  216. package/dist/mjs/types/data-structures/trie/trie.js +2 -0
  217. package/dist/mjs/types/helpers.js +9 -0
  218. package/dist/mjs/types/index.js +19 -0
  219. package/dist/mjs/types/utils/index.js +18 -0
  220. package/dist/mjs/types/utils/utils.js +2 -0
  221. package/dist/mjs/types/utils/validate-type.js +2 -0
  222. package/dist/mjs/utils/index.js +17 -0
  223. package/dist/mjs/utils/utils.js +64 -0
  224. package/dist/umd/index.global.js +27 -0
  225. package/dist/umd/index.global.js.map +1 -0
  226. package/package.json +21 -23
  227. package/src/data-structures/binary-tree/avl-tree.ts +1 -1
  228. package/src/data-structures/binary-tree/binary-indexed-tree.ts +1 -1
  229. package/src/data-structures/binary-tree/binary-tree.ts +2 -2
  230. package/src/data-structures/binary-tree/tree-multiset.ts +1 -2
  231. package/src/data-structures/graph/abstract-graph.ts +10 -11
  232. package/src/data-structures/graph/directed-graph.ts +1 -2
  233. package/src/data-structures/graph/undirected-graph.ts +4 -5
  234. package/src/data-structures/hash/hash-map.ts +1 -1
  235. package/src/data-structures/hash/tree-map.ts +2 -1
  236. package/src/data-structures/hash/tree-set.ts +2 -1
  237. package/src/data-structures/linked-list/singly-linked-list.ts +1 -1
  238. package/src/data-structures/matrix/matrix.ts +1 -1
  239. package/src/data-structures/matrix/vector2d.ts +2 -1
  240. package/src/data-structures/queue/deque.ts +5 -4
  241. package/src/data-structures/queue/queue.ts +1 -1
  242. package/src/types/data-structures/matrix/navigator.ts +1 -1
  243. package/src/types/utils/utils.ts +1 -1
  244. package/src/types/utils/validate-type.ts +2 -2
  245. package/test/integration/bst.test.ts +1 -1
  246. package/test/integration/index.html +1 -2
  247. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +1 -1
  248. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +2 -1
  249. package/test/unit/data-structures/binary-tree/bst.test.ts +3 -3
  250. package/test/unit/data-structures/binary-tree/overall.test.ts +1 -1
  251. package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +1 -1
  252. package/test/unit/data-structures/hash/hash-table.test.ts +1 -1
  253. package/test/unit/data-structures/heap/heap.test.ts +2 -2
  254. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +1 -1
  255. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +2 -2
  256. package/test/unit/data-structures/matrix/navigator.test.ts +1 -1
  257. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +2 -2
  258. package/test/unit/data-structures/queue/deque.test.ts +1 -1
  259. package/test/unit/data-structures/queue/queue.test.ts +1 -1
  260. package/test/utils/big-o.ts +1 -1
  261. package/tsconfig-base.json +27 -0
  262. package/tsconfig-cjs.json +9 -0
  263. package/tsup.config.js +11 -0
  264. package/umd/bundle.min.js +1 -1
  265. package/umd/bundle.min.js.map +1 -1
  266. package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
  267. package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  268. package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
  269. package/dist/data-structures/binary-tree/bst.js.map +0 -1
  270. package/dist/data-structures/binary-tree/index.js.map +0 -1
  271. package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
  272. package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
  273. package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
  274. package/dist/data-structures/graph/abstract-graph.js.map +0 -1
  275. package/dist/data-structures/graph/directed-graph.js.map +0 -1
  276. package/dist/data-structures/graph/index.js.map +0 -1
  277. package/dist/data-structures/graph/map-graph.js.map +0 -1
  278. package/dist/data-structures/graph/undirected-graph.js.map +0 -1
  279. package/dist/data-structures/hash/coordinate-map.js.map +0 -1
  280. package/dist/data-structures/hash/coordinate-set.js.map +0 -1
  281. package/dist/data-structures/hash/hash-map.js.map +0 -1
  282. package/dist/data-structures/hash/hash-table.js.map +0 -1
  283. package/dist/data-structures/hash/index.js.map +0 -1
  284. package/dist/data-structures/hash/tree-map.js.map +0 -1
  285. package/dist/data-structures/hash/tree-set.js.map +0 -1
  286. package/dist/data-structures/heap/heap.js.map +0 -1
  287. package/dist/data-structures/heap/index.js.map +0 -1
  288. package/dist/data-structures/heap/max-heap.js.map +0 -1
  289. package/dist/data-structures/heap/min-heap.js.map +0 -1
  290. package/dist/data-structures/index.js.map +0 -1
  291. package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  292. package/dist/data-structures/linked-list/index.js.map +0 -1
  293. package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
  294. package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
  295. package/dist/data-structures/matrix/index.js.map +0 -1
  296. package/dist/data-structures/matrix/matrix.js.map +0 -1
  297. package/dist/data-structures/matrix/matrix2d.js.map +0 -1
  298. package/dist/data-structures/matrix/navigator.js.map +0 -1
  299. package/dist/data-structures/matrix/vector2d.js.map +0 -1
  300. package/dist/data-structures/priority-queue/index.js.map +0 -1
  301. package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  302. package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  303. package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
  304. package/dist/data-structures/queue/deque.js.map +0 -1
  305. package/dist/data-structures/queue/index.js.map +0 -1
  306. package/dist/data-structures/queue/queue.js.map +0 -1
  307. package/dist/data-structures/stack/index.js.map +0 -1
  308. package/dist/data-structures/stack/stack.js.map +0 -1
  309. package/dist/data-structures/tree/index.js.map +0 -1
  310. package/dist/data-structures/tree/tree.js.map +0 -1
  311. package/dist/data-structures/trie/index.js.map +0 -1
  312. package/dist/data-structures/trie/trie.js.map +0 -1
  313. package/dist/index.js.map +0 -1
  314. package/dist/interfaces/binary-tree.js.map +0 -1
  315. package/dist/interfaces/doubly-linked-list.js.map +0 -1
  316. package/dist/interfaces/index.js.map +0 -1
  317. package/dist/interfaces/priority-queue.js.map +0 -1
  318. package/dist/interfaces/segment-tree.js.map +0 -1
  319. package/dist/interfaces/singly-linked-list.js.map +0 -1
  320. package/dist/types/data-structures/binary-tree/avl-tree.js.map +0 -1
  321. package/dist/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  322. package/dist/types/data-structures/binary-tree/binary-tree.js.map +0 -1
  323. package/dist/types/data-structures/binary-tree/bst.js.map +0 -1
  324. package/dist/types/data-structures/binary-tree/index.js.map +0 -1
  325. package/dist/types/data-structures/binary-tree/rb-tree.js.map +0 -1
  326. package/dist/types/data-structures/binary-tree/segment-tree.js.map +0 -1
  327. package/dist/types/data-structures/binary-tree/tree-multiset.js.map +0 -1
  328. package/dist/types/data-structures/graph/abstract-graph.js.map +0 -1
  329. package/dist/types/data-structures/graph/directed-graph.js.map +0 -1
  330. package/dist/types/data-structures/graph/index.js.map +0 -1
  331. package/dist/types/data-structures/graph/map-graph.js.map +0 -1
  332. package/dist/types/data-structures/graph/undirected-graph.js.map +0 -1
  333. package/dist/types/data-structures/hash/coordinate-map.js.map +0 -1
  334. package/dist/types/data-structures/hash/coordinate-set.js.map +0 -1
  335. package/dist/types/data-structures/hash/hash-map.js.map +0 -1
  336. package/dist/types/data-structures/hash/hash-table.js.map +0 -1
  337. package/dist/types/data-structures/hash/index.js.map +0 -1
  338. package/dist/types/data-structures/hash/tree-map.js.map +0 -1
  339. package/dist/types/data-structures/hash/tree-set.js.map +0 -1
  340. package/dist/types/data-structures/heap/heap.js.map +0 -1
  341. package/dist/types/data-structures/heap/index.js.map +0 -1
  342. package/dist/types/data-structures/heap/max-heap.js.map +0 -1
  343. package/dist/types/data-structures/heap/min-heap.js.map +0 -1
  344. package/dist/types/data-structures/index.js.map +0 -1
  345. package/dist/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  346. package/dist/types/data-structures/linked-list/index.js.map +0 -1
  347. package/dist/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
  348. package/dist/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
  349. package/dist/types/data-structures/matrix/index.js.map +0 -1
  350. package/dist/types/data-structures/matrix/matrix.js.map +0 -1
  351. package/dist/types/data-structures/matrix/matrix2d.js.map +0 -1
  352. package/dist/types/data-structures/matrix/navigator.js.map +0 -1
  353. package/dist/types/data-structures/matrix/vector2d.js.map +0 -1
  354. package/dist/types/data-structures/priority-queue/index.js.map +0 -1
  355. package/dist/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  356. package/dist/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  357. package/dist/types/data-structures/priority-queue/priority-queue.js.map +0 -1
  358. package/dist/types/data-structures/queue/deque.js.map +0 -1
  359. package/dist/types/data-structures/queue/index.js.map +0 -1
  360. package/dist/types/data-structures/queue/queue.js.map +0 -1
  361. package/dist/types/data-structures/stack/index.js.map +0 -1
  362. package/dist/types/data-structures/stack/stack.js.map +0 -1
  363. package/dist/types/data-structures/tree/index.js.map +0 -1
  364. package/dist/types/data-structures/tree/tree.js.map +0 -1
  365. package/dist/types/data-structures/trie/index.js.map +0 -1
  366. package/dist/types/data-structures/trie/trie.js.map +0 -1
  367. package/dist/types/helpers.js.map +0 -1
  368. package/dist/types/index.js.map +0 -1
  369. package/dist/types/utils/index.js.map +0 -1
  370. package/dist/types/utils/validate-type.js.map +0 -1
  371. package/dist/utils/index.js.map +0 -1
  372. package/dist/utils/utils.js.map +0 -1
  373. package/lib/data-structures/binary-tree/index.js +0 -7
  374. package/lib/data-structures/binary-tree/rb-tree.js +0 -22
  375. package/lib/data-structures/graph/index.js +0 -4
  376. package/lib/data-structures/hash/index.js +0 -6
  377. package/lib/data-structures/hash/tree-map.js +0 -2
  378. package/lib/data-structures/hash/tree-set.js +0 -2
  379. package/lib/data-structures/heap/index.js +0 -3
  380. package/lib/data-structures/index.js +0 -11
  381. package/lib/data-structures/linked-list/index.js +0 -3
  382. package/lib/data-structures/matrix/index.js +0 -4
  383. package/lib/data-structures/priority-queue/index.js +0 -3
  384. package/lib/data-structures/priority-queue/priority-queue.js +0 -13
  385. package/lib/data-structures/queue/index.js +0 -2
  386. package/lib/data-structures/stack/index.js +0 -1
  387. package/lib/data-structures/tree/index.js +0 -1
  388. package/lib/data-structures/trie/index.js +0 -1
  389. package/lib/index.js +0 -4
  390. package/lib/interfaces/binary-tree.js +0 -1
  391. package/lib/interfaces/doubly-linked-list.js +0 -1
  392. package/lib/interfaces/graph.js +0 -1
  393. package/lib/interfaces/heap.js +0 -1
  394. package/lib/interfaces/index.js +0 -8
  395. package/lib/interfaces/navigator.js +0 -1
  396. package/lib/interfaces/priority-queue.js +0 -1
  397. package/lib/interfaces/segment-tree.js +0 -1
  398. package/lib/interfaces/singly-linked-list.js +0 -1
  399. package/lib/types/data-structures/binary-tree/avl-tree.js +0 -1
  400. package/lib/types/data-structures/binary-tree/binary-indexed-tree.js +0 -1
  401. package/lib/types/data-structures/binary-tree/bst.js +0 -1
  402. package/lib/types/data-structures/binary-tree/index.js +0 -6
  403. package/lib/types/data-structures/binary-tree/rb-tree.js +0 -5
  404. package/lib/types/data-structures/binary-tree/segment-tree.js +0 -1
  405. package/lib/types/data-structures/binary-tree/tree-multiset.js +0 -1
  406. package/lib/types/data-structures/graph/abstract-graph.js +0 -1
  407. package/lib/types/data-structures/graph/directed-graph.js +0 -6
  408. package/lib/types/data-structures/graph/index.js +0 -3
  409. package/lib/types/data-structures/graph/map-graph.js +0 -1
  410. package/lib/types/data-structures/graph/undirected-graph.js +0 -1
  411. package/lib/types/data-structures/hash/coordinate-map.js +0 -1
  412. package/lib/types/data-structures/hash/coordinate-set.js +0 -1
  413. package/lib/types/data-structures/hash/hash-map.js +0 -1
  414. package/lib/types/data-structures/hash/hash-table.js +0 -1
  415. package/lib/types/data-structures/hash/index.js +0 -1
  416. package/lib/types/data-structures/hash/tree-map.js +0 -1
  417. package/lib/types/data-structures/hash/tree-set.js +0 -1
  418. package/lib/types/data-structures/heap/heap.js +0 -1
  419. package/lib/types/data-structures/heap/index.js +0 -1
  420. package/lib/types/data-structures/heap/max-heap.js +0 -1
  421. package/lib/types/data-structures/heap/min-heap.js +0 -1
  422. package/lib/types/data-structures/index.js +0 -11
  423. package/lib/types/data-structures/linked-list/doubly-linked-list.js +0 -1
  424. package/lib/types/data-structures/linked-list/index.js +0 -2
  425. package/lib/types/data-structures/linked-list/singly-linked-list.js +0 -1
  426. package/lib/types/data-structures/linked-list/skip-linked-list.js +0 -1
  427. package/lib/types/data-structures/matrix/index.js +0 -1
  428. package/lib/types/data-structures/matrix/matrix.js +0 -1
  429. package/lib/types/data-structures/matrix/matrix2d.js +0 -1
  430. package/lib/types/data-structures/matrix/navigator.js +0 -1
  431. package/lib/types/data-structures/matrix/vector2d.js +0 -1
  432. package/lib/types/data-structures/priority-queue/index.js +0 -3
  433. package/lib/types/data-structures/priority-queue/max-priority-queue.js +0 -1
  434. package/lib/types/data-structures/priority-queue/min-priority-queue.js +0 -1
  435. package/lib/types/data-structures/priority-queue/priority-queue.js +0 -1
  436. package/lib/types/data-structures/queue/deque.js +0 -1
  437. package/lib/types/data-structures/queue/index.js +0 -2
  438. package/lib/types/data-structures/queue/queue.js +0 -1
  439. package/lib/types/data-structures/stack/index.js +0 -1
  440. package/lib/types/data-structures/stack/stack.js +0 -1
  441. package/lib/types/data-structures/tree/index.js +0 -1
  442. package/lib/types/data-structures/tree/tree.js +0 -1
  443. package/lib/types/data-structures/trie/index.js +0 -1
  444. package/lib/types/data-structures/trie/trie.js +0 -1
  445. package/lib/types/helpers.js +0 -6
  446. package/lib/types/index.js +0 -3
  447. package/lib/types/utils/index.js +0 -2
  448. package/lib/types/utils/utils.js +0 -1
  449. package/lib/types/utils/validate-type.js +0 -1
  450. package/lib/utils/index.js +0 -1
  451. package/lib/utils/utils.js +0 -63
  452. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.d.ts +0 -0
  453. /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.js +0 -0
  454. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  455. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  456. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.d.ts +0 -0
  457. /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.js +0 -0
  458. /package/dist/{data-structures → cjs/data-structures}/binary-tree/bst.d.ts +0 -0
  459. /package/dist/{data-structures → cjs/data-structures}/binary-tree/bst.js +0 -0
  460. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.d.ts +0 -0
  461. /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.js +0 -0
  462. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.d.ts +0 -0
  463. /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.js +0 -0
  464. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.d.ts +0 -0
  465. /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.js +0 -0
  466. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.d.ts +0 -0
  467. /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.js +0 -0
  468. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.d.ts +0 -0
  469. /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.js +0 -0
  470. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.d.ts +0 -0
  471. /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.js +0 -0
  472. /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
  473. /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
  474. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.d.ts +0 -0
  475. /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.js +0 -0
  476. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.d.ts +0 -0
  477. /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.js +0 -0
  478. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.d.ts +0 -0
  479. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.js +0 -0
  480. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.d.ts +0 -0
  481. /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.js +0 -0
  482. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.d.ts +0 -0
  483. /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.js +0 -0
  484. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.d.ts +0 -0
  485. /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.js +0 -0
  486. /package/dist/{data-structures → cjs/data-structures}/hash/index.d.ts +0 -0
  487. /package/dist/{data-structures → cjs/data-structures}/hash/index.js +0 -0
  488. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
  489. /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
  490. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
  491. /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
  492. /package/dist/{data-structures → cjs/data-structures}/heap/heap.d.ts +0 -0
  493. /package/dist/{data-structures → cjs/data-structures}/heap/heap.js +0 -0
  494. /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
  495. /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
  496. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.d.ts +0 -0
  497. /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.js +0 -0
  498. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.d.ts +0 -0
  499. /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.js +0 -0
  500. /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
  501. /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
  502. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  503. /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.js +0 -0
  504. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
  505. /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
  506. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  507. /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.js +0 -0
  508. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  509. /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.js +0 -0
  510. /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
  511. /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
  512. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.d.ts +0 -0
  513. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
  514. /package/dist/{data-structures → cjs/data-structures}/matrix/matrix2d.d.ts +0 -0
  515. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.d.ts +0 -0
  516. /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
  517. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.d.ts +0 -0
  518. /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.js +0 -0
  519. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
  520. /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
  521. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  522. /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.js +0 -0
  523. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  524. /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.js +0 -0
  525. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.d.ts +0 -0
  526. /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.js +0 -0
  527. /package/dist/{data-structures → cjs/data-structures}/queue/deque.d.ts +0 -0
  528. /package/dist/{data-structures → cjs/data-structures}/queue/deque.js +0 -0
  529. /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
  530. /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
  531. /package/dist/{data-structures → cjs/data-structures}/queue/queue.d.ts +0 -0
  532. /package/dist/{data-structures → cjs/data-structures}/queue/queue.js +0 -0
  533. /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
  534. /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
  535. /package/dist/{data-structures → cjs/data-structures}/stack/stack.d.ts +0 -0
  536. /package/dist/{data-structures → cjs/data-structures}/stack/stack.js +0 -0
  537. /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
  538. /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
  539. /package/dist/{data-structures → cjs/data-structures}/tree/tree.d.ts +0 -0
  540. /package/dist/{data-structures → cjs/data-structures}/tree/tree.js +0 -0
  541. /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
  542. /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
  543. /package/dist/{data-structures → cjs/data-structures}/trie/trie.d.ts +0 -0
  544. /package/dist/{data-structures → cjs/data-structures}/trie/trie.js +0 -0
  545. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  546. /package/dist/{index.js → cjs/index.js} +0 -0
  547. /package/dist/{interfaces → cjs/interfaces}/binary-tree.d.ts +0 -0
  548. /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
  549. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
  550. /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
  551. /package/dist/{interfaces → cjs/interfaces}/graph.d.ts +0 -0
  552. /package/dist/{interfaces → cjs/interfaces}/graph.js +0 -0
  553. /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
  554. /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
  555. /package/dist/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  556. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  557. /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
  558. /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
  559. /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
  560. /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
  561. /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
  562. /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
  563. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
  564. /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
  565. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  566. /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.js +0 -0
  567. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  568. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  569. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  570. /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-tree.js +0 -0
  571. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.d.ts +0 -0
  572. /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.js +0 -0
  573. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.d.ts +0 -0
  574. /package/dist/{types → cjs/types}/data-structures/binary-tree/index.js +0 -0
  575. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  576. /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.js +0 -0
  577. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  578. /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.js +0 -0
  579. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  580. /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.js +0 -0
  581. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.d.ts +0 -0
  582. /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.js +0 -0
  583. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.d.ts +0 -0
  584. /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.js +0 -0
  585. /package/dist/{types → cjs/types}/data-structures/graph/index.d.ts +0 -0
  586. /package/dist/{types → cjs/types}/data-structures/graph/index.js +0 -0
  587. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.d.ts +0 -0
  588. /package/dist/{types → cjs/types}/data-structures/graph/map-graph.js +0 -0
  589. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.d.ts +0 -0
  590. /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.js +0 -0
  591. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.d.ts +0 -0
  592. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.js +0 -0
  593. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.d.ts +0 -0
  594. /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.js +0 -0
  595. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.d.ts +0 -0
  596. /package/dist/{types → cjs/types}/data-structures/hash/hash-map.js +0 -0
  597. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.d.ts +0 -0
  598. /package/dist/{types → cjs/types}/data-structures/hash/hash-table.js +0 -0
  599. /package/dist/{types → cjs/types}/data-structures/hash/index.d.ts +0 -0
  600. /package/dist/{types → cjs/types}/data-structures/hash/index.js +0 -0
  601. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.d.ts +0 -0
  602. /package/dist/{types → cjs/types}/data-structures/hash/tree-map.js +0 -0
  603. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.d.ts +0 -0
  604. /package/dist/{types → cjs/types}/data-structures/hash/tree-set.js +0 -0
  605. /package/dist/{types → cjs/types}/data-structures/heap/heap.d.ts +0 -0
  606. /package/dist/{types → cjs/types}/data-structures/heap/heap.js +0 -0
  607. /package/dist/{types → cjs/types}/data-structures/heap/index.d.ts +0 -0
  608. /package/dist/{types → cjs/types}/data-structures/heap/index.js +0 -0
  609. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.d.ts +0 -0
  610. /package/dist/{types → cjs/types}/data-structures/heap/max-heap.js +0 -0
  611. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.d.ts +0 -0
  612. /package/dist/{types → cjs/types}/data-structures/heap/min-heap.js +0 -0
  613. /package/dist/{types → cjs/types}/data-structures/index.d.ts +0 -0
  614. /package/dist/{types → cjs/types}/data-structures/index.js +0 -0
  615. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  616. /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  617. /package/dist/{types → cjs/types}/data-structures/linked-list/index.d.ts +0 -0
  618. /package/dist/{types → cjs/types}/data-structures/linked-list/index.js +0 -0
  619. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  620. /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.js +0 -0
  621. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  622. /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.js +0 -0
  623. /package/dist/{types → cjs/types}/data-structures/matrix/index.d.ts +0 -0
  624. /package/dist/{types → cjs/types}/data-structures/matrix/index.js +0 -0
  625. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.d.ts +0 -0
  626. /package/dist/{types → cjs/types}/data-structures/matrix/matrix.js +0 -0
  627. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.d.ts +0 -0
  628. /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.js +0 -0
  629. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.d.ts +0 -0
  630. /package/dist/{types → cjs/types}/data-structures/matrix/navigator.js +0 -0
  631. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.d.ts +0 -0
  632. /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.js +0 -0
  633. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
  634. /package/dist/{types → cjs/types}/data-structures/priority-queue/index.js +0 -0
  635. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  636. /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  637. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  638. /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  639. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  640. /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.js +0 -0
  641. /package/dist/{types → cjs/types}/data-structures/queue/deque.d.ts +0 -0
  642. /package/dist/{types → cjs/types}/data-structures/queue/deque.js +0 -0
  643. /package/dist/{types → cjs/types}/data-structures/queue/index.d.ts +0 -0
  644. /package/dist/{types → cjs/types}/data-structures/queue/index.js +0 -0
  645. /package/dist/{types → cjs/types}/data-structures/queue/queue.d.ts +0 -0
  646. /package/dist/{types → cjs/types}/data-structures/queue/queue.js +0 -0
  647. /package/dist/{types → cjs/types}/data-structures/stack/index.d.ts +0 -0
  648. /package/dist/{types → cjs/types}/data-structures/stack/index.js +0 -0
  649. /package/dist/{types → cjs/types}/data-structures/stack/stack.d.ts +0 -0
  650. /package/dist/{types → cjs/types}/data-structures/stack/stack.js +0 -0
  651. /package/dist/{types → cjs/types}/data-structures/tree/index.d.ts +0 -0
  652. /package/dist/{types → cjs/types}/data-structures/tree/index.js +0 -0
  653. /package/dist/{types → cjs/types}/data-structures/tree/tree.d.ts +0 -0
  654. /package/dist/{types → cjs/types}/data-structures/tree/tree.js +0 -0
  655. /package/dist/{types → cjs/types}/data-structures/trie/index.d.ts +0 -0
  656. /package/dist/{types → cjs/types}/data-structures/trie/index.js +0 -0
  657. /package/dist/{types → cjs/types}/data-structures/trie/trie.d.ts +0 -0
  658. /package/dist/{types → cjs/types}/data-structures/trie/trie.js +0 -0
  659. /package/dist/{types → cjs/types}/helpers.d.ts +0 -0
  660. /package/dist/{types → cjs/types}/helpers.js +0 -0
  661. /package/dist/{types → cjs/types}/index.d.ts +0 -0
  662. /package/dist/{types → cjs/types}/index.js +0 -0
  663. /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
  664. /package/dist/{types → cjs/types}/utils/index.js +0 -0
  665. /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
  666. /package/dist/{types → cjs/types}/utils/utils.js +0 -0
  667. /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
  668. /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
  669. /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
  670. /package/dist/{utils → cjs/utils}/index.js +0 -0
  671. /package/dist/{utils → cjs/utils}/utils.d.ts +0 -0
  672. /package/dist/{utils → cjs/utils}/utils.js +0 -0
  673. /package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  674. /package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  675. /package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  676. /package/{lib → dist/mjs}/data-structures/binary-tree/bst.d.ts +0 -0
  677. /package/{lib → dist/mjs}/data-structures/binary-tree/index.d.ts +0 -0
  678. /package/{lib → dist/mjs}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  679. /package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  680. /package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  681. /package/{lib → dist/mjs}/data-structures/graph/abstract-graph.d.ts +0 -0
  682. /package/{lib → dist/mjs}/data-structures/graph/directed-graph.d.ts +0 -0
  683. /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
  684. /package/{lib → dist/mjs}/data-structures/graph/map-graph.d.ts +0 -0
  685. /package/{lib → dist/mjs}/data-structures/graph/undirected-graph.d.ts +0 -0
  686. /package/{lib → dist/mjs}/data-structures/hash/coordinate-map.d.ts +0 -0
  687. /package/{lib → dist/mjs}/data-structures/hash/coordinate-set.d.ts +0 -0
  688. /package/{lib → dist/mjs}/data-structures/hash/hash-map.d.ts +0 -0
  689. /package/{lib → dist/mjs}/data-structures/hash/hash-table.d.ts +0 -0
  690. /package/{lib → dist/mjs}/data-structures/hash/index.d.ts +0 -0
  691. /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
  692. /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
  693. /package/{lib → dist/mjs}/data-structures/heap/heap.d.ts +0 -0
  694. /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
  695. /package/{lib → dist/mjs}/data-structures/heap/max-heap.d.ts +0 -0
  696. /package/{lib → dist/mjs}/data-structures/heap/min-heap.d.ts +0 -0
  697. /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
  698. /package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  699. /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
  700. /package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  701. /package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  702. /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
  703. /package/{lib → dist/mjs}/data-structures/matrix/matrix.d.ts +0 -0
  704. /package/{lib → dist/mjs}/data-structures/matrix/matrix2d.d.ts +0 -0
  705. /package/{lib → dist/mjs}/data-structures/matrix/navigator.d.ts +0 -0
  706. /package/{lib → dist/mjs}/data-structures/matrix/vector2d.d.ts +0 -0
  707. /package/{lib → dist/mjs}/data-structures/priority-queue/index.d.ts +0 -0
  708. /package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  709. /package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  710. /package/{lib → dist/mjs}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  711. /package/{lib → dist/mjs}/data-structures/queue/deque.d.ts +0 -0
  712. /package/{lib → dist/mjs}/data-structures/queue/index.d.ts +0 -0
  713. /package/{lib → dist/mjs}/data-structures/queue/queue.d.ts +0 -0
  714. /package/{lib → dist/mjs}/data-structures/stack/index.d.ts +0 -0
  715. /package/{lib → dist/mjs}/data-structures/stack/stack.d.ts +0 -0
  716. /package/{lib → dist/mjs}/data-structures/tree/index.d.ts +0 -0
  717. /package/{lib → dist/mjs}/data-structures/tree/tree.d.ts +0 -0
  718. /package/{lib → dist/mjs}/data-structures/trie/index.d.ts +0 -0
  719. /package/{lib → dist/mjs}/data-structures/trie/trie.d.ts +0 -0
  720. /package/{lib → dist/mjs}/index.d.ts +0 -0
  721. /package/{lib → dist/mjs}/interfaces/binary-tree.d.ts +0 -0
  722. /package/{lib → dist/mjs}/interfaces/doubly-linked-list.d.ts +0 -0
  723. /package/{lib → dist/mjs}/interfaces/graph.d.ts +0 -0
  724. /package/{lib → dist/mjs}/interfaces/heap.d.ts +0 -0
  725. /package/{lib → dist/mjs}/interfaces/index.d.ts +0 -0
  726. /package/{lib → dist/mjs}/interfaces/navigator.d.ts +0 -0
  727. /package/{lib → dist/mjs}/interfaces/priority-queue.d.ts +0 -0
  728. /package/{lib → dist/mjs}/interfaces/segment-tree.d.ts +0 -0
  729. /package/{lib → dist/mjs}/interfaces/singly-linked-list.d.ts +0 -0
  730. /package/{lib → dist/mjs}/types/data-structures/binary-tree/avl-tree.d.ts +0 -0
  731. /package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  732. /package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-tree.d.ts +0 -0
  733. /package/{lib → dist/mjs}/types/data-structures/binary-tree/bst.d.ts +0 -0
  734. /package/{lib → dist/mjs}/types/data-structures/binary-tree/index.d.ts +0 -0
  735. /package/{lib → dist/mjs}/types/data-structures/binary-tree/rb-tree.d.ts +0 -0
  736. /package/{lib → dist/mjs}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
  737. /package/{lib → dist/mjs}/types/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  738. /package/{lib → dist/mjs}/types/data-structures/graph/abstract-graph.d.ts +0 -0
  739. /package/{lib → dist/mjs}/types/data-structures/graph/directed-graph.d.ts +0 -0
  740. /package/{lib → dist/mjs}/types/data-structures/graph/index.d.ts +0 -0
  741. /package/{lib → dist/mjs}/types/data-structures/graph/map-graph.d.ts +0 -0
  742. /package/{lib → dist/mjs}/types/data-structures/graph/undirected-graph.d.ts +0 -0
  743. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-map.d.ts +0 -0
  744. /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-set.d.ts +0 -0
  745. /package/{lib → dist/mjs}/types/data-structures/hash/hash-map.d.ts +0 -0
  746. /package/{lib → dist/mjs}/types/data-structures/hash/hash-table.d.ts +0 -0
  747. /package/{lib → dist/mjs}/types/data-structures/hash/index.d.ts +0 -0
  748. /package/{lib → dist/mjs}/types/data-structures/hash/tree-map.d.ts +0 -0
  749. /package/{lib → dist/mjs}/types/data-structures/hash/tree-set.d.ts +0 -0
  750. /package/{lib → dist/mjs}/types/data-structures/heap/heap.d.ts +0 -0
  751. /package/{lib → dist/mjs}/types/data-structures/heap/index.d.ts +0 -0
  752. /package/{lib → dist/mjs}/types/data-structures/heap/max-heap.d.ts +0 -0
  753. /package/{lib → dist/mjs}/types/data-structures/heap/min-heap.d.ts +0 -0
  754. /package/{lib → dist/mjs}/types/data-structures/index.d.ts +0 -0
  755. /package/{lib → dist/mjs}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  756. /package/{lib → dist/mjs}/types/data-structures/linked-list/index.d.ts +0 -0
  757. /package/{lib → dist/mjs}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  758. /package/{lib → dist/mjs}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  759. /package/{lib → dist/mjs}/types/data-structures/matrix/index.d.ts +0 -0
  760. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix.d.ts +0 -0
  761. /package/{lib → dist/mjs}/types/data-structures/matrix/matrix2d.d.ts +0 -0
  762. /package/{lib → dist/mjs}/types/data-structures/matrix/navigator.d.ts +0 -0
  763. /package/{lib → dist/mjs}/types/data-structures/matrix/vector2d.d.ts +0 -0
  764. /package/{lib → dist/mjs}/types/data-structures/priority-queue/index.d.ts +0 -0
  765. /package/{lib → dist/mjs}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  766. /package/{lib → dist/mjs}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  767. /package/{lib → dist/mjs}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
  768. /package/{lib → dist/mjs}/types/data-structures/queue/deque.d.ts +0 -0
  769. /package/{lib → dist/mjs}/types/data-structures/queue/index.d.ts +0 -0
  770. /package/{lib → dist/mjs}/types/data-structures/queue/queue.d.ts +0 -0
  771. /package/{lib → dist/mjs}/types/data-structures/stack/index.d.ts +0 -0
  772. /package/{lib → dist/mjs}/types/data-structures/stack/stack.d.ts +0 -0
  773. /package/{lib → dist/mjs}/types/data-structures/tree/index.d.ts +0 -0
  774. /package/{lib → dist/mjs}/types/data-structures/tree/tree.d.ts +0 -0
  775. /package/{lib → dist/mjs}/types/data-structures/trie/index.d.ts +0 -0
  776. /package/{lib → dist/mjs}/types/data-structures/trie/trie.d.ts +0 -0
  777. /package/{lib → dist/mjs}/types/helpers.d.ts +0 -0
  778. /package/{lib → dist/mjs}/types/index.d.ts +0 -0
  779. /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
  780. /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
  781. /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
  782. /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
  783. /package/{lib → dist/mjs}/utils/utils.d.ts +0 -0
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * data-structure-typed
3
4
  *
@@ -5,15 +6,29 @@
5
6
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
7
  * @license MIT License
7
8
  */
8
- import { FamilyPosition, IterationType } from '../../types';
9
- import { trampoline } from '../../utils';
10
- import { Queue } from '../queue';
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BinaryTree = exports.BinaryTreeNode = void 0;
11
+ const types_1 = require("../../types");
12
+ const utils_1 = require("../../utils");
13
+ const queue_1 = require("../queue");
11
14
  /**
12
15
  * Represents a node in a binary tree.
13
16
  * @template V - The type of data stored in the node.
14
17
  * @template FAMILY - The type of the family relationship in the binary tree.
15
18
  */
16
- export class BinaryTreeNode {
19
+ class BinaryTreeNode {
20
+ /**
21
+ * The key associated with the node.
22
+ */
23
+ key;
24
+ /**
25
+ * The value stored in the node.
26
+ */
27
+ val;
28
+ /**
29
+ * The parent node of the current node.
30
+ */
31
+ parent;
17
32
  /**
18
33
  * Creates a new instance of BinaryTreeNode.
19
34
  * @param {BinaryTreeNodeKey} key - The key associated with the node.
@@ -23,6 +38,7 @@ export class BinaryTreeNode {
23
38
  this.key = key;
24
39
  this.val = val;
25
40
  }
41
+ _left;
26
42
  /**
27
43
  * Get the left child node.
28
44
  */
@@ -39,6 +55,7 @@ export class BinaryTreeNode {
39
55
  }
40
56
  this._left = v;
41
57
  }
58
+ _right;
42
59
  /**
43
60
  * Get the right child node.
44
61
  */
@@ -64,66 +81,59 @@ export class BinaryTreeNode {
64
81
  if (that.parent) {
65
82
  if (that.parent.left === that) {
66
83
  if (that.left || that.right) {
67
- return FamilyPosition.ROOT_LEFT;
84
+ return types_1.FamilyPosition.ROOT_LEFT;
68
85
  }
69
86
  else {
70
- return FamilyPosition.LEFT;
87
+ return types_1.FamilyPosition.LEFT;
71
88
  }
72
89
  }
73
90
  else if (that.parent.right === that) {
74
91
  if (that.left || that.right) {
75
- return FamilyPosition.ROOT_RIGHT;
92
+ return types_1.FamilyPosition.ROOT_RIGHT;
76
93
  }
77
94
  else {
78
- return FamilyPosition.RIGHT;
95
+ return types_1.FamilyPosition.RIGHT;
79
96
  }
80
97
  }
81
98
  else {
82
- return FamilyPosition.MAL_NODE;
99
+ return types_1.FamilyPosition.MAL_NODE;
83
100
  }
84
101
  }
85
102
  else {
86
103
  if (that.left || that.right) {
87
- return FamilyPosition.ROOT;
104
+ return types_1.FamilyPosition.ROOT;
88
105
  }
89
106
  else {
90
- return FamilyPosition.ISOLATED;
107
+ return types_1.FamilyPosition.ISOLATED;
91
108
  }
92
109
  }
93
110
  }
94
111
  }
112
+ exports.BinaryTreeNode = BinaryTreeNode;
95
113
  /**
96
114
  * Represents a binary tree data structure.
97
115
  * @template N - The type of the binary tree's nodes.
98
116
  */
99
- export class BinaryTree {
117
+ class BinaryTree {
118
+ _loopType = types_1.IterationType.ITERATIVE;
100
119
  /**
101
120
  * Creates a new instance of BinaryTree.
102
121
  * @param {BinaryTreeOptions} [options] - The options for the binary tree.
103
122
  */
104
123
  constructor(options) {
105
- this._loopType = IterationType.ITERATIVE;
106
- this._root = null;
107
- this._size = 0;
108
- /**
109
- * Time complexity is O(n)
110
- * Space complexity of Iterative dfs equals to recursive dfs which is O(n) because of the stack
111
- * The Morris algorithm only modifies the tree's structure during traversal; once the traversal is complete,
112
- * the tree's structure should be restored to its original state to maintain the tree's integrity.
113
- * This is because the purpose of the Morris algorithm is to save space rather than permanently alter the tree's shape.
114
- */
115
- this._defaultCallbackByKey = node => node.key;
116
124
  if (options !== undefined) {
117
- const { iterationType = IterationType.ITERATIVE } = options;
125
+ const { iterationType = types_1.IterationType.ITERATIVE } = options;
118
126
  this._loopType = iterationType;
119
127
  }
120
128
  }
129
+ _root = null;
121
130
  /**
122
131
  * Get the root node of the binary tree.
123
132
  */
124
133
  get root() {
125
134
  return this._root;
126
135
  }
136
+ _size = 0;
127
137
  /**
128
138
  * Get the number of nodes in the binary tree.
129
139
  */
@@ -174,7 +184,7 @@ export class BinaryTree {
174
184
  */
175
185
  add(keyOrNode, val) {
176
186
  const _bfs = (root, newNode) => {
177
- const queue = new Queue([root]);
187
+ const queue = new queue_1.Queue([root]);
178
188
  while (queue.size > 0) {
179
189
  const cur = queue.shift();
180
190
  if (cur) {
@@ -251,7 +261,7 @@ export class BinaryTree {
251
261
  inserted.push(this.add(null));
252
262
  continue;
253
263
  }
254
- const val = values === null || values === void 0 ? void 0 : values[i];
264
+ const val = values?.[i];
255
265
  inserted.push(this.add(keyOrNode, val));
256
266
  }
257
267
  return inserted;
@@ -284,7 +294,7 @@ export class BinaryTree {
284
294
  const curr = typeof nodeOrKey === 'number' ? this.get(nodeOrKey) : nodeOrKey;
285
295
  if (!curr)
286
296
  return bstDeletedResult;
287
- const parent = (curr === null || curr === void 0 ? void 0 : curr.parent) ? curr.parent : null;
297
+ const parent = curr?.parent ? curr.parent : null;
288
298
  let needBalanced = null, orgCurrent = curr;
289
299
  if (!curr.left) {
290
300
  if (!parent) {
@@ -293,10 +303,10 @@ export class BinaryTree {
293
303
  }
294
304
  else {
295
305
  const { familyPosition: fp } = curr;
296
- if (fp === FamilyPosition.LEFT || fp === FamilyPosition.ROOT_LEFT) {
306
+ if (fp === types_1.FamilyPosition.LEFT || fp === types_1.FamilyPosition.ROOT_LEFT) {
297
307
  parent.left = curr.right;
298
308
  }
299
- else if (fp === FamilyPosition.RIGHT || fp === FamilyPosition.ROOT_RIGHT) {
309
+ else if (fp === types_1.FamilyPosition.RIGHT || fp === types_1.FamilyPosition.ROOT_RIGHT) {
300
310
  parent.right = curr.right;
301
311
  }
302
312
  needBalanced = parent;
@@ -338,7 +348,7 @@ export class BinaryTree {
338
348
  if (typeof beginRoot === 'number')
339
349
  beginRoot = this.get(beginRoot);
340
350
  let depth = 0;
341
- while (distNode === null || distNode === void 0 ? void 0 : distNode.parent) {
351
+ while (distNode?.parent) {
342
352
  if (distNode === beginRoot) {
343
353
  return depth;
344
354
  }
@@ -364,7 +374,7 @@ export class BinaryTree {
364
374
  beginRoot = this.get(beginRoot);
365
375
  if (!beginRoot)
366
376
  return -1;
367
- if (iterationType === IterationType.RECURSIVE) {
377
+ if (iterationType === types_1.IterationType.RECURSIVE) {
368
378
  const _getMaxHeight = (cur) => {
369
379
  if (!cur)
370
380
  return -1;
@@ -404,10 +414,9 @@ export class BinaryTree {
404
414
  * @returns The function `getMinHeight` returns the minimum height of a binary tree.
405
415
  */
406
416
  getMinHeight(beginRoot = this.root, iterationType = this.iterationType) {
407
- var _a, _b, _c;
408
417
  if (!beginRoot)
409
418
  return -1;
410
- if (iterationType === IterationType.RECURSIVE) {
419
+ if (iterationType === types_1.IterationType.RECURSIVE) {
411
420
  const _getMinHeight = (cur) => {
412
421
  if (!cur)
413
422
  return 0;
@@ -433,8 +442,8 @@ export class BinaryTree {
433
442
  if (!node.right || last === node.right) {
434
443
  node = stack.pop();
435
444
  if (node) {
436
- const leftMinHeight = node.left ? (_a = depths.get(node.left)) !== null && _a !== void 0 ? _a : -1 : -1;
437
- const rightMinHeight = node.right ? (_b = depths.get(node.right)) !== null && _b !== void 0 ? _b : -1 : -1;
445
+ const leftMinHeight = node.left ? depths.get(node.left) ?? -1 : -1;
446
+ const rightMinHeight = node.right ? depths.get(node.right) ?? -1 : -1;
438
447
  depths.set(node, 1 + Math.min(leftMinHeight, rightMinHeight));
439
448
  last = node;
440
449
  node = null;
@@ -444,7 +453,7 @@ export class BinaryTree {
444
453
  node = node.right;
445
454
  }
446
455
  }
447
- return (_c = depths.get(beginRoot)) !== null && _c !== void 0 ? _c : -1;
456
+ return depths.get(beginRoot) ?? -1;
448
457
  }
449
458
  }
450
459
  /**
@@ -482,7 +491,7 @@ export class BinaryTree {
482
491
  if (!beginRoot)
483
492
  return [];
484
493
  const ans = [];
485
- if (iterationType === IterationType.RECURSIVE) {
494
+ if (iterationType === types_1.IterationType.RECURSIVE) {
486
495
  const _traverse = (cur) => {
487
496
  if (callback(cur) === nodeProperty) {
488
497
  ans.push(cur);
@@ -497,7 +506,7 @@ export class BinaryTree {
497
506
  _traverse(beginRoot);
498
507
  }
499
508
  else {
500
- const queue = new Queue([beginRoot]);
509
+ const queue = new queue_1.Queue([beginRoot]);
501
510
  while (queue.size > 0) {
502
511
  const cur = queue.shift();
503
512
  if (cur) {
@@ -550,9 +559,8 @@ export class BinaryTree {
550
559
  * @returns either the found node (of type N) or null if no node is found.
551
560
  */
552
561
  get(nodeProperty, callback = this._defaultCallbackByKey, beginRoot = this.root, iterationType = this.iterationType) {
553
- var _a;
554
562
  // TODO may support finding node by value equal
555
- return (_a = this.getNodes(nodeProperty, callback, true, beginRoot, iterationType)[0]) !== null && _a !== void 0 ? _a : null;
563
+ return this.getNodes(nodeProperty, callback, true, beginRoot, iterationType)[0] ?? null;
556
564
  }
557
565
  /**
558
566
  * The function `getPathToRoot` returns an array of nodes starting from a given node and traversing
@@ -592,7 +600,7 @@ export class BinaryTree {
592
600
  beginRoot = this.get(beginRoot);
593
601
  if (!beginRoot)
594
602
  return beginRoot;
595
- if (iterationType === IterationType.RECURSIVE) {
603
+ if (iterationType === types_1.IterationType.RECURSIVE) {
596
604
  const _traverse = (cur) => {
597
605
  if (!cur.left)
598
606
  return cur;
@@ -602,7 +610,7 @@ export class BinaryTree {
602
610
  }
603
611
  else {
604
612
  // Indirect implementation of iteration using tail recursion optimization
605
- const _traverse = trampoline((cur) => {
613
+ const _traverse = (0, utils_1.trampoline)((cur) => {
606
614
  if (!cur.left)
607
615
  return cur;
608
616
  return _traverse.cont(cur.left);
@@ -625,7 +633,7 @@ export class BinaryTree {
625
633
  // TODO support get right most by passing key in
626
634
  if (!beginRoot)
627
635
  return beginRoot;
628
- if (iterationType === IterationType.RECURSIVE) {
636
+ if (iterationType === types_1.IterationType.RECURSIVE) {
629
637
  const _traverse = (cur) => {
630
638
  if (!cur.right)
631
639
  return cur;
@@ -635,7 +643,7 @@ export class BinaryTree {
635
643
  }
636
644
  else {
637
645
  // Indirect implementation of iteration using tail recursion optimization
638
- const _traverse = trampoline((cur) => {
646
+ const _traverse = (0, utils_1.trampoline)((cur) => {
639
647
  if (!cur.right)
640
648
  return cur;
641
649
  return _traverse.cont(cur.right);
@@ -656,7 +664,7 @@ export class BinaryTree {
656
664
  // TODO there is a bug
657
665
  if (!beginRoot)
658
666
  return true;
659
- if (iterationType === IterationType.RECURSIVE) {
667
+ if (iterationType === types_1.IterationType.RECURSIVE) {
660
668
  const dfs = (cur, min, max) => {
661
669
  if (!cur)
662
670
  return true;
@@ -716,7 +724,7 @@ export class BinaryTree {
716
724
  const ans = [];
717
725
  if (!beginRoot)
718
726
  return ans;
719
- if (iterationType === IterationType.RECURSIVE) {
727
+ if (iterationType === types_1.IterationType.RECURSIVE) {
720
728
  const _traverse = (cur) => {
721
729
  ans.push(callback(cur));
722
730
  cur.left && _traverse(cur.left);
@@ -750,11 +758,11 @@ export class BinaryTree {
750
758
  * iteration used in the depth-first search algorithm. It can have two possible values:
751
759
  * @returns The function `dfs` returns an array of `MapCallbackReturn<N>` values.
752
760
  */
753
- dfs(callback = this._defaultCallbackByKey, pattern = 'in', beginRoot = this.root, iterationType = IterationType.ITERATIVE) {
761
+ dfs(callback = this._defaultCallbackByKey, pattern = 'in', beginRoot = this.root, iterationType = types_1.IterationType.ITERATIVE) {
754
762
  if (!beginRoot)
755
763
  return [];
756
764
  const ans = [];
757
- if (iterationType === IterationType.RECURSIVE) {
765
+ if (iterationType === types_1.IterationType.RECURSIVE) {
758
766
  const _traverse = (node) => {
759
767
  switch (pattern) {
760
768
  case 'in':
@@ -841,7 +849,7 @@ export class BinaryTree {
841
849
  if (!beginRoot)
842
850
  return [];
843
851
  const ans = [];
844
- if (iterationType === IterationType.RECURSIVE) {
852
+ if (iterationType === types_1.IterationType.RECURSIVE) {
845
853
  const _recursive = (node, level) => {
846
854
  callback && ans.push(callback(node, withLevel ? level : undefined));
847
855
  if (node.left)
@@ -1000,6 +1008,14 @@ export class BinaryTree {
1000
1008
  }
1001
1009
  return destNode;
1002
1010
  }
1011
+ /**
1012
+ * Time complexity is O(n)
1013
+ * Space complexity of Iterative dfs equals to recursive dfs which is O(n) because of the stack
1014
+ * The Morris algorithm only modifies the tree's structure during traversal; once the traversal is complete,
1015
+ * the tree's structure should be restored to its original state to maintain the tree's integrity.
1016
+ * This is because the purpose of the Morris algorithm is to save space rather than permanently alter the tree's shape.
1017
+ */
1018
+ _defaultCallbackByKey = node => node.key;
1003
1019
  /**
1004
1020
  * The function `_addTo` adds a new node to a binary tree if there is an available position.
1005
1021
  * @param {N | null} newNode - The `newNode` parameter represents the node that you want to add to
@@ -1058,3 +1074,4 @@ export class BinaryTree {
1058
1074
  this._size = v;
1059
1075
  }
1060
1076
  }
1077
+ exports.BinaryTree = BinaryTree;
@@ -1,12 +1,16 @@
1
- import { CP, IterationType } from '../../types';
2
- import { BinaryTree, BinaryTreeNode } from './binary-tree';
3
- import { Queue } from '../queue';
4
- export class BSTNode extends BinaryTreeNode {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BST = exports.BSTNode = void 0;
4
+ const types_1 = require("../../types");
5
+ const binary_tree_1 = require("./binary-tree");
6
+ const queue_1 = require("../queue");
7
+ class BSTNode extends binary_tree_1.BinaryTreeNode {
5
8
  constructor(key, val) {
6
9
  super(key, val);
7
10
  }
8
11
  }
9
- export class BST extends BinaryTree {
12
+ exports.BSTNode = BSTNode;
13
+ class BST extends binary_tree_1.BinaryTree {
10
14
  /**
11
15
  * The constructor function initializes a binary search tree object with an optional comparator
12
16
  * function.
@@ -15,7 +19,6 @@ export class BST extends BinaryTree {
15
19
  */
16
20
  constructor(options) {
17
21
  super(options);
18
- this._comparator = (a, b) => a - b;
19
22
  if (options !== undefined) {
20
23
  const { comparator } = options;
21
24
  if (comparator !== undefined) {
@@ -67,7 +70,7 @@ export class BST extends BinaryTree {
67
70
  let traversing = true;
68
71
  while (traversing) {
69
72
  if (cur !== null && newNode !== null) {
70
- if (this._compare(cur.key, newNode.key) === CP.eq) {
73
+ if (this._compare(cur.key, newNode.key) === types_1.CP.eq) {
71
74
  if (newNode) {
72
75
  cur.val = newNode.val;
73
76
  }
@@ -75,7 +78,7 @@ export class BST extends BinaryTree {
75
78
  traversing = false;
76
79
  inserted = cur;
77
80
  }
78
- else if (this._compare(cur.key, newNode.key) === CP.gt) {
81
+ else if (this._compare(cur.key, newNode.key) === types_1.CP.gt) {
79
82
  // Traverse left of the node
80
83
  if (cur.left === undefined) {
81
84
  if (newNode) {
@@ -93,7 +96,7 @@ export class BST extends BinaryTree {
93
96
  cur = cur.left;
94
97
  }
95
98
  }
96
- else if (this._compare(cur.key, newNode.key) === CP.lt) {
99
+ else if (this._compare(cur.key, newNode.key) === types_1.CP.lt) {
97
100
  // Traverse right of the node
98
101
  if (cur.right === undefined) {
99
102
  if (newNode) {
@@ -141,7 +144,7 @@ export class BST extends BinaryTree {
141
144
  return super.addMany(keysOrNodes, data);
142
145
  }
143
146
  const inserted = [];
144
- const combinedArr = keysOrNodes.map((value, index) => [value, data === null || data === void 0 ? void 0 : data[index]]);
147
+ const combinedArr = keysOrNodes.map((value, index) => [value, data?.[index]]);
145
148
  let sorted = [];
146
149
  function isNodeOrNullTuple(arr) {
147
150
  for (const [keyOrNode] of arr)
@@ -171,10 +174,10 @@ export class BST extends BinaryTree {
171
174
  if (arr.length === 0)
172
175
  return;
173
176
  const mid = Math.floor((arr.length - 1) / 2);
174
- const newNode = this.add(arr[mid], data === null || data === void 0 ? void 0 : data[mid]);
177
+ const newNode = this.add(arr[mid], data?.[mid]);
175
178
  inserted.push(newNode);
176
- recursive(arr.slice(0, mid), data === null || data === void 0 ? void 0 : data.slice(0, mid));
177
- recursive(arr.slice(mid + 1), data === null || data === void 0 ? void 0 : data.slice(mid + 1));
179
+ recursive(arr.slice(0, mid), data?.slice(0, mid));
180
+ recursive(arr.slice(mid + 1), data?.slice(mid + 1));
178
181
  };
179
182
  const iterative = () => {
180
183
  const n = sorted.length;
@@ -185,7 +188,7 @@ export class BST extends BinaryTree {
185
188
  const [l, r] = popped;
186
189
  if (l <= r) {
187
190
  const m = l + Math.floor((r - l) / 2);
188
- const newNode = this.add(sortedKeysOrNodes[m], sortedData === null || sortedData === void 0 ? void 0 : sortedData[m]);
191
+ const newNode = this.add(sortedKeysOrNodes[m], sortedData?.[m]);
189
192
  inserted.push(newNode);
190
193
  stack.push([m + 1, r]);
191
194
  stack.push([l, m - 1]);
@@ -193,7 +196,7 @@ export class BST extends BinaryTree {
193
196
  }
194
197
  }
195
198
  };
196
- if (iterationType === IterationType.RECURSIVE) {
199
+ if (iterationType === types_1.IterationType.RECURSIVE) {
197
200
  recursive(sortedKeysOrNodes, sortedData);
198
201
  }
199
202
  else {
@@ -220,8 +223,7 @@ export class BST extends BinaryTree {
220
223
  * matching node is found.
221
224
  */
222
225
  get(nodeProperty, callback = this._defaultCallbackByKey, beginRoot = this.root, iterationType = this.iterationType) {
223
- var _a;
224
- return (_a = this.getNodes(nodeProperty, callback, true, beginRoot, iterationType)[0]) !== null && _a !== void 0 ? _a : null;
226
+ return this.getNodes(nodeProperty, callback, true, beginRoot, iterationType)[0] ?? null;
225
227
  }
226
228
  /**
227
229
  * The function `lastKey` returns the key of the rightmost node if the comparison result is less
@@ -239,13 +241,12 @@ export class BST extends BinaryTree {
239
241
  * rightmost node otherwise. If no node is found, it returns 0.
240
242
  */
241
243
  lastKey(beginRoot = this.root, iterationType = this.iterationType) {
242
- var _a, _b, _c, _d, _e, _f;
243
- if (this._compare(0, 1) === CP.lt)
244
- return (_b = (_a = this.getRightMost(beginRoot, iterationType)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : 0;
245
- else if (this._compare(0, 1) === CP.gt)
246
- return (_d = (_c = this.getLeftMost(beginRoot, iterationType)) === null || _c === void 0 ? void 0 : _c.key) !== null && _d !== void 0 ? _d : 0;
244
+ if (this._compare(0, 1) === types_1.CP.lt)
245
+ return this.getRightMost(beginRoot, iterationType)?.key ?? 0;
246
+ else if (this._compare(0, 1) === types_1.CP.gt)
247
+ return this.getLeftMost(beginRoot, iterationType)?.key ?? 0;
247
248
  else
248
- return (_f = (_e = this.getRightMost(beginRoot, iterationType)) === null || _e === void 0 ? void 0 : _e.key) !== null && _f !== void 0 ? _f : 0;
249
+ return this.getRightMost(beginRoot, iterationType)?.key ?? 0;
249
250
  }
250
251
  /**
251
252
  * The function `getNodes` retrieves nodes from a binary tree based on a given node property or key,
@@ -272,7 +273,7 @@ export class BST extends BinaryTree {
272
273
  if (!beginRoot)
273
274
  return [];
274
275
  const ans = [];
275
- if (iterationType === IterationType.RECURSIVE) {
276
+ if (iterationType === types_1.IterationType.RECURSIVE) {
276
277
  const _traverse = (cur) => {
277
278
  const callbackResult = callback(cur);
278
279
  if (callbackResult === nodeProperty) {
@@ -284,9 +285,9 @@ export class BST extends BinaryTree {
284
285
  return;
285
286
  // TODO potential bug
286
287
  if (callback === this._defaultCallbackByKey) {
287
- if (this._compare(cur.key, nodeProperty) === CP.gt)
288
+ if (this._compare(cur.key, nodeProperty) === types_1.CP.gt)
288
289
  cur.left && _traverse(cur.left);
289
- if (this._compare(cur.key, nodeProperty) === CP.lt)
290
+ if (this._compare(cur.key, nodeProperty) === types_1.CP.lt)
290
291
  cur.right && _traverse(cur.right);
291
292
  }
292
293
  else {
@@ -297,7 +298,7 @@ export class BST extends BinaryTree {
297
298
  _traverse(beginRoot);
298
299
  }
299
300
  else {
300
- const queue = new Queue([beginRoot]);
301
+ const queue = new queue_1.Queue([beginRoot]);
301
302
  while (queue.size > 0) {
302
303
  const cur = queue.shift();
303
304
  if (cur) {
@@ -309,9 +310,9 @@ export class BST extends BinaryTree {
309
310
  }
310
311
  // TODO potential bug
311
312
  if (callback === this._defaultCallbackByKey) {
312
- if (this._compare(cur.key, nodeProperty) === CP.gt)
313
+ if (this._compare(cur.key, nodeProperty) === types_1.CP.gt)
313
314
  cur.left && queue.push(cur.left);
314
- if (this._compare(cur.key, nodeProperty) === CP.lt)
315
+ if (this._compare(cur.key, nodeProperty) === types_1.CP.lt)
315
316
  cur.right && queue.push(cur.right);
316
317
  }
317
318
  else {
@@ -341,7 +342,7 @@ export class BST extends BinaryTree {
341
342
  * done recursively or iteratively. It can have two possible values:
342
343
  * @returns The function `lesserOrGreaterTraverse` returns an array of `MapCallbackReturn<N>`.
343
344
  */
344
- lesserOrGreaterTraverse(callback = this._defaultCallbackByKey, lesserOrGreater = CP.lt, targetNode = this.root, iterationType = this.iterationType) {
345
+ lesserOrGreaterTraverse(callback = this._defaultCallbackByKey, lesserOrGreater = types_1.CP.lt, targetNode = this.root, iterationType = this.iterationType) {
345
346
  if (typeof targetNode === 'number')
346
347
  targetNode = this.get(targetNode);
347
348
  const ans = [];
@@ -350,7 +351,7 @@ export class BST extends BinaryTree {
350
351
  const targetKey = targetNode.key;
351
352
  if (!this.root)
352
353
  return ans;
353
- if (iterationType === IterationType.RECURSIVE) {
354
+ if (iterationType === types_1.IterationType.RECURSIVE) {
354
355
  const _traverse = (cur) => {
355
356
  const compared = this._compare(cur.key, targetKey);
356
357
  if (compared === lesserOrGreater)
@@ -366,7 +367,7 @@ export class BST extends BinaryTree {
366
367
  return ans;
367
368
  }
368
369
  else {
369
- const queue = new Queue([this.root]);
370
+ const queue = new queue_1.Queue([this.root]);
370
371
  while (queue.size > 0) {
371
372
  const cur = queue.shift();
372
373
  if (cur) {
@@ -404,7 +405,7 @@ export class BST extends BinaryTree {
404
405
  this.clear();
405
406
  if (sorted.length < 1)
406
407
  return false;
407
- if (iterationType === IterationType.RECURSIVE) {
408
+ if (iterationType === types_1.IterationType.RECURSIVE) {
408
409
  const buildBalanceBST = (l, r) => {
409
410
  if (l > r)
410
411
  return;
@@ -442,11 +443,10 @@ export class BST extends BinaryTree {
442
443
  * @returns a boolean value.
443
444
  */
444
445
  isAVLBalanced(iterationType = this.iterationType) {
445
- var _a, _b;
446
446
  if (!this.root)
447
447
  return true;
448
448
  let balanced = true;
449
- if (iterationType === IterationType.RECURSIVE) {
449
+ if (iterationType === types_1.IterationType.RECURSIVE) {
450
450
  const _height = (cur) => {
451
451
  if (!cur)
452
452
  return 0;
@@ -471,8 +471,8 @@ export class BST extends BinaryTree {
471
471
  if (!node.right || last === node.right) {
472
472
  node = stack.pop();
473
473
  if (node) {
474
- const left = node.left ? (_a = depths.get(node.left)) !== null && _a !== void 0 ? _a : -1 : -1;
475
- const right = node.right ? (_b = depths.get(node.right)) !== null && _b !== void 0 ? _b : -1 : -1;
474
+ const left = node.left ? depths.get(node.left) ?? -1 : -1;
475
+ const right = node.right ? depths.get(node.right) ?? -1 : -1;
476
476
  if (Math.abs(left - right) > 1)
477
477
  return false;
478
478
  depths.set(node, 1 + Math.max(left, right));
@@ -487,6 +487,7 @@ export class BST extends BinaryTree {
487
487
  }
488
488
  return balanced;
489
489
  }
490
+ _comparator = (a, b) => a - b;
490
491
  /**
491
492
  * The function compares two values using a comparator function and returns whether the first value
492
493
  * is greater than, less than, or equal to the second value.
@@ -498,10 +499,11 @@ export class BST extends BinaryTree {
498
499
  _compare(a, b) {
499
500
  const compared = this._comparator(a, b);
500
501
  if (compared > 0)
501
- return CP.gt;
502
+ return types_1.CP.gt;
502
503
  else if (compared < 0)
503
- return CP.lt;
504
+ return types_1.CP.lt;
504
505
  else
505
- return CP.eq;
506
+ return types_1.CP.eq;
506
507
  }
507
508
  }
509
+ exports.BST = BST;
@@ -0,0 +1,23 @@
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("./binary-indexed-tree"), exports);
20
+ __exportStar(require("./segment-tree"), exports);
21
+ __exportStar(require("./avl-tree"), exports);
22
+ __exportStar(require("./rb-tree"), exports);
23
+ __exportStar(require("./tree-multiset"), exports);
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RBTree = exports.RBTreeNode = void 0;
4
+ const types_1 = require("../../types");
5
+ const bst_1 = require("./bst");
6
+ class RBTreeNode extends bst_1.BSTNode {
7
+ constructor(key, val) {
8
+ super(key, val);
9
+ this._color = types_1.RBColor.RED;
10
+ }
11
+ _color;
12
+ get color() {
13
+ return this._color;
14
+ }
15
+ set color(value) {
16
+ this._color = value;
17
+ }
18
+ }
19
+ exports.RBTreeNode = RBTreeNode;
20
+ class RBTree extends bst_1.BST {
21
+ constructor(options) {
22
+ super(options);
23
+ }
24
+ createNode(key, val) {
25
+ return new RBTreeNode(key, val);
26
+ }
27
+ }
28
+ exports.RBTree = RBTree;