data-structure-typed 1.41.5 → 1.41.6

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 (774) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +15 -535
  3. package/benchmark/report.html +14 -12
  4. package/benchmark/report.json +117 -117
  5. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/avl-tree.d.ts +1 -1
  6. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/avl-tree.js +2 -2
  7. package/dist/cjs/src/data-structures/binary-tree/avl-tree.js.map +1 -0
  8. package/dist/cjs/src/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  9. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/binary-tree.d.ts +4 -3
  10. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/binary-tree.js +19 -18
  11. package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +1 -0
  12. package/dist/{mjs → cjs/src}/data-structures/binary-tree/bst.d.ts +1 -20
  13. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/bst.js +5 -27
  14. package/dist/cjs/src/data-structures/binary-tree/bst.js.map +1 -0
  15. package/dist/cjs/src/data-structures/binary-tree/index.js.map +1 -0
  16. package/dist/cjs/src/data-structures/binary-tree/rb-tree.js.map +1 -0
  17. package/dist/cjs/src/data-structures/binary-tree/segment-tree.js.map +1 -0
  18. package/dist/{mjs → cjs/src}/data-structures/binary-tree/tree-multiset.d.ts +1 -1
  19. package/dist/cjs/{data-structures → src/data-structures}/binary-tree/tree-multiset.js +2 -2
  20. package/dist/cjs/src/data-structures/binary-tree/tree-multiset.js.map +1 -0
  21. package/dist/cjs/src/data-structures/graph/abstract-graph.js.map +1 -0
  22. package/dist/cjs/src/data-structures/graph/directed-graph.js.map +1 -0
  23. package/dist/cjs/src/data-structures/graph/index.js.map +1 -0
  24. package/dist/cjs/src/data-structures/graph/map-graph.js.map +1 -0
  25. package/dist/cjs/src/data-structures/graph/undirected-graph.js.map +1 -0
  26. package/dist/cjs/src/data-structures/hash/coordinate-map.js.map +1 -0
  27. package/dist/cjs/src/data-structures/hash/coordinate-set.js.map +1 -0
  28. package/dist/cjs/src/data-structures/hash/hash-map.js.map +1 -0
  29. package/dist/cjs/src/data-structures/hash/hash-table.js.map +1 -0
  30. package/dist/cjs/src/data-structures/hash/index.js.map +1 -0
  31. package/dist/cjs/src/data-structures/hash/tree-map.js.map +1 -0
  32. package/dist/cjs/src/data-structures/hash/tree-set.js.map +1 -0
  33. package/dist/cjs/src/data-structures/heap/heap.js.map +1 -0
  34. package/dist/cjs/src/data-structures/heap/index.js.map +1 -0
  35. package/dist/cjs/src/data-structures/heap/max-heap.js.map +1 -0
  36. package/dist/cjs/src/data-structures/heap/min-heap.js.map +1 -0
  37. package/dist/cjs/src/data-structures/index.js.map +1 -0
  38. package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  39. package/dist/cjs/src/data-structures/linked-list/index.js.map +1 -0
  40. package/dist/cjs/src/data-structures/linked-list/singly-linked-list.js.map +1 -0
  41. package/dist/cjs/src/data-structures/linked-list/skip-linked-list.js.map +1 -0
  42. package/dist/cjs/src/data-structures/matrix/index.js.map +1 -0
  43. package/dist/cjs/src/data-structures/matrix/matrix.js.map +1 -0
  44. package/dist/cjs/src/data-structures/matrix/matrix2d.js.map +1 -0
  45. package/dist/cjs/src/data-structures/matrix/navigator.js.map +1 -0
  46. package/dist/cjs/src/data-structures/matrix/vector2d.js.map +1 -0
  47. package/dist/cjs/src/data-structures/priority-queue/index.js.map +1 -0
  48. package/dist/cjs/src/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  49. package/dist/cjs/src/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  50. package/dist/cjs/src/data-structures/priority-queue/priority-queue.js.map +1 -0
  51. package/dist/cjs/src/data-structures/queue/deque.js.map +1 -0
  52. package/dist/cjs/src/data-structures/queue/index.js.map +1 -0
  53. package/dist/cjs/src/data-structures/queue/queue.js.map +1 -0
  54. package/dist/cjs/src/data-structures/stack/index.js.map +1 -0
  55. package/dist/cjs/src/data-structures/stack/stack.js.map +1 -0
  56. package/dist/cjs/src/data-structures/tree/index.js.map +1 -0
  57. package/dist/cjs/src/data-structures/tree/tree.js.map +1 -0
  58. package/dist/cjs/src/data-structures/trie/index.js.map +1 -0
  59. package/dist/cjs/src/data-structures/trie/trie.js.map +1 -0
  60. package/dist/cjs/src/index.js.map +1 -0
  61. package/dist/cjs/src/interfaces/binary-tree.js.map +1 -0
  62. package/dist/cjs/src/interfaces/doubly-linked-list.js.map +1 -0
  63. package/dist/cjs/{interfaces → src/interfaces}/graph.js.map +1 -1
  64. package/dist/cjs/{interfaces → src/interfaces}/heap.js.map +1 -1
  65. package/dist/cjs/src/interfaces/index.js.map +1 -0
  66. package/dist/cjs/src/interfaces/navigator.js.map +1 -0
  67. package/dist/cjs/src/interfaces/priority-queue.js.map +1 -0
  68. package/dist/cjs/src/interfaces/segment-tree.js.map +1 -0
  69. package/dist/cjs/src/interfaces/singly-linked-list.js.map +1 -0
  70. package/dist/cjs/src/types/data-structures/binary-tree/avl-tree.js.map +1 -0
  71. package/dist/cjs/src/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
  72. package/dist/cjs/src/types/data-structures/binary-tree/binary-tree.js.map +1 -0
  73. package/dist/cjs/src/types/data-structures/binary-tree/bst.js.map +1 -0
  74. package/dist/cjs/src/types/data-structures/binary-tree/index.js.map +1 -0
  75. package/dist/cjs/src/types/data-structures/binary-tree/rb-tree.js.map +1 -0
  76. package/dist/cjs/src/types/data-structures/binary-tree/segment-tree.js.map +1 -0
  77. package/dist/cjs/src/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
  78. package/dist/cjs/src/types/data-structures/graph/abstract-graph.js.map +1 -0
  79. package/dist/cjs/src/types/data-structures/graph/directed-graph.js.map +1 -0
  80. package/dist/cjs/src/types/data-structures/graph/index.js.map +1 -0
  81. package/dist/cjs/src/types/data-structures/graph/map-graph.js.map +1 -0
  82. package/dist/cjs/src/types/data-structures/graph/undirected-graph.js.map +1 -0
  83. package/dist/cjs/src/types/data-structures/hash/coordinate-map.js.map +1 -0
  84. package/dist/cjs/src/types/data-structures/hash/coordinate-set.js.map +1 -0
  85. package/dist/cjs/src/types/data-structures/hash/hash-map.js.map +1 -0
  86. package/dist/cjs/src/types/data-structures/hash/hash-table.js.map +1 -0
  87. package/dist/cjs/src/types/data-structures/hash/index.js.map +1 -0
  88. package/dist/cjs/src/types/data-structures/hash/tree-map.js.map +1 -0
  89. package/dist/cjs/src/types/data-structures/hash/tree-set.js.map +1 -0
  90. package/dist/cjs/src/types/data-structures/heap/heap.js.map +1 -0
  91. package/dist/cjs/src/types/data-structures/heap/index.js.map +1 -0
  92. package/dist/cjs/src/types/data-structures/heap/max-heap.js.map +1 -0
  93. package/dist/cjs/src/types/data-structures/heap/min-heap.js.map +1 -0
  94. package/dist/cjs/src/types/data-structures/index.js.map +1 -0
  95. package/dist/cjs/src/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
  96. package/dist/cjs/src/types/data-structures/linked-list/index.js.map +1 -0
  97. package/dist/cjs/src/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
  98. package/dist/cjs/src/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
  99. package/dist/cjs/src/types/data-structures/matrix/index.js.map +1 -0
  100. package/dist/cjs/src/types/data-structures/matrix/matrix.js.map +1 -0
  101. package/dist/cjs/src/types/data-structures/matrix/matrix2d.js.map +1 -0
  102. package/dist/cjs/src/types/data-structures/matrix/navigator.js.map +1 -0
  103. package/dist/cjs/src/types/data-structures/matrix/vector2d.js.map +1 -0
  104. package/dist/cjs/src/types/data-structures/priority-queue/index.js.map +1 -0
  105. package/dist/cjs/src/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
  106. package/dist/cjs/src/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
  107. package/dist/cjs/src/types/data-structures/priority-queue/priority-queue.js.map +1 -0
  108. package/dist/cjs/src/types/data-structures/queue/deque.js.map +1 -0
  109. package/dist/cjs/src/types/data-structures/queue/index.js.map +1 -0
  110. package/dist/cjs/src/types/data-structures/queue/queue.js.map +1 -0
  111. package/dist/cjs/src/types/data-structures/stack/index.js.map +1 -0
  112. package/dist/cjs/src/types/data-structures/stack/stack.js.map +1 -0
  113. package/dist/cjs/src/types/data-structures/tree/index.js.map +1 -0
  114. package/dist/cjs/src/types/data-structures/tree/tree.js.map +1 -0
  115. package/dist/cjs/src/types/data-structures/trie/index.js.map +1 -0
  116. package/dist/cjs/src/types/data-structures/trie/trie.js.map +1 -0
  117. package/dist/cjs/src/types/helpers.js.map +1 -0
  118. package/dist/cjs/src/types/index.js.map +1 -0
  119. package/dist/cjs/src/types/utils/index.js.map +1 -0
  120. package/dist/cjs/{types → src/types}/utils/utils.js.map +1 -1
  121. package/dist/cjs/src/types/utils/validate-type.js.map +1 -0
  122. package/dist/cjs/src/utils/index.js.map +1 -0
  123. package/dist/cjs/src/utils/utils.js.map +1 -0
  124. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/avl-tree.d.ts +1 -1
  125. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/avl-tree.js +2 -2
  126. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/binary-tree.d.ts +4 -3
  127. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/binary-tree.js +19 -18
  128. package/dist/{cjs → mjs/src}/data-structures/binary-tree/bst.d.ts +1 -20
  129. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/bst.js +5 -26
  130. package/dist/{cjs → mjs/src}/data-structures/binary-tree/tree-multiset.d.ts +1 -1
  131. package/dist/mjs/{data-structures → src/data-structures}/binary-tree/tree-multiset.js +2 -2
  132. package/dist/umd/data-structure-typed.min.js +1 -1
  133. package/dist/umd/data-structure-typed.min.js.map +1 -1
  134. package/package.json +8 -8
  135. package/src/data-structures/binary-tree/avl-tree.ts +2 -2
  136. package/src/data-structures/binary-tree/binary-tree.ts +20 -18
  137. package/src/data-structures/binary-tree/bst.ts +6 -33
  138. package/src/data-structures/binary-tree/tree-multiset.ts +2 -2
  139. package/tsconfig-base.json +20 -24
  140. package/tsconfig-cjs.json +5 -1
  141. package/tsconfig-mjs.json +12 -0
  142. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +0 -1
  143. package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  144. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +0 -1
  145. package/dist/cjs/data-structures/binary-tree/bst.js.map +0 -1
  146. package/dist/cjs/data-structures/binary-tree/index.js.map +0 -1
  147. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +0 -1
  148. package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +0 -1
  149. package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +0 -1
  150. package/dist/cjs/data-structures/graph/abstract-graph.js.map +0 -1
  151. package/dist/cjs/data-structures/graph/directed-graph.js.map +0 -1
  152. package/dist/cjs/data-structures/graph/index.js.map +0 -1
  153. package/dist/cjs/data-structures/graph/map-graph.js.map +0 -1
  154. package/dist/cjs/data-structures/graph/undirected-graph.js.map +0 -1
  155. package/dist/cjs/data-structures/hash/coordinate-map.js.map +0 -1
  156. package/dist/cjs/data-structures/hash/coordinate-set.js.map +0 -1
  157. package/dist/cjs/data-structures/hash/hash-map.js.map +0 -1
  158. package/dist/cjs/data-structures/hash/hash-table.js.map +0 -1
  159. package/dist/cjs/data-structures/hash/index.js.map +0 -1
  160. package/dist/cjs/data-structures/hash/tree-map.js.map +0 -1
  161. package/dist/cjs/data-structures/hash/tree-set.js.map +0 -1
  162. package/dist/cjs/data-structures/heap/heap.js.map +0 -1
  163. package/dist/cjs/data-structures/heap/index.js.map +0 -1
  164. package/dist/cjs/data-structures/heap/max-heap.js.map +0 -1
  165. package/dist/cjs/data-structures/heap/min-heap.js.map +0 -1
  166. package/dist/cjs/data-structures/index.js.map +0 -1
  167. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  168. package/dist/cjs/data-structures/linked-list/index.js.map +0 -1
  169. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +0 -1
  170. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +0 -1
  171. package/dist/cjs/data-structures/matrix/index.js.map +0 -1
  172. package/dist/cjs/data-structures/matrix/matrix.js.map +0 -1
  173. package/dist/cjs/data-structures/matrix/matrix2d.js.map +0 -1
  174. package/dist/cjs/data-structures/matrix/navigator.js.map +0 -1
  175. package/dist/cjs/data-structures/matrix/vector2d.js.map +0 -1
  176. package/dist/cjs/data-structures/priority-queue/index.js.map +0 -1
  177. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  178. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  179. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +0 -1
  180. package/dist/cjs/data-structures/queue/deque.js.map +0 -1
  181. package/dist/cjs/data-structures/queue/index.js.map +0 -1
  182. package/dist/cjs/data-structures/queue/queue.js.map +0 -1
  183. package/dist/cjs/data-structures/stack/index.js.map +0 -1
  184. package/dist/cjs/data-structures/stack/stack.js.map +0 -1
  185. package/dist/cjs/data-structures/tree/index.js.map +0 -1
  186. package/dist/cjs/data-structures/tree/tree.js.map +0 -1
  187. package/dist/cjs/data-structures/trie/index.js.map +0 -1
  188. package/dist/cjs/data-structures/trie/trie.js.map +0 -1
  189. package/dist/cjs/index.js.map +0 -1
  190. package/dist/cjs/interfaces/binary-tree.js.map +0 -1
  191. package/dist/cjs/interfaces/doubly-linked-list.js.map +0 -1
  192. package/dist/cjs/interfaces/index.js.map +0 -1
  193. package/dist/cjs/interfaces/navigator.js.map +0 -1
  194. package/dist/cjs/interfaces/priority-queue.js.map +0 -1
  195. package/dist/cjs/interfaces/segment-tree.js.map +0 -1
  196. package/dist/cjs/interfaces/singly-linked-list.js.map +0 -1
  197. package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +0 -1
  198. package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
  199. package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +0 -1
  200. package/dist/cjs/types/data-structures/binary-tree/bst.js.map +0 -1
  201. package/dist/cjs/types/data-structures/binary-tree/index.js.map +0 -1
  202. package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +0 -1
  203. package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +0 -1
  204. package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +0 -1
  205. package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +0 -1
  206. package/dist/cjs/types/data-structures/graph/directed-graph.js.map +0 -1
  207. package/dist/cjs/types/data-structures/graph/index.js.map +0 -1
  208. package/dist/cjs/types/data-structures/graph/map-graph.js.map +0 -1
  209. package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +0 -1
  210. package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +0 -1
  211. package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +0 -1
  212. package/dist/cjs/types/data-structures/hash/hash-map.js.map +0 -1
  213. package/dist/cjs/types/data-structures/hash/hash-table.js.map +0 -1
  214. package/dist/cjs/types/data-structures/hash/index.js.map +0 -1
  215. package/dist/cjs/types/data-structures/hash/tree-map.js.map +0 -1
  216. package/dist/cjs/types/data-structures/hash/tree-set.js.map +0 -1
  217. package/dist/cjs/types/data-structures/heap/heap.js.map +0 -1
  218. package/dist/cjs/types/data-structures/heap/index.js.map +0 -1
  219. package/dist/cjs/types/data-structures/heap/max-heap.js.map +0 -1
  220. package/dist/cjs/types/data-structures/heap/min-heap.js.map +0 -1
  221. package/dist/cjs/types/data-structures/index.js.map +0 -1
  222. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
  223. package/dist/cjs/types/data-structures/linked-list/index.js.map +0 -1
  224. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
  225. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
  226. package/dist/cjs/types/data-structures/matrix/index.js.map +0 -1
  227. package/dist/cjs/types/data-structures/matrix/matrix.js.map +0 -1
  228. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +0 -1
  229. package/dist/cjs/types/data-structures/matrix/navigator.js.map +0 -1
  230. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +0 -1
  231. package/dist/cjs/types/data-structures/priority-queue/index.js.map +0 -1
  232. package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
  233. package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
  234. package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +0 -1
  235. package/dist/cjs/types/data-structures/queue/deque.js.map +0 -1
  236. package/dist/cjs/types/data-structures/queue/index.js.map +0 -1
  237. package/dist/cjs/types/data-structures/queue/queue.js.map +0 -1
  238. package/dist/cjs/types/data-structures/stack/index.js.map +0 -1
  239. package/dist/cjs/types/data-structures/stack/stack.js.map +0 -1
  240. package/dist/cjs/types/data-structures/tree/index.js.map +0 -1
  241. package/dist/cjs/types/data-structures/tree/tree.js.map +0 -1
  242. package/dist/cjs/types/data-structures/trie/index.js.map +0 -1
  243. package/dist/cjs/types/data-structures/trie/trie.js.map +0 -1
  244. package/dist/cjs/types/helpers.js.map +0 -1
  245. package/dist/cjs/types/index.js.map +0 -1
  246. package/dist/cjs/types/utils/index.js.map +0 -1
  247. package/dist/cjs/types/utils/validate-type.js.map +0 -1
  248. package/dist/cjs/utils/index.js.map +0 -1
  249. package/dist/cjs/utils/utils.js.map +0 -1
  250. package/test/config.ts +0 -1
  251. package/test/integration/avl-tree.test.ts +0 -110
  252. package/test/integration/bst.test.ts +0 -385
  253. package/test/integration/heap.test.js +0 -16
  254. package/test/integration/index.html +0 -51
  255. package/test/performance/data-structures/binary-tree/avl-tree.test.ts +0 -36
  256. package/test/performance/data-structures/binary-tree/binary-index-tree.test.ts +0 -0
  257. package/test/performance/data-structures/binary-tree/binary-tree.test.ts +0 -45
  258. package/test/performance/data-structures/binary-tree/bst.test.ts +0 -36
  259. package/test/performance/data-structures/binary-tree/overall.test.ts +0 -0
  260. package/test/performance/data-structures/binary-tree/rb-tree.test.ts +0 -0
  261. package/test/performance/data-structures/binary-tree/segment-tree.test.ts +0 -0
  262. package/test/performance/data-structures/binary-tree/tree-multiset.test.ts +0 -0
  263. package/test/performance/data-structures/graph/abstract-graph.test.ts +0 -0
  264. package/test/performance/data-structures/graph/directed-graph.test.ts +0 -49
  265. package/test/performance/data-structures/graph/map-graph.test.ts +0 -0
  266. package/test/performance/data-structures/graph/overall.test.ts +0 -0
  267. package/test/performance/data-structures/graph/undirected-graph.test.ts +0 -0
  268. package/test/performance/data-structures/hash/coordinate-map.test.ts +0 -0
  269. package/test/performance/data-structures/hash/coordinate-set.test.ts +0 -0
  270. package/test/performance/data-structures/hash/hash-map.test.ts +0 -0
  271. package/test/performance/data-structures/hash/hash-table.test.ts +0 -0
  272. package/test/performance/data-structures/heap/heap.test.ts +0 -30
  273. package/test/performance/data-structures/heap/max-heap.test.ts +0 -0
  274. package/test/performance/data-structures/heap/min-heap.test.ts +0 -0
  275. package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +0 -40
  276. package/test/performance/data-structures/linked-list/linked-list.test.ts +0 -0
  277. package/test/performance/data-structures/linked-list/singly-linked-list.test.ts +0 -34
  278. package/test/performance/data-structures/linked-list/skip-linked-list.test.ts +0 -0
  279. package/test/performance/data-structures/linked-list/skip-list.test.ts +0 -0
  280. package/test/performance/data-structures/matrix/matrix.test.ts +0 -0
  281. package/test/performance/data-structures/matrix/matrix2d.test.ts +0 -0
  282. package/test/performance/data-structures/matrix/navigator.test.ts +0 -0
  283. package/test/performance/data-structures/matrix/vector2d.test.ts +0 -0
  284. package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +0 -19
  285. package/test/performance/data-structures/priority-queue/min-priority-queue.test.ts +0 -0
  286. package/test/performance/data-structures/priority-queue/priority-queue.test.ts +0 -0
  287. package/test/performance/data-structures/queue/deque.test.ts +0 -21
  288. package/test/performance/data-structures/queue/queue.test.ts +0 -25
  289. package/test/performance/data-structures/stack/stack.test.ts +0 -0
  290. package/test/performance/data-structures/tree/tree.test.ts +0 -0
  291. package/test/performance/data-structures/trie/trie.test.ts +0 -22
  292. package/test/performance/reportor.ts +0 -183
  293. package/test/performance/types/index.ts +0 -1
  294. package/test/performance/types/reportor.ts +0 -3
  295. package/test/types/index.ts +0 -1
  296. package/test/types/utils/big-o.ts +0 -1
  297. package/test/types/utils/index.ts +0 -2
  298. package/test/types/utils/json2html.ts +0 -1
  299. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +0 -269
  300. package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +0 -320
  301. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +0 -486
  302. package/test/unit/data-structures/binary-tree/bst.test.ts +0 -840
  303. package/test/unit/data-structures/binary-tree/overall.test.ts +0 -66
  304. package/test/unit/data-structures/binary-tree/rb-tree.test.ts +0 -435
  305. package/test/unit/data-structures/binary-tree/segment-tree.test.ts +0 -50
  306. package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +0 -542
  307. package/test/unit/data-structures/graph/abstract-graph.test.ts +0 -100
  308. package/test/unit/data-structures/graph/directed-graph.test.ts +0 -564
  309. package/test/unit/data-structures/graph/map-graph.test.ts +0 -126
  310. package/test/unit/data-structures/graph/overall.test.ts +0 -49
  311. package/test/unit/data-structures/graph/undirected-graph.test.ts +0 -149
  312. package/test/unit/data-structures/hash/coordinate-map.test.ts +0 -74
  313. package/test/unit/data-structures/hash/coordinate-set.test.ts +0 -66
  314. package/test/unit/data-structures/hash/hash-map.test.ts +0 -103
  315. package/test/unit/data-structures/hash/hash-table.test.ts +0 -186
  316. package/test/unit/data-structures/heap/heap.test.ts +0 -254
  317. package/test/unit/data-structures/heap/max-heap.test.ts +0 -52
  318. package/test/unit/data-structures/heap/min-heap.test.ts +0 -52
  319. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +0 -400
  320. package/test/unit/data-structures/linked-list/linked-list.test.ts +0 -8
  321. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -474
  322. package/test/unit/data-structures/linked-list/skip-linked-list.test.ts +0 -13
  323. package/test/unit/data-structures/linked-list/skip-list.test.ts +0 -86
  324. package/test/unit/data-structures/matrix/matrix.test.ts +0 -54
  325. package/test/unit/data-structures/matrix/matrix2d.test.ts +0 -345
  326. package/test/unit/data-structures/matrix/navigator.test.ts +0 -244
  327. package/test/unit/data-structures/matrix/vector2d.test.ts +0 -171
  328. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +0 -73
  329. package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +0 -63
  330. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +0 -53
  331. package/test/unit/data-structures/queue/deque.test.ts +0 -410
  332. package/test/unit/data-structures/queue/queue.test.ts +0 -207
  333. package/test/unit/data-structures/stack/stack.test.ts +0 -67
  334. package/test/unit/data-structures/tree/tree.test.ts +0 -39
  335. package/test/unit/data-structures/trie/trie.test.ts +0 -825
  336. package/test/utils/array.ts +0 -5514
  337. package/test/utils/big-o.ts +0 -207
  338. package/test/utils/console.ts +0 -31
  339. package/test/utils/index.ts +0 -7
  340. package/test/utils/is.ts +0 -56
  341. package/test/utils/json2html.ts +0 -322
  342. package/test/utils/number.ts +0 -13
  343. package/test/utils/string.ts +0 -1
  344. package/umd/bundle.min.js +0 -3
  345. package/umd/bundle.min.js.LICENSE.txt +0 -28
  346. package/umd/bundle.min.js.map +0 -1
  347. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  348. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  349. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/index.d.ts +0 -0
  350. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/index.js +0 -0
  351. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/rb-tree.d.ts +0 -0
  352. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/rb-tree.js +0 -0
  353. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/segment-tree.d.ts +0 -0
  354. /package/dist/cjs/{data-structures → src/data-structures}/binary-tree/segment-tree.js +0 -0
  355. /package/dist/cjs/{data-structures → src/data-structures}/graph/abstract-graph.d.ts +0 -0
  356. /package/dist/cjs/{data-structures → src/data-structures}/graph/abstract-graph.js +0 -0
  357. /package/dist/cjs/{data-structures → src/data-structures}/graph/directed-graph.d.ts +0 -0
  358. /package/dist/cjs/{data-structures → src/data-structures}/graph/directed-graph.js +0 -0
  359. /package/dist/cjs/{data-structures → src/data-structures}/graph/index.d.ts +0 -0
  360. /package/dist/cjs/{data-structures → src/data-structures}/graph/index.js +0 -0
  361. /package/dist/cjs/{data-structures → src/data-structures}/graph/map-graph.d.ts +0 -0
  362. /package/dist/cjs/{data-structures → src/data-structures}/graph/map-graph.js +0 -0
  363. /package/dist/cjs/{data-structures → src/data-structures}/graph/undirected-graph.d.ts +0 -0
  364. /package/dist/cjs/{data-structures → src/data-structures}/graph/undirected-graph.js +0 -0
  365. /package/dist/cjs/{data-structures → src/data-structures}/hash/coordinate-map.d.ts +0 -0
  366. /package/dist/cjs/{data-structures → src/data-structures}/hash/coordinate-map.js +0 -0
  367. /package/dist/cjs/{data-structures → src/data-structures}/hash/coordinate-set.d.ts +0 -0
  368. /package/dist/cjs/{data-structures → src/data-structures}/hash/coordinate-set.js +0 -0
  369. /package/dist/cjs/{data-structures → src/data-structures}/hash/hash-map.d.ts +0 -0
  370. /package/dist/cjs/{data-structures → src/data-structures}/hash/hash-map.js +0 -0
  371. /package/dist/cjs/{data-structures → src/data-structures}/hash/hash-table.d.ts +0 -0
  372. /package/dist/cjs/{data-structures → src/data-structures}/hash/hash-table.js +0 -0
  373. /package/dist/cjs/{data-structures → src/data-structures}/hash/index.d.ts +0 -0
  374. /package/dist/cjs/{data-structures → src/data-structures}/hash/index.js +0 -0
  375. /package/dist/cjs/{data-structures → src/data-structures}/hash/tree-map.d.ts +0 -0
  376. /package/dist/cjs/{data-structures → src/data-structures}/hash/tree-map.js +0 -0
  377. /package/dist/cjs/{data-structures → src/data-structures}/hash/tree-set.d.ts +0 -0
  378. /package/dist/cjs/{data-structures → src/data-structures}/hash/tree-set.js +0 -0
  379. /package/dist/cjs/{data-structures → src/data-structures}/heap/heap.d.ts +0 -0
  380. /package/dist/cjs/{data-structures → src/data-structures}/heap/heap.js +0 -0
  381. /package/dist/cjs/{data-structures → src/data-structures}/heap/index.d.ts +0 -0
  382. /package/dist/cjs/{data-structures → src/data-structures}/heap/index.js +0 -0
  383. /package/dist/cjs/{data-structures → src/data-structures}/heap/max-heap.d.ts +0 -0
  384. /package/dist/cjs/{data-structures → src/data-structures}/heap/max-heap.js +0 -0
  385. /package/dist/cjs/{data-structures → src/data-structures}/heap/min-heap.d.ts +0 -0
  386. /package/dist/cjs/{data-structures → src/data-structures}/heap/min-heap.js +0 -0
  387. /package/dist/cjs/{data-structures → src/data-structures}/index.d.ts +0 -0
  388. /package/dist/cjs/{data-structures → src/data-structures}/index.js +0 -0
  389. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  390. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/doubly-linked-list.js +0 -0
  391. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/index.d.ts +0 -0
  392. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/index.js +0 -0
  393. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  394. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/singly-linked-list.js +0 -0
  395. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  396. /package/dist/cjs/{data-structures → src/data-structures}/linked-list/skip-linked-list.js +0 -0
  397. /package/dist/cjs/{data-structures → src/data-structures}/matrix/index.d.ts +0 -0
  398. /package/dist/cjs/{data-structures → src/data-structures}/matrix/index.js +0 -0
  399. /package/dist/cjs/{data-structures → src/data-structures}/matrix/matrix.d.ts +0 -0
  400. /package/dist/cjs/{data-structures → src/data-structures}/matrix/matrix.js +0 -0
  401. /package/dist/cjs/{data-structures → src/data-structures}/matrix/matrix2d.d.ts +0 -0
  402. /package/dist/cjs/{data-structures → src/data-structures}/matrix/matrix2d.js +0 -0
  403. /package/dist/cjs/{data-structures → src/data-structures}/matrix/navigator.d.ts +0 -0
  404. /package/dist/cjs/{data-structures → src/data-structures}/matrix/navigator.js +0 -0
  405. /package/dist/cjs/{data-structures → src/data-structures}/matrix/vector2d.d.ts +0 -0
  406. /package/dist/cjs/{data-structures → src/data-structures}/matrix/vector2d.js +0 -0
  407. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/index.d.ts +0 -0
  408. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/index.js +0 -0
  409. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  410. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/max-priority-queue.js +0 -0
  411. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  412. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/min-priority-queue.js +0 -0
  413. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/priority-queue.d.ts +0 -0
  414. /package/dist/cjs/{data-structures → src/data-structures}/priority-queue/priority-queue.js +0 -0
  415. /package/dist/cjs/{data-structures → src/data-structures}/queue/deque.d.ts +0 -0
  416. /package/dist/cjs/{data-structures → src/data-structures}/queue/deque.js +0 -0
  417. /package/dist/cjs/{data-structures → src/data-structures}/queue/index.d.ts +0 -0
  418. /package/dist/cjs/{data-structures → src/data-structures}/queue/index.js +0 -0
  419. /package/dist/cjs/{data-structures → src/data-structures}/queue/queue.d.ts +0 -0
  420. /package/dist/cjs/{data-structures → src/data-structures}/queue/queue.js +0 -0
  421. /package/dist/cjs/{data-structures → src/data-structures}/stack/index.d.ts +0 -0
  422. /package/dist/cjs/{data-structures → src/data-structures}/stack/index.js +0 -0
  423. /package/dist/cjs/{data-structures → src/data-structures}/stack/stack.d.ts +0 -0
  424. /package/dist/cjs/{data-structures → src/data-structures}/stack/stack.js +0 -0
  425. /package/dist/cjs/{data-structures → src/data-structures}/tree/index.d.ts +0 -0
  426. /package/dist/cjs/{data-structures → src/data-structures}/tree/index.js +0 -0
  427. /package/dist/cjs/{data-structures → src/data-structures}/tree/tree.d.ts +0 -0
  428. /package/dist/cjs/{data-structures → src/data-structures}/tree/tree.js +0 -0
  429. /package/dist/cjs/{data-structures → src/data-structures}/trie/index.d.ts +0 -0
  430. /package/dist/cjs/{data-structures → src/data-structures}/trie/index.js +0 -0
  431. /package/dist/cjs/{data-structures → src/data-structures}/trie/trie.d.ts +0 -0
  432. /package/dist/cjs/{data-structures → src/data-structures}/trie/trie.js +0 -0
  433. /package/dist/cjs/{index.d.ts → src/index.d.ts} +0 -0
  434. /package/dist/cjs/{index.js → src/index.js} +0 -0
  435. /package/dist/cjs/{interfaces → src/interfaces}/binary-tree.d.ts +0 -0
  436. /package/dist/cjs/{interfaces → src/interfaces}/binary-tree.js +0 -0
  437. /package/dist/cjs/{interfaces → src/interfaces}/doubly-linked-list.d.ts +0 -0
  438. /package/dist/cjs/{interfaces → src/interfaces}/doubly-linked-list.js +0 -0
  439. /package/dist/cjs/{interfaces → src/interfaces}/graph.d.ts +0 -0
  440. /package/dist/cjs/{interfaces → src/interfaces}/graph.js +0 -0
  441. /package/dist/cjs/{interfaces → src/interfaces}/heap.d.ts +0 -0
  442. /package/dist/cjs/{interfaces → src/interfaces}/heap.js +0 -0
  443. /package/dist/cjs/{interfaces → src/interfaces}/index.d.ts +0 -0
  444. /package/dist/cjs/{interfaces → src/interfaces}/index.js +0 -0
  445. /package/dist/cjs/{interfaces → src/interfaces}/navigator.d.ts +0 -0
  446. /package/dist/cjs/{interfaces → src/interfaces}/navigator.js +0 -0
  447. /package/dist/cjs/{interfaces → src/interfaces}/priority-queue.d.ts +0 -0
  448. /package/dist/cjs/{interfaces → src/interfaces}/priority-queue.js +0 -0
  449. /package/dist/cjs/{interfaces → src/interfaces}/segment-tree.d.ts +0 -0
  450. /package/dist/cjs/{interfaces → src/interfaces}/segment-tree.js +0 -0
  451. /package/dist/cjs/{interfaces → src/interfaces}/singly-linked-list.d.ts +0 -0
  452. /package/dist/cjs/{interfaces → src/interfaces}/singly-linked-list.js +0 -0
  453. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  454. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/avl-tree.js +0 -0
  455. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  456. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  457. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  458. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/binary-tree.js +0 -0
  459. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/bst.d.ts +0 -0
  460. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/bst.js +0 -0
  461. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/index.d.ts +0 -0
  462. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/index.js +0 -0
  463. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  464. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/rb-tree.js +0 -0
  465. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  466. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/segment-tree.js +0 -0
  467. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  468. /package/dist/cjs/{types → src/types}/data-structures/binary-tree/tree-multiset.js +0 -0
  469. /package/dist/cjs/{types → src/types}/data-structures/graph/abstract-graph.d.ts +0 -0
  470. /package/dist/cjs/{types → src/types}/data-structures/graph/abstract-graph.js +0 -0
  471. /package/dist/cjs/{types → src/types}/data-structures/graph/directed-graph.d.ts +0 -0
  472. /package/dist/cjs/{types → src/types}/data-structures/graph/directed-graph.js +0 -0
  473. /package/dist/cjs/{types → src/types}/data-structures/graph/index.d.ts +0 -0
  474. /package/dist/cjs/{types → src/types}/data-structures/graph/index.js +0 -0
  475. /package/dist/cjs/{types → src/types}/data-structures/graph/map-graph.d.ts +0 -0
  476. /package/dist/cjs/{types → src/types}/data-structures/graph/map-graph.js +0 -0
  477. /package/dist/cjs/{types → src/types}/data-structures/graph/undirected-graph.d.ts +0 -0
  478. /package/dist/cjs/{types → src/types}/data-structures/graph/undirected-graph.js +0 -0
  479. /package/dist/cjs/{types → src/types}/data-structures/hash/coordinate-map.d.ts +0 -0
  480. /package/dist/cjs/{types → src/types}/data-structures/hash/coordinate-map.js +0 -0
  481. /package/dist/cjs/{types → src/types}/data-structures/hash/coordinate-set.d.ts +0 -0
  482. /package/dist/cjs/{types → src/types}/data-structures/hash/coordinate-set.js +0 -0
  483. /package/dist/cjs/{types → src/types}/data-structures/hash/hash-map.d.ts +0 -0
  484. /package/dist/cjs/{types → src/types}/data-structures/hash/hash-map.js +0 -0
  485. /package/dist/cjs/{types → src/types}/data-structures/hash/hash-table.d.ts +0 -0
  486. /package/dist/cjs/{types → src/types}/data-structures/hash/hash-table.js +0 -0
  487. /package/dist/cjs/{types → src/types}/data-structures/hash/index.d.ts +0 -0
  488. /package/dist/cjs/{types → src/types}/data-structures/hash/index.js +0 -0
  489. /package/dist/cjs/{types → src/types}/data-structures/hash/tree-map.d.ts +0 -0
  490. /package/dist/cjs/{types → src/types}/data-structures/hash/tree-map.js +0 -0
  491. /package/dist/cjs/{types → src/types}/data-structures/hash/tree-set.d.ts +0 -0
  492. /package/dist/cjs/{types → src/types}/data-structures/hash/tree-set.js +0 -0
  493. /package/dist/cjs/{types → src/types}/data-structures/heap/heap.d.ts +0 -0
  494. /package/dist/cjs/{types → src/types}/data-structures/heap/heap.js +0 -0
  495. /package/dist/cjs/{types → src/types}/data-structures/heap/index.d.ts +0 -0
  496. /package/dist/cjs/{types → src/types}/data-structures/heap/index.js +0 -0
  497. /package/dist/cjs/{types → src/types}/data-structures/heap/max-heap.d.ts +0 -0
  498. /package/dist/cjs/{types → src/types}/data-structures/heap/max-heap.js +0 -0
  499. /package/dist/cjs/{types → src/types}/data-structures/heap/min-heap.d.ts +0 -0
  500. /package/dist/cjs/{types → src/types}/data-structures/heap/min-heap.js +0 -0
  501. /package/dist/cjs/{types → src/types}/data-structures/index.d.ts +0 -0
  502. /package/dist/cjs/{types → src/types}/data-structures/index.js +0 -0
  503. /package/dist/cjs/{types → src/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  504. /package/dist/cjs/{types → src/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  505. /package/dist/cjs/{types → src/types}/data-structures/linked-list/index.d.ts +0 -0
  506. /package/dist/cjs/{types → src/types}/data-structures/linked-list/index.js +0 -0
  507. /package/dist/cjs/{types → src/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  508. /package/dist/cjs/{types → src/types}/data-structures/linked-list/singly-linked-list.js +0 -0
  509. /package/dist/cjs/{types → src/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  510. /package/dist/cjs/{types → src/types}/data-structures/linked-list/skip-linked-list.js +0 -0
  511. /package/dist/cjs/{types → src/types}/data-structures/matrix/index.d.ts +0 -0
  512. /package/dist/cjs/{types → src/types}/data-structures/matrix/index.js +0 -0
  513. /package/dist/cjs/{types → src/types}/data-structures/matrix/matrix.d.ts +0 -0
  514. /package/dist/cjs/{types → src/types}/data-structures/matrix/matrix.js +0 -0
  515. /package/dist/cjs/{types → src/types}/data-structures/matrix/matrix2d.d.ts +0 -0
  516. /package/dist/cjs/{types → src/types}/data-structures/matrix/matrix2d.js +0 -0
  517. /package/dist/cjs/{types → src/types}/data-structures/matrix/navigator.d.ts +0 -0
  518. /package/dist/cjs/{types → src/types}/data-structures/matrix/navigator.js +0 -0
  519. /package/dist/cjs/{types → src/types}/data-structures/matrix/vector2d.d.ts +0 -0
  520. /package/dist/cjs/{types → src/types}/data-structures/matrix/vector2d.js +0 -0
  521. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/index.d.ts +0 -0
  522. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/index.js +0 -0
  523. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  524. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  525. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  526. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  527. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  528. /package/dist/cjs/{types → src/types}/data-structures/priority-queue/priority-queue.js +0 -0
  529. /package/dist/cjs/{types → src/types}/data-structures/queue/deque.d.ts +0 -0
  530. /package/dist/cjs/{types → src/types}/data-structures/queue/deque.js +0 -0
  531. /package/dist/cjs/{types → src/types}/data-structures/queue/index.d.ts +0 -0
  532. /package/dist/cjs/{types → src/types}/data-structures/queue/index.js +0 -0
  533. /package/dist/cjs/{types → src/types}/data-structures/queue/queue.d.ts +0 -0
  534. /package/dist/cjs/{types → src/types}/data-structures/queue/queue.js +0 -0
  535. /package/dist/cjs/{types → src/types}/data-structures/stack/index.d.ts +0 -0
  536. /package/dist/cjs/{types → src/types}/data-structures/stack/index.js +0 -0
  537. /package/dist/cjs/{types → src/types}/data-structures/stack/stack.d.ts +0 -0
  538. /package/dist/cjs/{types → src/types}/data-structures/stack/stack.js +0 -0
  539. /package/dist/cjs/{types → src/types}/data-structures/tree/index.d.ts +0 -0
  540. /package/dist/cjs/{types → src/types}/data-structures/tree/index.js +0 -0
  541. /package/dist/cjs/{types → src/types}/data-structures/tree/tree.d.ts +0 -0
  542. /package/dist/cjs/{types → src/types}/data-structures/tree/tree.js +0 -0
  543. /package/dist/cjs/{types → src/types}/data-structures/trie/index.d.ts +0 -0
  544. /package/dist/cjs/{types → src/types}/data-structures/trie/index.js +0 -0
  545. /package/dist/cjs/{types → src/types}/data-structures/trie/trie.d.ts +0 -0
  546. /package/dist/cjs/{types → src/types}/data-structures/trie/trie.js +0 -0
  547. /package/dist/cjs/{types → src/types}/helpers.d.ts +0 -0
  548. /package/dist/cjs/{types → src/types}/helpers.js +0 -0
  549. /package/dist/cjs/{types → src/types}/index.d.ts +0 -0
  550. /package/dist/cjs/{types → src/types}/index.js +0 -0
  551. /package/dist/cjs/{types → src/types}/utils/index.d.ts +0 -0
  552. /package/dist/cjs/{types → src/types}/utils/index.js +0 -0
  553. /package/dist/cjs/{types → src/types}/utils/utils.d.ts +0 -0
  554. /package/dist/cjs/{types → src/types}/utils/utils.js +0 -0
  555. /package/dist/cjs/{types → src/types}/utils/validate-type.d.ts +0 -0
  556. /package/dist/cjs/{types → src/types}/utils/validate-type.js +0 -0
  557. /package/dist/cjs/{utils → src/utils}/index.d.ts +0 -0
  558. /package/dist/cjs/{utils → src/utils}/index.js +0 -0
  559. /package/dist/cjs/{utils → src/utils}/utils.d.ts +0 -0
  560. /package/dist/cjs/{utils → src/utils}/utils.js +0 -0
  561. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
  562. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
  563. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/index.d.ts +0 -0
  564. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/index.js +0 -0
  565. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/rb-tree.d.ts +0 -0
  566. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/rb-tree.js +0 -0
  567. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/segment-tree.d.ts +0 -0
  568. /package/dist/mjs/{data-structures → src/data-structures}/binary-tree/segment-tree.js +0 -0
  569. /package/dist/mjs/{data-structures → src/data-structures}/graph/abstract-graph.d.ts +0 -0
  570. /package/dist/mjs/{data-structures → src/data-structures}/graph/abstract-graph.js +0 -0
  571. /package/dist/mjs/{data-structures → src/data-structures}/graph/directed-graph.d.ts +0 -0
  572. /package/dist/mjs/{data-structures → src/data-structures}/graph/directed-graph.js +0 -0
  573. /package/dist/mjs/{data-structures → src/data-structures}/graph/index.d.ts +0 -0
  574. /package/dist/mjs/{data-structures → src/data-structures}/graph/index.js +0 -0
  575. /package/dist/mjs/{data-structures → src/data-structures}/graph/map-graph.d.ts +0 -0
  576. /package/dist/mjs/{data-structures → src/data-structures}/graph/map-graph.js +0 -0
  577. /package/dist/mjs/{data-structures → src/data-structures}/graph/undirected-graph.d.ts +0 -0
  578. /package/dist/mjs/{data-structures → src/data-structures}/graph/undirected-graph.js +0 -0
  579. /package/dist/mjs/{data-structures → src/data-structures}/hash/coordinate-map.d.ts +0 -0
  580. /package/dist/mjs/{data-structures → src/data-structures}/hash/coordinate-map.js +0 -0
  581. /package/dist/mjs/{data-structures → src/data-structures}/hash/coordinate-set.d.ts +0 -0
  582. /package/dist/mjs/{data-structures → src/data-structures}/hash/coordinate-set.js +0 -0
  583. /package/dist/mjs/{data-structures → src/data-structures}/hash/hash-map.d.ts +0 -0
  584. /package/dist/mjs/{data-structures → src/data-structures}/hash/hash-map.js +0 -0
  585. /package/dist/mjs/{data-structures → src/data-structures}/hash/hash-table.d.ts +0 -0
  586. /package/dist/mjs/{data-structures → src/data-structures}/hash/hash-table.js +0 -0
  587. /package/dist/mjs/{data-structures → src/data-structures}/hash/index.d.ts +0 -0
  588. /package/dist/mjs/{data-structures → src/data-structures}/hash/index.js +0 -0
  589. /package/dist/mjs/{data-structures → src/data-structures}/hash/tree-map.d.ts +0 -0
  590. /package/dist/mjs/{data-structures → src/data-structures}/hash/tree-map.js +0 -0
  591. /package/dist/mjs/{data-structures → src/data-structures}/hash/tree-set.d.ts +0 -0
  592. /package/dist/mjs/{data-structures → src/data-structures}/hash/tree-set.js +0 -0
  593. /package/dist/mjs/{data-structures → src/data-structures}/heap/heap.d.ts +0 -0
  594. /package/dist/mjs/{data-structures → src/data-structures}/heap/heap.js +0 -0
  595. /package/dist/mjs/{data-structures → src/data-structures}/heap/index.d.ts +0 -0
  596. /package/dist/mjs/{data-structures → src/data-structures}/heap/index.js +0 -0
  597. /package/dist/mjs/{data-structures → src/data-structures}/heap/max-heap.d.ts +0 -0
  598. /package/dist/mjs/{data-structures → src/data-structures}/heap/max-heap.js +0 -0
  599. /package/dist/mjs/{data-structures → src/data-structures}/heap/min-heap.d.ts +0 -0
  600. /package/dist/mjs/{data-structures → src/data-structures}/heap/min-heap.js +0 -0
  601. /package/dist/mjs/{data-structures → src/data-structures}/index.d.ts +0 -0
  602. /package/dist/mjs/{data-structures → src/data-structures}/index.js +0 -0
  603. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
  604. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/doubly-linked-list.js +0 -0
  605. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/index.d.ts +0 -0
  606. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/index.js +0 -0
  607. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
  608. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/singly-linked-list.js +0 -0
  609. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
  610. /package/dist/mjs/{data-structures → src/data-structures}/linked-list/skip-linked-list.js +0 -0
  611. /package/dist/mjs/{data-structures → src/data-structures}/matrix/index.d.ts +0 -0
  612. /package/dist/mjs/{data-structures → src/data-structures}/matrix/index.js +0 -0
  613. /package/dist/mjs/{data-structures → src/data-structures}/matrix/matrix.d.ts +0 -0
  614. /package/dist/mjs/{data-structures → src/data-structures}/matrix/matrix.js +0 -0
  615. /package/dist/mjs/{data-structures → src/data-structures}/matrix/matrix2d.d.ts +0 -0
  616. /package/dist/mjs/{data-structures → src/data-structures}/matrix/matrix2d.js +0 -0
  617. /package/dist/mjs/{data-structures → src/data-structures}/matrix/navigator.d.ts +0 -0
  618. /package/dist/mjs/{data-structures → src/data-structures}/matrix/navigator.js +0 -0
  619. /package/dist/mjs/{data-structures → src/data-structures}/matrix/vector2d.d.ts +0 -0
  620. /package/dist/mjs/{data-structures → src/data-structures}/matrix/vector2d.js +0 -0
  621. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/index.d.ts +0 -0
  622. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/index.js +0 -0
  623. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
  624. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/max-priority-queue.js +0 -0
  625. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
  626. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/min-priority-queue.js +0 -0
  627. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/priority-queue.d.ts +0 -0
  628. /package/dist/mjs/{data-structures → src/data-structures}/priority-queue/priority-queue.js +0 -0
  629. /package/dist/mjs/{data-structures → src/data-structures}/queue/deque.d.ts +0 -0
  630. /package/dist/mjs/{data-structures → src/data-structures}/queue/deque.js +0 -0
  631. /package/dist/mjs/{data-structures → src/data-structures}/queue/index.d.ts +0 -0
  632. /package/dist/mjs/{data-structures → src/data-structures}/queue/index.js +0 -0
  633. /package/dist/mjs/{data-structures → src/data-structures}/queue/queue.d.ts +0 -0
  634. /package/dist/mjs/{data-structures → src/data-structures}/queue/queue.js +0 -0
  635. /package/dist/mjs/{data-structures → src/data-structures}/stack/index.d.ts +0 -0
  636. /package/dist/mjs/{data-structures → src/data-structures}/stack/index.js +0 -0
  637. /package/dist/mjs/{data-structures → src/data-structures}/stack/stack.d.ts +0 -0
  638. /package/dist/mjs/{data-structures → src/data-structures}/stack/stack.js +0 -0
  639. /package/dist/mjs/{data-structures → src/data-structures}/tree/index.d.ts +0 -0
  640. /package/dist/mjs/{data-structures → src/data-structures}/tree/index.js +0 -0
  641. /package/dist/mjs/{data-structures → src/data-structures}/tree/tree.d.ts +0 -0
  642. /package/dist/mjs/{data-structures → src/data-structures}/tree/tree.js +0 -0
  643. /package/dist/mjs/{data-structures → src/data-structures}/trie/index.d.ts +0 -0
  644. /package/dist/mjs/{data-structures → src/data-structures}/trie/index.js +0 -0
  645. /package/dist/mjs/{data-structures → src/data-structures}/trie/trie.d.ts +0 -0
  646. /package/dist/mjs/{data-structures → src/data-structures}/trie/trie.js +0 -0
  647. /package/dist/mjs/{index.d.ts → src/index.d.ts} +0 -0
  648. /package/dist/mjs/{index.js → src/index.js} +0 -0
  649. /package/dist/mjs/{interfaces → src/interfaces}/binary-tree.d.ts +0 -0
  650. /package/dist/mjs/{interfaces → src/interfaces}/binary-tree.js +0 -0
  651. /package/dist/mjs/{interfaces → src/interfaces}/doubly-linked-list.d.ts +0 -0
  652. /package/dist/mjs/{interfaces → src/interfaces}/doubly-linked-list.js +0 -0
  653. /package/dist/mjs/{interfaces → src/interfaces}/graph.d.ts +0 -0
  654. /package/dist/mjs/{interfaces → src/interfaces}/graph.js +0 -0
  655. /package/dist/mjs/{interfaces → src/interfaces}/heap.d.ts +0 -0
  656. /package/dist/mjs/{interfaces → src/interfaces}/heap.js +0 -0
  657. /package/dist/mjs/{interfaces → src/interfaces}/index.d.ts +0 -0
  658. /package/dist/mjs/{interfaces → src/interfaces}/index.js +0 -0
  659. /package/dist/mjs/{interfaces → src/interfaces}/navigator.d.ts +0 -0
  660. /package/dist/mjs/{interfaces → src/interfaces}/navigator.js +0 -0
  661. /package/dist/mjs/{interfaces → src/interfaces}/priority-queue.d.ts +0 -0
  662. /package/dist/mjs/{interfaces → src/interfaces}/priority-queue.js +0 -0
  663. /package/dist/mjs/{interfaces → src/interfaces}/segment-tree.d.ts +0 -0
  664. /package/dist/mjs/{interfaces → src/interfaces}/segment-tree.js +0 -0
  665. /package/dist/mjs/{interfaces → src/interfaces}/singly-linked-list.d.ts +0 -0
  666. /package/dist/mjs/{interfaces → src/interfaces}/singly-linked-list.js +0 -0
  667. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
  668. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/avl-tree.js +0 -0
  669. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
  670. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
  671. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
  672. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/binary-tree.js +0 -0
  673. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/bst.d.ts +0 -0
  674. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/bst.js +0 -0
  675. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/index.d.ts +0 -0
  676. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/index.js +0 -0
  677. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
  678. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/rb-tree.js +0 -0
  679. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
  680. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/segment-tree.js +0 -0
  681. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
  682. /package/dist/mjs/{types → src/types}/data-structures/binary-tree/tree-multiset.js +0 -0
  683. /package/dist/mjs/{types → src/types}/data-structures/graph/abstract-graph.d.ts +0 -0
  684. /package/dist/mjs/{types → src/types}/data-structures/graph/abstract-graph.js +0 -0
  685. /package/dist/mjs/{types → src/types}/data-structures/graph/directed-graph.d.ts +0 -0
  686. /package/dist/mjs/{types → src/types}/data-structures/graph/directed-graph.js +0 -0
  687. /package/dist/mjs/{types → src/types}/data-structures/graph/index.d.ts +0 -0
  688. /package/dist/mjs/{types → src/types}/data-structures/graph/index.js +0 -0
  689. /package/dist/mjs/{types → src/types}/data-structures/graph/map-graph.d.ts +0 -0
  690. /package/dist/mjs/{types → src/types}/data-structures/graph/map-graph.js +0 -0
  691. /package/dist/mjs/{types → src/types}/data-structures/graph/undirected-graph.d.ts +0 -0
  692. /package/dist/mjs/{types → src/types}/data-structures/graph/undirected-graph.js +0 -0
  693. /package/dist/mjs/{types → src/types}/data-structures/hash/coordinate-map.d.ts +0 -0
  694. /package/dist/mjs/{types → src/types}/data-structures/hash/coordinate-map.js +0 -0
  695. /package/dist/mjs/{types → src/types}/data-structures/hash/coordinate-set.d.ts +0 -0
  696. /package/dist/mjs/{types → src/types}/data-structures/hash/coordinate-set.js +0 -0
  697. /package/dist/mjs/{types → src/types}/data-structures/hash/hash-map.d.ts +0 -0
  698. /package/dist/mjs/{types → src/types}/data-structures/hash/hash-map.js +0 -0
  699. /package/dist/mjs/{types → src/types}/data-structures/hash/hash-table.d.ts +0 -0
  700. /package/dist/mjs/{types → src/types}/data-structures/hash/hash-table.js +0 -0
  701. /package/dist/mjs/{types → src/types}/data-structures/hash/index.d.ts +0 -0
  702. /package/dist/mjs/{types → src/types}/data-structures/hash/index.js +0 -0
  703. /package/dist/mjs/{types → src/types}/data-structures/hash/tree-map.d.ts +0 -0
  704. /package/dist/mjs/{types → src/types}/data-structures/hash/tree-map.js +0 -0
  705. /package/dist/mjs/{types → src/types}/data-structures/hash/tree-set.d.ts +0 -0
  706. /package/dist/mjs/{types → src/types}/data-structures/hash/tree-set.js +0 -0
  707. /package/dist/mjs/{types → src/types}/data-structures/heap/heap.d.ts +0 -0
  708. /package/dist/mjs/{types → src/types}/data-structures/heap/heap.js +0 -0
  709. /package/dist/mjs/{types → src/types}/data-structures/heap/index.d.ts +0 -0
  710. /package/dist/mjs/{types → src/types}/data-structures/heap/index.js +0 -0
  711. /package/dist/mjs/{types → src/types}/data-structures/heap/max-heap.d.ts +0 -0
  712. /package/dist/mjs/{types → src/types}/data-structures/heap/max-heap.js +0 -0
  713. /package/dist/mjs/{types → src/types}/data-structures/heap/min-heap.d.ts +0 -0
  714. /package/dist/mjs/{types → src/types}/data-structures/heap/min-heap.js +0 -0
  715. /package/dist/mjs/{types → src/types}/data-structures/index.d.ts +0 -0
  716. /package/dist/mjs/{types → src/types}/data-structures/index.js +0 -0
  717. /package/dist/mjs/{types → src/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
  718. /package/dist/mjs/{types → src/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
  719. /package/dist/mjs/{types → src/types}/data-structures/linked-list/index.d.ts +0 -0
  720. /package/dist/mjs/{types → src/types}/data-structures/linked-list/index.js +0 -0
  721. /package/dist/mjs/{types → src/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
  722. /package/dist/mjs/{types → src/types}/data-structures/linked-list/singly-linked-list.js +0 -0
  723. /package/dist/mjs/{types → src/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
  724. /package/dist/mjs/{types → src/types}/data-structures/linked-list/skip-linked-list.js +0 -0
  725. /package/dist/mjs/{types → src/types}/data-structures/matrix/index.d.ts +0 -0
  726. /package/dist/mjs/{types → src/types}/data-structures/matrix/index.js +0 -0
  727. /package/dist/mjs/{types → src/types}/data-structures/matrix/matrix.d.ts +0 -0
  728. /package/dist/mjs/{types → src/types}/data-structures/matrix/matrix.js +0 -0
  729. /package/dist/mjs/{types → src/types}/data-structures/matrix/matrix2d.d.ts +0 -0
  730. /package/dist/mjs/{types → src/types}/data-structures/matrix/matrix2d.js +0 -0
  731. /package/dist/mjs/{types → src/types}/data-structures/matrix/navigator.d.ts +0 -0
  732. /package/dist/mjs/{types → src/types}/data-structures/matrix/navigator.js +0 -0
  733. /package/dist/mjs/{types → src/types}/data-structures/matrix/vector2d.d.ts +0 -0
  734. /package/dist/mjs/{types → src/types}/data-structures/matrix/vector2d.js +0 -0
  735. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/index.d.ts +0 -0
  736. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/index.js +0 -0
  737. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
  738. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
  739. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
  740. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
  741. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
  742. /package/dist/mjs/{types → src/types}/data-structures/priority-queue/priority-queue.js +0 -0
  743. /package/dist/mjs/{types → src/types}/data-structures/queue/deque.d.ts +0 -0
  744. /package/dist/mjs/{types → src/types}/data-structures/queue/deque.js +0 -0
  745. /package/dist/mjs/{types → src/types}/data-structures/queue/index.d.ts +0 -0
  746. /package/dist/mjs/{types → src/types}/data-structures/queue/index.js +0 -0
  747. /package/dist/mjs/{types → src/types}/data-structures/queue/queue.d.ts +0 -0
  748. /package/dist/mjs/{types → src/types}/data-structures/queue/queue.js +0 -0
  749. /package/dist/mjs/{types → src/types}/data-structures/stack/index.d.ts +0 -0
  750. /package/dist/mjs/{types → src/types}/data-structures/stack/index.js +0 -0
  751. /package/dist/mjs/{types → src/types}/data-structures/stack/stack.d.ts +0 -0
  752. /package/dist/mjs/{types → src/types}/data-structures/stack/stack.js +0 -0
  753. /package/dist/mjs/{types → src/types}/data-structures/tree/index.d.ts +0 -0
  754. /package/dist/mjs/{types → src/types}/data-structures/tree/index.js +0 -0
  755. /package/dist/mjs/{types → src/types}/data-structures/tree/tree.d.ts +0 -0
  756. /package/dist/mjs/{types → src/types}/data-structures/tree/tree.js +0 -0
  757. /package/dist/mjs/{types → src/types}/data-structures/trie/index.d.ts +0 -0
  758. /package/dist/mjs/{types → src/types}/data-structures/trie/index.js +0 -0
  759. /package/dist/mjs/{types → src/types}/data-structures/trie/trie.d.ts +0 -0
  760. /package/dist/mjs/{types → src/types}/data-structures/trie/trie.js +0 -0
  761. /package/dist/mjs/{types → src/types}/helpers.d.ts +0 -0
  762. /package/dist/mjs/{types → src/types}/helpers.js +0 -0
  763. /package/dist/mjs/{types → src/types}/index.d.ts +0 -0
  764. /package/dist/mjs/{types → src/types}/index.js +0 -0
  765. /package/dist/mjs/{types → src/types}/utils/index.d.ts +0 -0
  766. /package/dist/mjs/{types → src/types}/utils/index.js +0 -0
  767. /package/dist/mjs/{types → src/types}/utils/utils.d.ts +0 -0
  768. /package/dist/mjs/{types → src/types}/utils/utils.js +0 -0
  769. /package/dist/mjs/{types → src/types}/utils/validate-type.d.ts +0 -0
  770. /package/dist/mjs/{types → src/types}/utils/validate-type.js +0 -0
  771. /package/dist/mjs/{utils → src/utils}/index.d.ts +0 -0
  772. /package/dist/mjs/{utils → src/utils}/index.js +0 -0
  773. /package/dist/mjs/{utils → src/utils}/utils.d.ts +0 -0
  774. /package/dist/mjs/{utils → src/utils}/utils.js +0 -0
@@ -1,825 +0,0 @@
1
- import {Trie, TrieNode} from '../../../../src';
2
-
3
- describe('TrieNode', () => {
4
- it('should create a TrieNode with the given value', () => {
5
- const node = new TrieNode('a');
6
- expect(node.key).toBe('a');
7
- expect(node.isEnd).toBe(false);
8
- expect(node.children.size).toBe(0);
9
- });
10
-
11
- it('should add a child to TrieNode', () => {
12
- const parentNode = new TrieNode('a');
13
- const childNode = new TrieNode('b');
14
- parentNode.children.set('b', childNode);
15
-
16
- expect(parentNode.children.size).toBe(1);
17
- expect(parentNode.children.get('b')).toBe(childNode);
18
- });
19
-
20
- it('should set isEnd property correctly', () => {
21
- const node = new TrieNode('a');
22
- node.isEnd = true;
23
- expect(node.isEnd).toBe(true);
24
- });
25
- });
26
-
27
- describe('Trie', () => {
28
- it('should create an empty Trie', () => {
29
- const trie = new Trie();
30
- expect(trie.root.key).toBe('');
31
- expect(trie.root.children.size).toBe(0);
32
- });
33
-
34
- it('should add words to Trie', () => {
35
- const trie = new Trie();
36
- trie.add('apple');
37
- trie.add('app');
38
- expect(trie.has('apple')).toBe(true);
39
- expect(trie.has('app')).toBe(true);
40
- expect(trie.has('banana')).toBe(false);
41
- });
42
-
43
- it('should check if a string is an absolute prefix', () => {
44
- const trie = new Trie();
45
- trie.add('apple');
46
- trie.add('app');
47
- expect(trie.hasPurePrefix('appl')).toBe(true);
48
- expect(trie.hasPurePrefix('apples')).toBe(false);
49
- });
50
-
51
- it('should check if a string is a prefix', () => {
52
- const trie = new Trie();
53
- trie.add('apple');
54
- trie.add('app');
55
- expect(trie.hasPrefix('app')).toBe(true);
56
- expect(trie.hasPrefix('banana')).toBe(false);
57
- });
58
-
59
- it('should check if a string is a common prefix', () => {
60
- const trie = new Trie();
61
- trie.add('apple');
62
- trie.add('app');
63
- expect(trie.hasCommonPrefix('ap')).toBe(true);
64
- expect(trie.hasCommonPrefix('app')).toBe(true);
65
- expect(trie.hasCommonPrefix('b')).toBe(false);
66
- });
67
-
68
- it('should get the longest common prefix', () => {
69
- const trie = new Trie();
70
- trie.add('apple');
71
- trie.add('app');
72
- expect(trie.getLongestCommonPrefix()).toBe('app');
73
- });
74
-
75
- it('should get all words with a given prefix', () => {
76
- const trie = new Trie();
77
- trie.add('apple');
78
- trie.add('app');
79
- trie.add('application');
80
- const words = trie.getWords('app');
81
- expect(words).toEqual(['apple', 'application', 'app']);
82
- });
83
-
84
- it('should delete words from Trie', () => {
85
- const trie = new Trie();
86
- trie.add('apple');
87
- trie.add('app');
88
- expect(trie.has('apple')).toBe(true);
89
- trie.delete('apple');
90
- expect(trie.has('apple')).toBe(false);
91
- expect(trie.has('app')).toBe(true);
92
- trie.delete('app');
93
- expect(trie.has('app')).toBe(false);
94
- });
95
-
96
- it('should suggestion Trie work well', () => {
97
- const trie = new Trie();
98
- const products = ['carpet', 'cart', 'car', 'camera'];
99
- products.forEach(product => trie.add(product));
100
- expect(trie.getWords('car', 2)).toEqual(['carpet', 'cart']);
101
- const prods = [
102
- 'Phone',
103
- 'TV',
104
- 'Laptop',
105
- 'Washing Machine',
106
- 'Refrigerator',
107
- 'Air Conditioner',
108
- 'Mouse',
109
- 'Keyboard',
110
- 'Headphones',
111
- 'Watch',
112
- 'Fan',
113
- 'Chair',
114
- 'Table',
115
- 'Bookshelf',
116
- 'Lamp',
117
- 'Camera',
118
- 'Gaming Console',
119
- 'Projector',
120
- 'Printer',
121
- 'Robot Vacuum',
122
- 'Microwave',
123
- 'Toaster',
124
- 'Coffee Maker',
125
- 'Blender',
126
- 'Vacuum Cleaner',
127
- 'Drill',
128
- 'Router',
129
- 'Monitor',
130
- 'Tablet',
131
- 'Speakers',
132
- 'Smartwatch',
133
- 'Hair Dryer',
134
- 'Iron',
135
- 'Microwave Oven',
136
- 'Oven',
137
- 'Blu-ray Player',
138
- 'Carpet Cleaner',
139
- 'Recliner',
140
- 'Desk',
141
- 'Pen',
142
- 'Pencil',
143
- 'Notepad',
144
- 'Backpack',
145
- 'Sunglasses',
146
- 'Umbrella',
147
- 'Jacket',
148
- 'Shoes',
149
- 'Bracelet',
150
- 'Socks',
151
- 'Hat',
152
- 'Scarf',
153
- 'Gloves',
154
- 'Bicycle',
155
- 'Scooter',
156
- 'Skateboard',
157
- 'Surfboard',
158
- 'Soccer Ball',
159
- 'Basketball',
160
- 'Tennis Racket',
161
- 'Golf Clubs',
162
- 'Baseball Bat',
163
- 'Fishing Rod',
164
- 'Hiking Boots',
165
- 'Tent',
166
- 'Sleeping Bag',
167
- 'Camp Stove',
168
- 'Duffle Bag',
169
- 'Guitar',
170
- 'Piano',
171
- 'Violin',
172
- 'Drums',
173
- 'Trumpet',
174
- 'Harmonica',
175
- 'Flute',
176
- 'Microphone',
177
- 'Amplifier',
178
- 'Speaker System',
179
- 'Couch',
180
- 'Coffee Table',
181
- 'Dining Table',
182
- 'Sideboard',
183
- 'Bed',
184
- 'Mattress',
185
- 'Pillow',
186
- 'Blanket',
187
- 'Rug',
188
- 'Dresser',
189
- 'Wardrobe',
190
- 'Dining Chair',
191
- 'Cabinet',
192
- 'Shower Curtain',
193
- 'Toothbrush',
194
- 'Toothpaste',
195
- 'Shampoo',
196
- 'Soap',
197
- 'Razor',
198
- 'Towel',
199
- 'Toilet Paper',
200
- 'Laundry Detergent',
201
- 'Dish Soap',
202
- 'Broom',
203
- 'Mop',
204
- 'Trash Can',
205
- 'Ironing Board',
206
- 'Food Processor',
207
- 'Slow Cooker',
208
- 'Stand Mixer',
209
- 'Cutting Board',
210
- 'Knife Set',
211
- 'Dining Set',
212
- 'Silverware Set',
213
- 'Bakeware Set',
214
- 'Cookware Set',
215
- 'Frying Pan',
216
- 'Baking Sheet',
217
- 'Mixing Bowls',
218
- 'Can Opener',
219
- 'Peeler',
220
- 'Measuring Cups',
221
- 'Utensil Set',
222
- 'Dish Rack',
223
- 'Storage Containers',
224
- 'Trash Bags',
225
- 'Aluminum Foil',
226
- 'Plastic Wrap',
227
- 'Ziplock Bags',
228
- 'Cleaning Supplies',
229
- 'Bath Towels',
230
- 'Hand Towels',
231
- 'Face Towels',
232
- 'Bath Mat',
233
- 'Shower Caddy',
234
- 'Soap Dispenser',
235
- 'Toothbrush Holder',
236
- 'Shower Head',
237
- 'Toilet Brush',
238
- 'Plunger',
239
- 'Hair Straightener',
240
- 'Curling Iron',
241
- 'Makeup Mirror',
242
- 'Shaving Kit',
243
- 'Cosmetic Bag',
244
- 'Perfume',
245
- 'Cologne',
246
- 'Shower Gel',
247
- 'Lotion',
248
- 'Deodorant',
249
- 'Sunscreen',
250
- 'Toilet Paper Holder',
251
- 'Laundry Basket',
252
- 'Step Stool',
253
- 'Flashlight',
254
- 'Batteries',
255
- 'Power Strip',
256
- 'Extension Cord',
257
- 'Toolbox',
258
- 'Screwdriver Set',
259
- 'Wrench',
260
- 'Pliers',
261
- 'Hammer',
262
- 'Tape Measure',
263
- 'Level',
264
- 'Utility Knife',
265
- 'Cordless Drill',
266
- 'Safety Glasses',
267
- 'Tool Belt',
268
- 'Ladder',
269
- 'Paint Brushes',
270
- 'Paint Rollers',
271
- 'Drop Cloth',
272
- "Painter's Tape",
273
- 'Paint Cans',
274
- 'Wallpaper',
275
- 'Wallpaper Paste',
276
- 'Wallpaper Brush',
277
- 'Wallpaper Roller',
278
- 'Curtains',
279
- 'Curtain Rod',
280
- 'Curtain Rings',
281
- 'Blinds',
282
- 'Rugs',
283
- 'Wall Clock',
284
- 'Alarm Clock',
285
- 'Desk Lamp',
286
- 'Ceiling Fan',
287
- 'Chandelier',
288
- 'Floor Lamp',
289
- 'Bedside Lamp',
290
- 'Lawn Mower',
291
- 'Hedge Trimmer',
292
- 'Leaf Blower',
293
- 'Garden Hose',
294
- 'Sprinkler',
295
- 'Gardening Tools',
296
- 'Grill',
297
- 'BBQ Tools',
298
- 'Cooler',
299
- 'Picnic Basket',
300
- 'Camping Gear',
301
- 'Pocket Knife',
302
- 'Fishing Gear',
303
- 'Boat',
304
- 'Life Jacket',
305
- 'Swimwear',
306
- 'Beach Towel',
307
- 'Beach Umbrella',
308
- 'Wetsuit',
309
- 'Snowboard',
310
- 'Ski Equipment',
311
- 'Snow Boots',
312
- 'Snow Gloves',
313
- 'Snow Goggles',
314
- 'Snowshoes',
315
- 'Sled',
316
- 'Ice Skates',
317
- 'Frisbee',
318
- 'Pool Table',
319
- 'Ping Pong Table',
320
- 'Dartboard',
321
- 'Chess Set',
322
- 'Board Games',
323
- 'Playing Cards',
324
- 'Puzzle',
325
- 'Video Games',
326
- 'Gaming Chair',
327
- 'VR Headset',
328
- 'Binoculars',
329
- 'Telescope',
330
- 'Drone',
331
- 'Action Camera',
332
- 'Smartphone',
333
- 'Desktop Computer',
334
- 'Scanner',
335
- 'External Hard Drive',
336
- 'USB Flash Drive',
337
- 'Computer Keyboard',
338
- 'Computer Mouse',
339
- 'Webcam',
340
- 'Modem',
341
- 'Ethernet Cable',
342
- 'Wireless Headphones',
343
- 'Bluetooth Speaker',
344
- 'Earbuds',
345
- 'Fitness Tracker',
346
- 'Running Shoes',
347
- 'Cycling Helmet',
348
- 'Yoga Mat',
349
- 'Dumbbells',
350
- 'Resistance Bands',
351
- 'Exercise Ball',
352
- 'Jump Rope',
353
- 'Treadmill',
354
- 'Exercise Bike',
355
- 'Elliptical Machine',
356
- 'Weight Bench',
357
- 'Gym Bag',
358
- 'Tennis Shoes',
359
- 'Swimsuit',
360
- 'Goggles',
361
- 'Snorkel',
362
- 'Life Vest',
363
- 'Bicycle Helmet',
364
- 'Roller Skates',
365
- 'Inline Skates',
366
- 'Luggage Set',
367
- 'Travel Pillow',
368
- 'Suitcase',
369
- 'Carry-On Bag',
370
- 'Checked Bag',
371
- 'Tote Bag',
372
- 'Travel Adapter',
373
- 'Neck Pillow',
374
- 'Sleep Mask',
375
- 'Portable Charger',
376
- 'Camera Bag',
377
- 'Laptop Bag',
378
- 'Briefcase',
379
- 'Hiking Backpack',
380
- 'Hydration Pack',
381
- 'Duffel Bag',
382
- 'Messenger Bag',
383
- 'Shoulder Bag',
384
- 'Clutch',
385
- 'Wallet',
386
- 'Crossbody Bag',
387
- 'Satchel',
388
- 'Bucket Bag',
389
- 'Hobo Bag',
390
- 'Tennis Bag',
391
- 'Golf Bag',
392
- 'Weekender Bag',
393
- 'Beach Bag',
394
- 'Ski Bag',
395
- 'Snowboard Bag',
396
- 'Snowshoe Bag',
397
- 'Surfboard Bag',
398
- 'Wakeboard Bag',
399
- 'Kiteboard Bag',
400
- 'Skateboard Bag',
401
- 'Roller Skates Bag',
402
- 'Scuba Gear Bag',
403
- 'Fishing Rod Bag',
404
- 'Guitar Case',
405
- 'Violin Case',
406
- 'Trumpet Case',
407
- 'Flute Case',
408
- 'Clarinet Case',
409
- 'Saxophone Case',
410
- 'Keyboard Case',
411
- 'Drum Case',
412
- 'Speaker Case',
413
- 'Microphone Case',
414
- 'Camera Case',
415
- 'Tripod Bag',
416
- 'Binocular Case',
417
- 'Telescope Case',
418
- 'Art Supplies',
419
- 'Paints',
420
- 'Brushes',
421
- 'Canvas',
422
- 'Easel',
423
- 'Sketchbook',
424
- 'Pencils',
425
- 'Watercolors',
426
- 'Oil Paints',
427
- 'Acrylic Paints',
428
- 'Charcoal',
429
- 'Pastels',
430
- 'Markers',
431
- 'Colored Pencils',
432
- 'Crayons',
433
- 'Chalk',
434
- 'Ink',
435
- 'Pottery Wheel',
436
- 'Clay',
437
- 'Pottery Tools',
438
- 'Knitting Needles',
439
- 'Yarn',
440
- 'Crochet Hooks',
441
- 'Sewing Machine',
442
- 'Fabric',
443
- 'Thread',
444
- 'Sewing Needles',
445
- 'Embroidery Hoop',
446
- 'Cross-Stitch Kit',
447
- 'Quilting Kit',
448
- 'Model Kit',
449
- 'Remote Control Car',
450
- 'Train Set',
451
- 'LEGO Set',
452
- 'Building Blocks',
453
- 'Dollhouse',
454
- 'Action Figures',
455
- 'Video Game Console',
456
- 'Controller',
457
- 'Virtual Reality Headset',
458
- 'Poker Set',
459
- 'Checkers Set',
460
- 'Backgammon Set',
461
- 'Dominoes Set',
462
- 'Jigsaw Puzzle',
463
- 'Racing Game',
464
- 'Adventure Game',
465
- 'Role-Playing Game',
466
- 'First-Person Shooter',
467
- 'Simulation Game',
468
- 'Strategy Game',
469
- 'Sports Game',
470
- 'RPG Game',
471
- 'Action-Adventure Game',
472
- 'Fighting Game',
473
- 'Platform Game',
474
- 'Music Game',
475
- 'Educational Game',
476
- 'Puzzle Game',
477
- 'Arcade Game',
478
- 'Card Game',
479
- 'Board Game',
480
- 'Outdoor Game',
481
- 'Indoor Game',
482
- 'Word Game',
483
- 'Brain Teaser',
484
- 'Logic Puzzle',
485
- 'Trivia Game',
486
- 'Classic Game',
487
- 'Party Game',
488
- 'Family Game',
489
- "Children's Game",
490
- 'Adult Game',
491
- 'Dice Game',
492
- 'Tile Game',
493
- 'Electronic Game',
494
- 'Video Game',
495
- 'Retro Game',
496
- 'Computer Game',
497
- 'Console Game',
498
- 'Mobile Game',
499
- 'PC Game',
500
- 'VR Game',
501
- 'Deck-Building Game',
502
- 'Cooperative Game',
503
- 'Competitive Game',
504
- 'Social Deduction Game',
505
- 'Trading Card Game',
506
- 'Collectible Card Game',
507
- 'Miniatures Game',
508
- 'Tabletop Game',
509
- 'War Game',
510
- 'Fantasy Game',
511
- 'Science Fiction Game',
512
- 'Horror Game',
513
- 'Mystery Game',
514
- 'Abstract Game',
515
- 'Eurogame',
516
- 'Ameritrash Game',
517
- 'Wargame',
518
- '2-Player Game',
519
- 'Drinking Game',
520
- 'Action Figure',
521
- 'Playset',
522
- 'Educational Toy',
523
- 'Stuffed Animal',
524
- 'Doll',
525
- 'Remote Control Toy',
526
- 'Toy Car',
527
- 'Toy Train',
528
- 'Pretend Play Toy',
529
- 'Construction Toy',
530
- 'Art and Craft Kit',
531
- 'Musical Toy',
532
- 'Science Toy',
533
- 'STEM Toy',
534
- 'Puzzle Toy',
535
- 'Building Toy',
536
- 'Magnetic Toy',
537
- 'Robot Toy',
538
- 'Outdoor Toy',
539
- 'Sports Toy',
540
- 'Board Game Expansion',
541
- 'Shooter Game',
542
- 'Learning Toy',
543
- 'Teaching Aid',
544
- 'Flashcards',
545
- 'Alphabet Blocks',
546
- 'Educational Books',
547
- 'Math Toy',
548
- 'Science Kit',
549
- 'Geography Toy',
550
- 'History Toy',
551
- 'Language Learning Toy',
552
- 'Music Toy',
553
- 'Art Toy',
554
- 'STEM Kit',
555
- 'Coding Toy',
556
- 'Robotics Kit',
557
- 'Building Kit',
558
- 'Logic Toy',
559
- 'Spelling Game',
560
- 'Memory Game',
561
- 'Problem-Solving Toy',
562
- 'Critical Thinking Toy',
563
- 'Math Game',
564
- 'Science Game',
565
- 'Geography Game',
566
- 'History Game',
567
- 'Language Learning Game',
568
- 'Art Game',
569
- 'Coding Game',
570
- 'Robotics Game',
571
- 'Building Game',
572
- 'Memory Card',
573
- 'Flash Drive',
574
- 'Internal Hard Drive',
575
- 'Solid State Drive',
576
- 'Optical Drive',
577
- 'USB Hub',
578
- 'Computer Monitor',
579
- 'Mouse Pad',
580
- 'Laptop Stand',
581
- 'Ink Cartridges',
582
- 'Printer Paper',
583
- 'Wireless Router',
584
- 'Wi-Fi Extender',
585
- 'Network Switch',
586
- 'Headset',
587
- 'External Sound Card',
588
- 'Surge Protector',
589
- 'Uninterruptible Power Supply',
590
- 'Cable Management',
591
- 'Office Chair',
592
- 'File Cabinet',
593
- 'Shelves',
594
- 'Filing Supplies',
595
- 'Stapler',
596
- 'Staples',
597
- 'Paper Clips',
598
- 'Binder Clips',
599
- 'Rubber Bands',
600
- 'Envelopes',
601
- 'Mailing Labels',
602
- 'Address Labels',
603
- 'Tape Dispenser',
604
- 'Scissors',
605
- 'Tape',
606
- 'Glue',
607
- 'Whiteboard',
608
- 'Dry Erase Markers',
609
- 'Corkboard',
610
- 'Bulletin Board',
611
- 'Push Pins',
612
- 'Thumbtacks',
613
- 'Desktop Organizer',
614
- 'Calendar',
615
- 'Planner',
616
- 'Notebooks',
617
- 'Legal Pads',
618
- 'Notepads',
619
- 'Ballpoint Pens',
620
- 'Rollerball Pens',
621
- 'Gel Pens',
622
- 'Fountain Pens',
623
- 'Highlighters',
624
- 'Erasers',
625
- 'Pencil Sharpeners',
626
- 'Watercolor Paints',
627
- 'Paintbrushes',
628
- 'Easels',
629
- 'Sketchbooks',
630
- 'Drawing Paper',
631
- 'Scrapbooking Supplies',
632
- 'Craft Paper',
633
- 'Craft Tools',
634
- 'Origami Paper',
635
- 'Calligraphy Supplies',
636
- 'Printmaking Supplies',
637
- 'Molding Clay',
638
- 'Glazes',
639
- 'Kiln',
640
- 'Palette',
641
- 'Canvas Boards',
642
- 'Canvas Rolls',
643
- 'Canvas Panels',
644
- 'Stretched Canvas',
645
- 'Oil Pastels',
646
- 'Watercolor Pencils',
647
- 'Pastel Paper',
648
- 'Fixative Spray',
649
- 'Eraser',
650
- 'Pencil Sharpener',
651
- 'Drawing Pens',
652
- 'Calligraphy Set',
653
- 'Ink Pens',
654
- 'Sketching Charcoal',
655
- 'Blending Stumps',
656
- 'Watercolor Paper',
657
- 'Watercolor Brushes',
658
- 'Watercolor Palette',
659
- 'Watercolor Mediums',
660
- 'Watercolor Ground',
661
- 'Watercolor Markers',
662
- 'Acrylic Brushes',
663
- 'Acrylic Mediums',
664
- 'Palette Knives',
665
- 'Gesso',
666
- 'Acrylic Paper',
667
- 'Airbrush Supplies',
668
- 'Oil Brushes',
669
- 'Oil Mediums',
670
- 'Linseed Oil',
671
- 'Turpentine',
672
- 'Odorless Mineral Spirits',
673
- 'Paper',
674
- 'Drawing Ink',
675
- 'Modeling Tools',
676
- 'Pottery Brushes',
677
- 'Throwing Bats',
678
- 'Apron',
679
- 'Wheel Throwing Kit',
680
- 'Kiln Accessories',
681
- 'Pottery Stamps',
682
- 'Pottery Books',
683
- 'Sculpting Tools',
684
- 'Carving Tools',
685
- 'Wood Carving Tools',
686
- 'Stone Carving Tools',
687
- 'Clay Sculpting Tools',
688
- 'Pottery Tool Set',
689
- 'Pottery Tool Kit',
690
- 'Clay Extruder',
691
- 'Pottery Rib Tools',
692
- 'Sponge',
693
- 'Kiln Furniture',
694
- 'Pyrometer',
695
- 'Kiln Shelves',
696
- 'Kiln Posts',
697
- 'Kiln Stilts',
698
- 'Pottery Wire',
699
- 'Ceramic Tiles',
700
- 'Ceramic Glaze',
701
- 'Raku Glaze',
702
- 'Porcelain Glaze',
703
- 'High-Fire Glaze',
704
- 'Low-Fire Glaze',
705
- 'Cone 6 Glaze',
706
- 'Cone 10 Glaze',
707
- 'Underglaze',
708
- 'Slip',
709
- 'Pottery Clay',
710
- 'Clay Sculpture',
711
- 'Pottery Figurines',
712
- 'Pottery Mugs',
713
- 'Pottery Bowls',
714
- 'Pottery Plates',
715
- 'Pottery Vases',
716
- 'Pottery Teapots',
717
- 'Pottery Platters',
718
- 'Pottery Pitchers',
719
- 'Pottery Planters',
720
- 'Pottery Sculptures',
721
- 'Pottery Wall Art',
722
- 'Pottery Tiles',
723
- 'Pottery Dinnerware',
724
- 'Pottery Serveware',
725
- 'Pottery Bakeware',
726
- 'Pottery Home Decor',
727
- 'Pottery Jewelry',
728
- 'Pottery Kiln',
729
- 'Ceramic Sculpture',
730
- 'Ceramic Figurines',
731
- 'Ceramic Mugs',
732
- 'Ceramic Bowls',
733
- 'Ceramic Plates',
734
- 'Ceramic Vases',
735
- 'Ceramic Teapots',
736
- 'Ceramic Platters',
737
- 'Ceramic Pitchers',
738
- 'Ceramic Planters',
739
- 'Ceramic Sculptures',
740
- 'Ceramic Wall Art',
741
- 'Ceramic Dinnerware',
742
- 'Ceramic Serveware',
743
- 'Ceramic Bakeware',
744
- 'Ceramic Home Decor',
745
- 'Ceramic Jewelry',
746
- 'Ceramic Kiln',
747
- 'Ceramic Wheel',
748
- 'Pottery Glazes',
749
- 'Pottery Wheels',
750
- 'Modeling Clay'
751
- ];
752
- prods.forEach(product => trie.add(product));
753
- expect(trie.getWords('air')).toEqual([]);
754
- });
755
- });
756
-
757
- describe('Trie operations', () => {
758
- let trie: Trie;
759
-
760
- beforeEach(() => {
761
- trie = new Trie();
762
- });
763
-
764
- test('Add and Find Words', () => {
765
- trie.add('apple');
766
- trie.add('banana');
767
- expect(trie.has('apple')).toBe(true);
768
- expect(trie.has('banana')).toBe(true);
769
- expect(trie.has('cherry')).toBe(false);
770
- });
771
-
772
- test('Remove Words', () => {
773
- trie.add('apple');
774
- trie.add('banana');
775
- expect(trie.delete('apple')).toBe(true);
776
- expect(trie.has('apple')).toBe(false);
777
- expect(trie.delete('cherry')).toBe(false);
778
- });
779
-
780
- test('Case Sensitivity', () => {
781
- const caseInsensitiveTrie = new Trie(['apple', 'Banana'], false);
782
- expect(caseInsensitiveTrie.has('APPLE')).toBe(true);
783
- expect(caseInsensitiveTrie.has('banana')).toBe(true);
784
- expect(caseInsensitiveTrie.has('Cherry')).toBe(false);
785
- });
786
-
787
- test('Pure Prefix Check', () => {
788
- trie.add('apple');
789
- expect(trie.hasPurePrefix('appl')).toBe(true);
790
- expect(trie.hasPurePrefix('apple')).toBe(false);
791
- });
792
-
793
- test('Prefix Check', () => {
794
- trie.add('apple');
795
- expect(trie.hasPrefix('app')).toBe(true);
796
- expect(trie.hasPrefix('ban')).toBe(false);
797
- });
798
-
799
- test('Common Prefix Check', () => {
800
- trie.add('apple');
801
- trie.add('appetizer');
802
- expect(trie.hasCommonPrefix('app')).toBe(true);
803
- expect(trie.hasCommonPrefix('apple')).toBe(false);
804
- });
805
-
806
- test('Longest Common Prefix', () => {
807
- trie.add('apple');
808
- trie.add('appetizer');
809
- expect(trie.getLongestCommonPrefix()).toBe('app');
810
- });
811
-
812
- test('Get Words by Prefix', () => {
813
- trie.add('apple');
814
- trie.add('appetizer');
815
- trie.add('banana');
816
- const words = trie.getWords('app', 2); // Get at most 2 words with the prefix 'app'
817
- expect(words).toEqual(['apple', 'appetizer']);
818
- });
819
-
820
- test('Tree Height', () => {
821
- trie.add('apple');
822
- trie.add('banana');
823
- expect(trie.getHeight()).toBe(6); // Assuming 'apple' and 'banana' are the longest words.
824
- });
825
- });