data-structure-typed 1.40.0-rc → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +7 -5
- package/.github/workflows/ci.yml +2 -20
- package/.travis.yml +3 -4
- package/CHANGELOG.md +22 -1
- package/CONTRIBUTING.md +13 -0
- package/README.md +20 -11
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +106 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +348 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +270 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +355 -0
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +1116 -0
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +167 -0
- package/dist/cjs/data-structures/binary-tree/bst.js +513 -0
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/index.d.ts +7 -0
- package/dist/cjs/data-structures/binary-tree/index.js +24 -0
- package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +11 -0
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +22 -0
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/segment-tree.d.ts +67 -0
- package/dist/cjs/data-structures/binary-tree/segment-tree.js +181 -0
- package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/tree-multiset.d.ts +126 -0
- package/dist/cjs/data-structures/binary-tree/tree-multiset.js +356 -0
- package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +313 -0
- package/dist/cjs/data-structures/graph/abstract-graph.js +885 -0
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +194 -0
- package/dist/cjs/data-structures/graph/directed-graph.js +405 -0
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/index.js.map +1 -0
- package/dist/cjs/data-structures/graph/map-graph.d.ts +73 -0
- package/dist/cjs/data-structures/graph/map-graph.js +94 -0
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +120 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js +240 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-map.d.ts +44 -0
- package/dist/cjs/data-structures/hash/coordinate-map.js +63 -0
- package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-set.d.ts +36 -0
- package/dist/cjs/data-structures/hash/coordinate-set.js +53 -0
- package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-map.d.ts +50 -0
- package/dist/cjs/data-structures/hash/hash-map.js +154 -0
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-table.d.ts +103 -0
- package/dist/cjs/data-structures/hash/hash-table.js +237 -0
- package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
- package/dist/cjs/data-structures/hash/index.d.ts +6 -0
- package/dist/cjs/data-structures/hash/index.js +23 -0
- package/dist/cjs/data-structures/hash/index.js.map +1 -0
- package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
- package/dist/cjs/data-structures/heap/heap.d.ts +235 -0
- package/dist/cjs/data-structures/heap/heap.js +516 -0
- package/dist/cjs/data-structures/heap/heap.js.map +1 -0
- package/dist/cjs/data-structures/heap/index.js.map +1 -0
- package/dist/cjs/data-structures/heap/max-heap.d.ts +15 -0
- package/dist/cjs/data-structures/heap/max-heap.js +27 -0
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
- package/dist/cjs/data-structures/heap/min-heap.d.ts +15 -0
- package/dist/cjs/data-structures/heap/min-heap.js +27 -0
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
- package/dist/cjs/data-structures/index.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +570 -0
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +232 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +534 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +80 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +188 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/matrix/index.js.map +1 -0
- package/dist/cjs/data-structures/matrix/matrix.d.ts +21 -0
- package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
- package/dist/cjs/data-structures/matrix/matrix2d.d.ts +107 -0
- package/dist/cjs/data-structures/matrix/matrix2d.js +200 -0
- package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/cjs/data-structures/matrix/navigator.d.ts +52 -0
- package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
- package/dist/cjs/data-structures/matrix/vector2d.d.ts +200 -0
- package/dist/cjs/data-structures/matrix/vector2d.js +291 -0
- package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +27 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +27 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +15 -0
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +18 -0
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/queue/deque.d.ts +161 -0
- package/dist/cjs/data-structures/queue/deque.js +265 -0
- package/dist/cjs/data-structures/queue/deque.js.map +1 -0
- package/dist/cjs/data-structures/queue/index.js.map +1 -0
- package/dist/cjs/data-structures/queue/queue.d.ts +122 -0
- package/dist/cjs/data-structures/queue/queue.js +188 -0
- package/dist/cjs/data-structures/queue/queue.js.map +1 -0
- package/dist/cjs/data-structures/stack/index.js.map +1 -0
- package/dist/cjs/data-structures/stack/stack.d.ts +64 -0
- package/dist/cjs/data-structures/stack/stack.js +95 -0
- package/dist/cjs/data-structures/stack/stack.js.map +1 -0
- package/dist/cjs/data-structures/tree/index.js.map +1 -0
- package/dist/cjs/data-structures/tree/tree.d.ts +8 -0
- package/dist/cjs/data-structures/tree/tree.js +41 -0
- package/dist/cjs/data-structures/tree/tree.js.map +1 -0
- package/dist/cjs/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/data-structures/trie/trie.d.ts +79 -0
- package/dist/cjs/data-structures/trie/trie.js +252 -0
- package/dist/cjs/data-structures/trie/trie.js.map +1 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/binary-tree.d.ts +7 -0
- package/dist/cjs/interfaces/binary-tree.js.map +1 -0
- package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
- package/dist/cjs/interfaces/graph.d.ts +5 -0
- package/dist/cjs/interfaces/graph.js +3 -0
- package/dist/cjs/interfaces/graph.js.map +1 -0
- package/dist/cjs/interfaces/heap.js.map +1 -0
- package/dist/cjs/interfaces/index.d.ts +8 -0
- package/dist/cjs/interfaces/index.js +25 -0
- package/dist/cjs/interfaces/index.js.map +1 -0
- package/dist/cjs/interfaces/navigator.js.map +1 -0
- package/dist/cjs/interfaces/priority-queue.js.map +1 -0
- package/dist/cjs/interfaces/segment-tree.js.map +1 -0
- package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js +3 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js +25 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +7 -0
- package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/index.d.ts +6 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js +23 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +8 -0
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/abstract-graph.d.ts +10 -0
- package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/index.d.ts +3 -0
- package/dist/cjs/types/data-structures/graph/index.js +20 -0
- package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/coordinate-map.js +3 -0
- package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/coordinate-set.js +3 -0
- package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-map.js +3 -0
- package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-table.js +3 -0
- package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/index.js +3 -0
- package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/tree-map.js +3 -0
- package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/tree-set.js +3 -0
- package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/index.d.ts +1 -0
- package/dist/cjs/types/data-structures/heap/index.js +18 -0
- package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/max-heap.js +3 -0
- package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/min-heap.js +3 -0
- package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
- package/dist/cjs/types/data-structures/index.d.ts +11 -0
- package/dist/cjs/types/data-structures/index.js +28 -0
- package/dist/cjs/types/data-structures/index.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/index.d.ts +2 -0
- package/dist/cjs/types/data-structures/linked-list/index.js +19 -0
- package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js +3 -0
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/index.d.ts +1 -0
- package/dist/cjs/types/data-structures/matrix/index.js +18 -0
- package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/matrix.js +3 -0
- package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/matrix2d.js +3 -0
- package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/vector2d.js +3 -0
- package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/index.js +20 -0
- package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js +3 -0
- package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js +3 -0
- package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/deque.js +3 -0
- package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/index.js +19 -0
- package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/queue.js +3 -0
- package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/index.js +18 -0
- package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/stack.js +3 -0
- package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/index.js +18 -0
- package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/tree.js +3 -0
- package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/index.js +18 -0
- package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/trie.js +3 -0
- package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
- package/dist/cjs/types/helpers.d.ts +8 -0
- package/dist/cjs/types/helpers.js +10 -0
- package/dist/cjs/types/helpers.js.map +1 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/utils/index.js.map +1 -0
- package/dist/cjs/types/utils/utils.js.map +1 -0
- package/dist/cjs/types/utils/validate-type.js.map +1 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/utils.d.ts +20 -0
- package/dist/cjs/utils/utils.js +74 -0
- package/dist/cjs/utils/utils.js.map +1 -0
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +106 -0
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +348 -0
- package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
- package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.js +274 -0
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +355 -0
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +1127 -0
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +167 -0
- package/dist/mjs/data-structures/binary-tree/bst.js +509 -0
- package/dist/mjs/data-structures/binary-tree/index.d.ts +7 -0
- package/dist/mjs/data-structures/binary-tree/index.js +23 -0
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +11 -0
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +22 -0
- package/dist/mjs/data-structures/binary-tree/segment-tree.d.ts +67 -0
- package/dist/mjs/data-structures/binary-tree/segment-tree.js +182 -0
- package/dist/mjs/data-structures/binary-tree/tree-multiset.d.ts +126 -0
- package/dist/mjs/data-structures/binary-tree/tree-multiset.js +356 -0
- package/dist/mjs/data-structures/graph/abstract-graph.d.ts +313 -0
- package/dist/mjs/data-structures/graph/abstract-graph.js +883 -0
- package/dist/mjs/data-structures/graph/directed-graph.d.ts +194 -0
- package/dist/mjs/data-structures/graph/directed-graph.js +406 -0
- package/dist/mjs/data-structures/graph/index.js +20 -0
- package/dist/mjs/data-structures/graph/map-graph.d.ts +73 -0
- package/dist/mjs/data-structures/graph/map-graph.js +96 -0
- package/dist/mjs/data-structures/graph/undirected-graph.d.ts +120 -0
- package/dist/mjs/data-structures/graph/undirected-graph.js +239 -0
- package/dist/mjs/data-structures/hash/coordinate-map.d.ts +44 -0
- package/dist/mjs/data-structures/hash/coordinate-map.js +62 -0
- package/dist/mjs/data-structures/hash/coordinate-set.d.ts +36 -0
- package/dist/mjs/data-structures/hash/coordinate-set.js +52 -0
- package/dist/mjs/data-structures/hash/hash-map.d.ts +50 -0
- package/dist/mjs/data-structures/hash/hash-map.js +159 -0
- package/dist/mjs/data-structures/hash/hash-table.d.ts +103 -0
- package/dist/mjs/data-structures/hash/hash-table.js +243 -0
- package/dist/mjs/data-structures/hash/index.d.ts +6 -0
- package/dist/mjs/data-structures/hash/index.js +22 -0
- package/dist/mjs/data-structures/hash/tree-map.js +6 -0
- package/dist/mjs/data-structures/hash/tree-set.js +6 -0
- package/dist/mjs/data-structures/heap/heap.d.ts +235 -0
- package/dist/mjs/data-structures/heap/heap.js +525 -0
- package/dist/mjs/data-structures/heap/index.js +19 -0
- package/dist/mjs/data-structures/heap/max-heap.d.ts +15 -0
- package/dist/mjs/data-structures/heap/max-heap.js +26 -0
- package/dist/mjs/data-structures/heap/min-heap.d.ts +15 -0
- package/dist/mjs/data-structures/heap/min-heap.js +26 -0
- package/dist/mjs/data-structures/index.js +27 -0
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +573 -0
- package/dist/mjs/data-structures/linked-list/index.js +19 -0
- package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +232 -0
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js +538 -0
- package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +80 -0
- package/dist/mjs/data-structures/linked-list/skip-linked-list.js +194 -0
- package/dist/mjs/data-structures/matrix/index.js +20 -0
- package/dist/mjs/data-structures/matrix/matrix.d.ts +21 -0
- package/dist/mjs/data-structures/matrix/matrix.js +29 -0
- package/dist/mjs/data-structures/matrix/matrix2d.d.ts +107 -0
- package/dist/mjs/data-structures/matrix/matrix2d.js +200 -0
- package/dist/mjs/data-structures/matrix/navigator.d.ts +52 -0
- package/dist/mjs/data-structures/matrix/navigator.js +113 -0
- package/dist/mjs/data-structures/matrix/vector2d.d.ts +200 -0
- package/dist/mjs/data-structures/matrix/vector2d.js +293 -0
- package/dist/mjs/data-structures/priority-queue/index.js +19 -0
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +26 -0
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +26 -0
- package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +15 -0
- package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
- package/dist/mjs/data-structures/queue/deque.d.ts +161 -0
- package/dist/mjs/data-structures/queue/deque.js +257 -0
- package/dist/mjs/data-structures/queue/index.js +18 -0
- package/dist/mjs/data-structures/queue/queue.d.ts +122 -0
- package/dist/mjs/data-structures/queue/queue.js +188 -0
- package/dist/mjs/data-structures/stack/index.js +17 -0
- package/dist/mjs/data-structures/stack/stack.d.ts +64 -0
- package/dist/mjs/data-structures/stack/stack.js +95 -0
- package/dist/mjs/data-structures/tree/index.js +17 -0
- package/dist/mjs/data-structures/tree/tree.d.ts +8 -0
- package/dist/mjs/data-structures/tree/tree.js +43 -0
- package/dist/mjs/data-structures/trie/index.js +17 -0
- package/dist/mjs/data-structures/trie/trie.d.ts +79 -0
- package/dist/mjs/data-structures/trie/trie.js +256 -0
- package/dist/mjs/index.js +20 -0
- package/dist/mjs/interfaces/binary-tree.d.ts +7 -0
- package/dist/mjs/interfaces/binary-tree.js +2 -0
- package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
- package/dist/mjs/interfaces/graph.d.ts +5 -0
- package/dist/mjs/interfaces/graph.js +2 -0
- package/dist/mjs/interfaces/heap.js +2 -0
- package/dist/mjs/interfaces/index.d.ts +8 -0
- package/dist/mjs/interfaces/index.js +24 -0
- package/dist/mjs/interfaces/navigator.js +2 -0
- package/dist/mjs/interfaces/priority-queue.js +2 -0
- package/dist/mjs/interfaces/segment-tree.js +2 -0
- package/dist/mjs/interfaces/singly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
- package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.js +24 -0
- package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +7 -0
- package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/index.d.ts +6 -0
- package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +8 -0
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +8 -0
- package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/tree-multiset.d.ts +4 -0
- package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
- package/dist/mjs/types/data-structures/graph/abstract-graph.d.ts +10 -0
- package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
- package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
- package/dist/mjs/types/data-structures/graph/index.d.ts +3 -0
- package/dist/mjs/types/data-structures/graph/index.js +19 -0
- package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
- package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
- package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
- package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
- package/dist/mjs/types/data-structures/hash/index.js +2 -0
- package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
- package/dist/mjs/types/data-structures/heap/heap.js +2 -0
- package/dist/mjs/types/data-structures/heap/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/index.js +17 -0
- package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
- package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
- package/dist/mjs/types/data-structures/index.d.ts +11 -0
- package/dist/mjs/types/data-structures/index.js +27 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/index.d.ts +2 -0
- package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/matrix/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/index.js +17 -0
- package/dist/mjs/types/data-structures/matrix/matrix.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
- package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
- package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/queue/deque.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/deque.js +2 -0
- package/dist/mjs/types/data-structures/queue/index.d.ts +2 -0
- package/dist/mjs/types/data-structures/queue/index.js +18 -0
- package/dist/mjs/types/data-structures/queue/queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/queue.js +2 -0
- package/dist/mjs/types/data-structures/stack/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/index.js +17 -0
- package/dist/mjs/types/data-structures/stack/stack.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/stack.js +2 -0
- package/dist/mjs/types/data-structures/tree/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/index.js +17 -0
- package/dist/mjs/types/data-structures/tree/tree.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/tree.js +2 -0
- package/dist/mjs/types/data-structures/trie/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/index.js +17 -0
- package/dist/mjs/types/data-structures/trie/trie.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/trie.js +2 -0
- package/dist/mjs/types/helpers.d.ts +8 -0
- package/dist/mjs/types/helpers.js +9 -0
- package/dist/mjs/types/index.js +19 -0
- package/dist/mjs/types/utils/index.js +18 -0
- package/dist/mjs/types/utils/utils.js +2 -0
- package/dist/mjs/types/utils/validate-type.js +2 -0
- package/dist/mjs/utils/index.js +17 -0
- package/dist/mjs/utils/utils.d.ts +20 -0
- package/dist/mjs/utils/utils.js +64 -0
- package/dist/umd/data-structure-typed.min.js +27 -0
- package/dist/umd/data-structure-typed.min.js.map +1 -0
- package/package.json +28 -22
- package/src/data-structures/binary-tree/avl-tree.ts +88 -74
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +265 -35
- package/src/data-structures/binary-tree/binary-tree.ts +1241 -26
- package/src/data-structures/binary-tree/bst.ts +217 -237
- package/src/data-structures/binary-tree/index.ts +0 -5
- package/src/data-structures/binary-tree/rb-tree.ts +28 -36
- package/src/data-structures/binary-tree/segment-tree.ts +25 -92
- package/src/data-structures/binary-tree/tree-multiset.ts +113 -422
- package/src/data-structures/graph/abstract-graph.ts +169 -214
- package/src/data-structures/graph/directed-graph.ts +105 -126
- package/src/data-structures/graph/map-graph.ts +29 -57
- package/src/data-structures/graph/undirected-graph.ts +67 -82
- package/src/data-structures/hash/coordinate-map.ts +0 -4
- package/src/data-structures/hash/coordinate-set.ts +0 -4
- package/src/data-structures/hash/hash-map.ts +65 -83
- package/src/data-structures/hash/hash-table.ts +109 -118
- package/src/data-structures/hash/index.ts +0 -1
- package/src/data-structures/hash/tree-map.ts +2 -1
- package/src/data-structures/hash/tree-set.ts +2 -1
- package/src/data-structures/heap/heap.ts +505 -128
- package/src/data-structures/heap/max-heap.ts +16 -21
- package/src/data-structures/heap/min-heap.ts +16 -22
- package/src/data-structures/linked-list/doubly-linked-list.ts +143 -174
- package/src/data-structures/linked-list/singly-linked-list.ts +174 -99
- package/src/data-structures/linked-list/skip-linked-list.ts +104 -49
- package/src/data-structures/matrix/matrix.ts +2 -2
- package/src/data-structures/matrix/matrix2d.ts +12 -14
- package/src/data-structures/matrix/navigator.ts +4 -4
- package/src/data-structures/matrix/vector2d.ts +2 -3
- package/src/data-structures/priority-queue/max-priority-queue.ts +15 -46
- package/src/data-structures/priority-queue/min-priority-queue.ts +15 -47
- package/src/data-structures/priority-queue/priority-queue.ts +7 -350
- package/src/data-structures/queue/deque.ts +62 -77
- package/src/data-structures/queue/queue.ts +39 -21
- package/src/data-structures/stack/stack.ts +13 -9
- package/src/data-structures/tree/tree.ts +10 -38
- package/src/data-structures/trie/trie.ts +108 -71
- package/src/interfaces/binary-tree.ts +7 -4
- package/src/interfaces/graph.ts +7 -0
- package/src/interfaces/index.ts +1 -8
- package/src/types/data-structures/binary-tree/avl-tree.ts +5 -0
- package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
- package/src/types/data-structures/binary-tree/binary-tree.ts +31 -0
- package/src/types/data-structures/binary-tree/bst.ts +11 -0
- package/src/types/data-structures/binary-tree/index.ts +6 -0
- package/src/types/data-structures/binary-tree/rb-tree.ts +8 -0
- package/src/types/data-structures/binary-tree/tree-multiset.ts +6 -0
- package/src/types/data-structures/graph/abstract-graph.ts +11 -0
- package/src/types/data-structures/graph/index.ts +3 -0
- package/src/types/data-structures/graph/undirected-graph.ts +1 -0
- package/src/types/data-structures/hash/coordinate-map.ts +1 -0
- package/src/types/data-structures/hash/coordinate-set.ts +1 -0
- package/src/types/data-structures/hash/hash-map.ts +1 -0
- package/src/types/data-structures/hash/hash-table.ts +1 -0
- package/src/types/data-structures/hash/tree-map.ts +1 -0
- package/src/types/data-structures/hash/tree-set.ts +1 -0
- package/src/types/data-structures/heap/heap.ts +1 -0
- package/src/types/data-structures/heap/index.ts +1 -0
- package/src/types/data-structures/heap/max-heap.ts +1 -0
- package/src/types/data-structures/heap/min-heap.ts +1 -0
- package/src/types/data-structures/index.ts +8 -13
- package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
- package/src/types/data-structures/linked-list/index.ts +2 -0
- package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
- package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
- package/src/types/data-structures/matrix/index.ts +1 -0
- package/src/types/data-structures/matrix/matrix.ts +1 -0
- package/src/types/data-structures/matrix/matrix2d.ts +1 -0
- package/src/types/data-structures/matrix/navigator.ts +14 -0
- package/src/types/data-structures/matrix/vector2d.ts +1 -0
- package/src/types/data-structures/priority-queue/index.ts +3 -0
- package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
- package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
- package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
- package/src/types/data-structures/queue/deque.ts +1 -0
- package/src/types/data-structures/queue/index.ts +2 -0
- package/src/types/data-structures/queue/queue.ts +1 -0
- package/src/types/data-structures/stack/index.ts +1 -0
- package/src/types/data-structures/stack/stack.ts +1 -0
- package/src/types/data-structures/tree/index.ts +1 -0
- package/src/types/data-structures/tree/tree.ts +1 -0
- package/src/types/data-structures/trie/index.ts +1 -0
- package/src/types/data-structures/trie/trie.ts +1 -0
- package/src/types/helpers.ts +11 -1
- package/src/types/utils/utils.ts +1 -1
- package/src/types/utils/validate-type.ts +2 -2
- package/src/utils/utils.ts +7 -0
- package/test/config.js +4 -0
- package/test/config.ts +1 -0
- package/test/integration/avl-tree.test.ts +24 -22
- package/test/integration/bst.test.ts +52 -47
- package/test/integration/index.html +3 -4
- package/test/types/index.js +29 -0
- package/test/types/utils/big-o.js +2 -0
- package/test/types/utils/big-o.ts +1 -0
- package/test/types/utils/index.js +29 -0
- package/test/types/utils/index.ts +1 -0
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +184 -23
- package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +320 -0
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +393 -40
- package/test/unit/data-structures/binary-tree/bst.test.ts +506 -48
- package/test/unit/data-structures/binary-tree/overall.test.ts +8 -7
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +79 -13
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +296 -215
- package/test/unit/data-structures/graph/abstract-graph.test.ts +97 -2
- package/test/unit/data-structures/graph/directed-graph.test.ts +76 -31
- package/test/unit/data-structures/graph/map-graph.test.ts +93 -12
- package/test/unit/data-structures/graph/overall.test.ts +2 -2
- package/test/unit/data-structures/graph/undirected-graph.test.ts +93 -3
- package/test/unit/data-structures/hash/coordinate-map.test.ts +20 -0
- package/test/unit/data-structures/hash/coordinate-set.test.ts +25 -0
- package/test/unit/data-structures/hash/hash-map.test.ts +2 -3
- package/test/unit/data-structures/hash/hash-table.test.ts +10 -8
- package/test/unit/data-structures/heap/heap.test.ts +218 -20
- package/test/unit/data-structures/heap/max-heap.test.ts +50 -42
- package/test/unit/data-structures/heap/min-heap.test.ts +38 -68
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +86 -27
- package/test/unit/data-structures/linked-list/linked-list.test.ts +4 -4
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +71 -27
- package/test/unit/data-structures/linked-list/skip-list.test.ts +33 -2
- package/test/unit/data-structures/matrix/matrix2d.test.ts +207 -0
- package/test/unit/data-structures/matrix/navigator.test.ts +167 -2
- package/test/unit/data-structures/matrix/vector2d.test.ts +171 -0
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +10 -11
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +14 -30
- package/test/unit/data-structures/queue/deque.test.ts +303 -23
- package/test/unit/data-structures/queue/queue.test.ts +52 -8
- package/test/unit/data-structures/tree/tree.test.ts +2 -2
- package/test/unit/data-structures/trie/trie.test.ts +743 -13
- package/test/utils/big-o.js +212 -0
- package/test/utils/big-o.ts +201 -0
- package/test/utils/index.js +30 -0
- package/test/utils/index.ts +1 -1
- package/test/utils/number.js +14 -0
- package/tsconfig-base.json +27 -0
- package/tsconfig-cjs.json +9 -0
- package/tsup.config.js +18 -0
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.LICENSE.txt +15 -0
- package/umd/bundle.min.js.map +1 -1
- package/dist/data-structures/binary-tree/aa-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/aa-tree.js +0 -7
- package/dist/data-structures/binary-tree/aa-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +0 -1199
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/avl-tree.d.ts +0 -94
- package/dist/data-structures/binary-tree/avl-tree.js +0 -336
- package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/b-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/b-tree.js +0 -7
- package/dist/data-structures/binary-tree/b-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -46
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +0 -74
- package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/binary-tree.d.ts +0 -31
- package/dist/data-structures/binary-tree/binary-tree.js +0 -41
- package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/bst.d.ts +0 -133
- package/dist/data-structures/binary-tree/bst.js +0 -554
- package/dist/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/data-structures/binary-tree/index.d.ts +0 -12
- package/dist/data-structures/binary-tree/index.js +0 -29
- package/dist/data-structures/binary-tree/index.js.map +0 -1
- package/dist/data-structures/binary-tree/rb-tree.d.ts +0 -13
- package/dist/data-structures/binary-tree/rb-tree.js +0 -28
- package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/segment-tree.d.ts +0 -83
- package/dist/data-structures/binary-tree/segment-tree.js +0 -229
- package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/splay-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/splay-tree.js +0 -7
- package/dist/data-structures/binary-tree/splay-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +0 -209
- package/dist/data-structures/binary-tree/tree-multiset.js +0 -669
- package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
- package/dist/data-structures/binary-tree/two-three-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/two-three-tree.js +0 -7
- package/dist/data-structures/binary-tree/two-three-tree.js.map +0 -1
- package/dist/data-structures/graph/abstract-graph.d.ts +0 -332
- package/dist/data-structures/graph/abstract-graph.js +0 -925
- package/dist/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/data-structures/graph/directed-graph.d.ts +0 -200
- package/dist/data-structures/graph/directed-graph.js +0 -423
- package/dist/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/data-structures/graph/index.js.map +0 -1
- package/dist/data-structures/graph/map-graph.d.ts +0 -79
- package/dist/data-structures/graph/map-graph.js +0 -112
- package/dist/data-structures/graph/map-graph.js.map +0 -1
- package/dist/data-structures/graph/undirected-graph.d.ts +0 -127
- package/dist/data-structures/graph/undirected-graph.js +0 -253
- package/dist/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/data-structures/hash/coordinate-map.d.ts +0 -45
- package/dist/data-structures/hash/coordinate-map.js +0 -66
- package/dist/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/data-structures/hash/coordinate-set.d.ts +0 -37
- package/dist/data-structures/hash/coordinate-set.js +0 -56
- package/dist/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/data-structures/hash/hash-map.d.ts +0 -56
- package/dist/data-structures/hash/hash-map.js +0 -172
- package/dist/data-structures/hash/hash-map.js.map +0 -1
- package/dist/data-structures/hash/hash-table.d.ts +0 -106
- package/dist/data-structures/hash/hash-table.js +0 -246
- package/dist/data-structures/hash/hash-table.js.map +0 -1
- package/dist/data-structures/hash/index.d.ts +0 -7
- package/dist/data-structures/hash/index.js +0 -24
- package/dist/data-structures/hash/index.js.map +0 -1
- package/dist/data-structures/hash/pair.d.ts +0 -2
- package/dist/data-structures/hash/pair.js +0 -7
- package/dist/data-structures/hash/pair.js.map +0 -1
- package/dist/data-structures/hash/tree-map.js.map +0 -1
- package/dist/data-structures/hash/tree-set.js.map +0 -1
- package/dist/data-structures/heap/heap.d.ts +0 -83
- package/dist/data-structures/heap/heap.js +0 -158
- package/dist/data-structures/heap/heap.js.map +0 -1
- package/dist/data-structures/heap/index.js.map +0 -1
- package/dist/data-structures/heap/max-heap.d.ts +0 -23
- package/dist/data-structures/heap/max-heap.js +0 -31
- package/dist/data-structures/heap/max-heap.js.map +0 -1
- package/dist/data-structures/heap/min-heap.d.ts +0 -24
- package/dist/data-structures/heap/min-heap.js +0 -32
- package/dist/data-structures/heap/min-heap.js.map +0 -1
- package/dist/data-structures/index.js.map +0 -1
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +0 -234
- package/dist/data-structures/linked-list/doubly-linked-list.js +0 -584
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/data-structures/linked-list/index.js.map +0 -1
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +0 -157
- package/dist/data-structures/linked-list/singly-linked-list.js +0 -449
- package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/data-structures/linked-list/skip-linked-list.d.ts +0 -61
- package/dist/data-structures/linked-list/skip-linked-list.js +0 -143
- package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/data-structures/matrix/index.js.map +0 -1
- package/dist/data-structures/matrix/matrix.d.ts +0 -21
- package/dist/data-structures/matrix/matrix.js.map +0 -1
- package/dist/data-structures/matrix/matrix2d.d.ts +0 -108
- package/dist/data-structures/matrix/matrix2d.js +0 -201
- package/dist/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/data-structures/matrix/navigator.d.ts +0 -52
- package/dist/data-structures/matrix/navigator.js.map +0 -1
- package/dist/data-structures/matrix/vector2d.d.ts +0 -201
- package/dist/data-structures/matrix/vector2d.js +0 -292
- package/dist/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/data-structures/priority-queue/index.js.map +0 -1
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +0 -15
- package/dist/data-structures/priority-queue/max-priority-queue.js +0 -44
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +0 -15
- package/dist/data-structures/priority-queue/min-priority-queue.js +0 -45
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +0 -180
- package/dist/data-structures/priority-queue/priority-queue.js +0 -322
- package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/data-structures/queue/deque.d.ts +0 -165
- package/dist/data-structures/queue/deque.js +0 -277
- package/dist/data-structures/queue/deque.js.map +0 -1
- package/dist/data-structures/queue/index.js.map +0 -1
- package/dist/data-structures/queue/queue.d.ts +0 -107
- package/dist/data-structures/queue/queue.js +0 -171
- package/dist/data-structures/queue/queue.js.map +0 -1
- package/dist/data-structures/stack/index.js.map +0 -1
- package/dist/data-structures/stack/stack.d.ts +0 -63
- package/dist/data-structures/stack/stack.js +0 -92
- package/dist/data-structures/stack/stack.js.map +0 -1
- package/dist/data-structures/tree/index.js.map +0 -1
- package/dist/data-structures/tree/tree.d.ts +0 -14
- package/dist/data-structures/tree/tree.js +0 -61
- package/dist/data-structures/tree/tree.js.map +0 -1
- package/dist/data-structures/trie/index.js.map +0 -1
- package/dist/data-structures/trie/trie.d.ts +0 -61
- package/dist/data-structures/trie/trie.js +0 -211
- package/dist/data-structures/trie/trie.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interfaces/abstract-binary-tree.d.ts +0 -7
- package/dist/interfaces/abstract-binary-tree.js +0 -3
- package/dist/interfaces/abstract-binary-tree.js.map +0 -1
- package/dist/interfaces/abstract-graph.d.ts +0 -5
- package/dist/interfaces/abstract-graph.js.map +0 -1
- package/dist/interfaces/avl-tree.d.ts +0 -7
- package/dist/interfaces/avl-tree.js.map +0 -1
- package/dist/interfaces/binary-tree.d.ts +0 -6
- package/dist/interfaces/binary-tree.js.map +0 -1
- package/dist/interfaces/bst.d.ts +0 -6
- package/dist/interfaces/bst.js.map +0 -1
- package/dist/interfaces/directed-graph.d.ts +0 -3
- package/dist/interfaces/directed-graph.js +0 -3
- package/dist/interfaces/directed-graph.js.map +0 -1
- package/dist/interfaces/doubly-linked-list.js.map +0 -1
- package/dist/interfaces/heap.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -15
- package/dist/interfaces/index.js +0 -32
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/navigator.js.map +0 -1
- package/dist/interfaces/priority-queue.js.map +0 -1
- package/dist/interfaces/rb-tree.d.ts +0 -6
- package/dist/interfaces/rb-tree.js +0 -3
- package/dist/interfaces/rb-tree.js.map +0 -1
- package/dist/interfaces/segment-tree.js.map +0 -1
- package/dist/interfaces/singly-linked-list.js.map +0 -1
- package/dist/interfaces/tree-multiset.d.ts +0 -6
- package/dist/interfaces/tree-multiset.js.map +0 -1
- package/dist/interfaces/undirected-graph.d.ts +0 -3
- package/dist/interfaces/undirected-graph.js.map +0 -1
- package/dist/types/data-structures/abstract-binary-tree.d.ts +0 -34
- package/dist/types/data-structures/abstract-binary-tree.js +0 -25
- package/dist/types/data-structures/abstract-binary-tree.js.map +0 -1
- package/dist/types/data-structures/abstract-graph.d.ts +0 -11
- package/dist/types/data-structures/abstract-graph.js +0 -3
- package/dist/types/data-structures/abstract-graph.js.map +0 -1
- package/dist/types/data-structures/avl-tree.d.ts +0 -4
- package/dist/types/data-structures/avl-tree.js +0 -3
- package/dist/types/data-structures/avl-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree.d.ts +0 -4
- package/dist/types/data-structures/binary-tree.js +0 -3
- package/dist/types/data-structures/binary-tree.js.map +0 -1
- package/dist/types/data-structures/bst.d.ts +0 -13
- package/dist/types/data-structures/bst.js +0 -10
- package/dist/types/data-structures/bst.js.map +0 -1
- package/dist/types/data-structures/directed-graph.js.map +0 -1
- package/dist/types/data-structures/doubly-linked-list.js.map +0 -1
- package/dist/types/data-structures/hash.js +0 -3
- package/dist/types/data-structures/hash.js.map +0 -1
- package/dist/types/data-structures/heap.d.ts +0 -3
- package/dist/types/data-structures/heap.js.map +0 -1
- package/dist/types/data-structures/index.d.ts +0 -16
- package/dist/types/data-structures/index.js +0 -33
- package/dist/types/data-structures/index.js.map +0 -1
- package/dist/types/data-structures/map-graph.js.map +0 -1
- package/dist/types/data-structures/navigator.js.map +0 -1
- package/dist/types/data-structures/priority-queue.d.ts +0 -7
- package/dist/types/data-structures/priority-queue.js.map +0 -1
- package/dist/types/data-structures/rb-tree.d.ts +0 -8
- package/dist/types/data-structures/rb-tree.js.map +0 -1
- package/dist/types/data-structures/segment-tree.js.map +0 -1
- package/dist/types/data-structures/singly-linked-list.js.map +0 -1
- package/dist/types/data-structures/tree-multiset.d.ts +0 -4
- package/dist/types/data-structures/tree-multiset.js +0 -3
- package/dist/types/data-structures/tree-multiset.js.map +0 -1
- package/dist/types/helpers.js +0 -3
- package/dist/types/helpers.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/utils/index.js.map +0 -1
- package/dist/types/utils/utils.js.map +0 -1
- package/dist/types/utils/validate-type.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/utils.d.ts +0 -19
- package/dist/utils/utils.js +0 -67
- package/dist/utils/utils.js.map +0 -1
- package/lib/data-structures/binary-tree/aa-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/aa-tree.js +0 -2
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +0 -1193
- package/lib/data-structures/binary-tree/avl-tree.d.ts +0 -94
- package/lib/data-structures/binary-tree/avl-tree.js +0 -330
- package/lib/data-structures/binary-tree/b-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/b-tree.js +0 -2
- package/lib/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -46
- package/lib/data-structures/binary-tree/binary-indexed-tree.js +0 -69
- package/lib/data-structures/binary-tree/binary-tree.d.ts +0 -31
- package/lib/data-structures/binary-tree/binary-tree.js +0 -35
- package/lib/data-structures/binary-tree/bst.d.ts +0 -133
- package/lib/data-structures/binary-tree/bst.js +0 -548
- package/lib/data-structures/binary-tree/index.d.ts +0 -12
- package/lib/data-structures/binary-tree/index.js +0 -12
- package/lib/data-structures/binary-tree/rb-tree.d.ts +0 -13
- package/lib/data-structures/binary-tree/rb-tree.js +0 -22
- package/lib/data-structures/binary-tree/segment-tree.d.ts +0 -83
- package/lib/data-structures/binary-tree/segment-tree.js +0 -223
- package/lib/data-structures/binary-tree/splay-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/splay-tree.js +0 -2
- package/lib/data-structures/binary-tree/tree-multiset.d.ts +0 -209
- package/lib/data-structures/binary-tree/tree-multiset.js +0 -663
- package/lib/data-structures/binary-tree/two-three-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/two-three-tree.js +0 -2
- package/lib/data-structures/graph/abstract-graph.d.ts +0 -332
- package/lib/data-structures/graph/abstract-graph.js +0 -918
- package/lib/data-structures/graph/directed-graph.d.ts +0 -200
- package/lib/data-structures/graph/directed-graph.js +0 -416
- package/lib/data-structures/graph/index.js +0 -4
- package/lib/data-structures/graph/map-graph.d.ts +0 -79
- package/lib/data-structures/graph/map-graph.js +0 -105
- package/lib/data-structures/graph/undirected-graph.d.ts +0 -127
- package/lib/data-structures/graph/undirected-graph.js +0 -246
- package/lib/data-structures/hash/coordinate-map.d.ts +0 -45
- package/lib/data-structures/hash/coordinate-map.js +0 -61
- package/lib/data-structures/hash/coordinate-set.d.ts +0 -37
- package/lib/data-structures/hash/coordinate-set.js +0 -51
- package/lib/data-structures/hash/hash-map.d.ts +0 -56
- package/lib/data-structures/hash/hash-map.js +0 -167
- package/lib/data-structures/hash/hash-table.d.ts +0 -106
- package/lib/data-structures/hash/hash-table.js +0 -240
- package/lib/data-structures/hash/index.d.ts +0 -7
- package/lib/data-structures/hash/index.js +0 -7
- package/lib/data-structures/hash/pair.d.ts +0 -2
- package/lib/data-structures/hash/pair.js +0 -2
- package/lib/data-structures/hash/tree-map.js +0 -2
- package/lib/data-structures/hash/tree-set.js +0 -2
- package/lib/data-structures/heap/heap.d.ts +0 -83
- package/lib/data-structures/heap/heap.js +0 -152
- package/lib/data-structures/heap/index.js +0 -3
- package/lib/data-structures/heap/max-heap.d.ts +0 -23
- package/lib/data-structures/heap/max-heap.js +0 -26
- package/lib/data-structures/heap/min-heap.d.ts +0 -24
- package/lib/data-structures/heap/min-heap.js +0 -27
- package/lib/data-structures/index.js +0 -11
- package/lib/data-structures/linked-list/doubly-linked-list.d.ts +0 -234
- package/lib/data-structures/linked-list/doubly-linked-list.js +0 -578
- package/lib/data-structures/linked-list/index.js +0 -3
- package/lib/data-structures/linked-list/singly-linked-list.d.ts +0 -157
- package/lib/data-structures/linked-list/singly-linked-list.js +0 -443
- package/lib/data-structures/linked-list/skip-linked-list.d.ts +0 -61
- package/lib/data-structures/linked-list/skip-linked-list.js +0 -137
- package/lib/data-structures/matrix/index.js +0 -4
- package/lib/data-structures/matrix/matrix.d.ts +0 -21
- package/lib/data-structures/matrix/matrix.js +0 -24
- package/lib/data-structures/matrix/matrix2d.d.ts +0 -108
- package/lib/data-structures/matrix/matrix2d.js +0 -196
- package/lib/data-structures/matrix/navigator.d.ts +0 -52
- package/lib/data-structures/matrix/navigator.js +0 -101
- package/lib/data-structures/matrix/vector2d.d.ts +0 -201
- package/lib/data-structures/matrix/vector2d.js +0 -287
- package/lib/data-structures/priority-queue/max-priority-queue.d.ts +0 -15
- package/lib/data-structures/priority-queue/max-priority-queue.js +0 -39
- package/lib/data-structures/priority-queue/min-priority-queue.d.ts +0 -15
- package/lib/data-structures/priority-queue/min-priority-queue.js +0 -40
- package/lib/data-structures/priority-queue/priority-queue.d.ts +0 -180
- package/lib/data-structures/priority-queue/priority-queue.js +0 -317
- package/lib/data-structures/queue/deque.d.ts +0 -165
- package/lib/data-structures/queue/deque.js +0 -270
- package/lib/data-structures/queue/queue.d.ts +0 -107
- package/lib/data-structures/queue/queue.js +0 -165
- package/lib/data-structures/stack/stack.d.ts +0 -63
- package/lib/data-structures/stack/stack.js +0 -87
- package/lib/data-structures/tree/tree.d.ts +0 -14
- package/lib/data-structures/tree/tree.js +0 -56
- package/lib/data-structures/trie/trie.d.ts +0 -61
- package/lib/data-structures/trie/trie.js +0 -205
- package/lib/index.js +0 -4
- package/lib/interfaces/abstract-binary-tree.d.ts +0 -7
- package/lib/interfaces/abstract-graph.d.ts +0 -5
- package/lib/interfaces/avl-tree.d.ts +0 -7
- package/lib/interfaces/binary-tree.d.ts +0 -6
- package/lib/interfaces/bst.d.ts +0 -6
- package/lib/interfaces/directed-graph.d.ts +0 -3
- package/lib/interfaces/index.d.ts +0 -15
- package/lib/interfaces/index.js +0 -15
- package/lib/interfaces/rb-tree.d.ts +0 -6
- package/lib/interfaces/tree-multiset.d.ts +0 -6
- package/lib/interfaces/undirected-graph.d.ts +0 -3
- package/lib/types/data-structures/abstract-binary-tree.d.ts +0 -34
- package/lib/types/data-structures/abstract-binary-tree.js +0 -21
- package/lib/types/data-structures/abstract-graph.d.ts +0 -11
- package/lib/types/data-structures/avl-tree.d.ts +0 -4
- package/lib/types/data-structures/binary-tree.d.ts +0 -4
- package/lib/types/data-structures/bst.d.ts +0 -13
- package/lib/types/data-structures/bst.js +0 -6
- package/lib/types/data-structures/directed-graph.js +0 -6
- package/lib/types/data-structures/heap.d.ts +0 -3
- package/lib/types/data-structures/index.d.ts +0 -16
- package/lib/types/data-structures/index.js +0 -16
- package/lib/types/data-structures/priority-queue.d.ts +0 -7
- package/lib/types/data-structures/rb-tree.d.ts +0 -8
- package/lib/types/data-structures/rb-tree.js +0 -5
- package/lib/types/data-structures/tree-multiset.d.ts +0 -4
- package/lib/types/index.js +0 -3
- package/lib/types/utils/index.js +0 -2
- package/lib/utils/utils.d.ts +0 -19
- package/lib/utils/utils.js +0 -57
- package/scripts/rename_clear_files.sh +0 -29
- package/src/data-structures/binary-tree/aa-tree.ts +0 -1
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +0 -1556
- package/src/data-structures/binary-tree/b-tree.ts +0 -1
- package/src/data-structures/binary-tree/splay-tree.ts +0 -1
- package/src/data-structures/binary-tree/two-three-tree.ts +0 -1
- package/src/data-structures/hash/pair.ts +0 -1
- package/src/interfaces/abstract-binary-tree.ts +0 -8
- package/src/interfaces/abstract-graph.ts +0 -7
- package/src/interfaces/avl-tree.ts +0 -8
- package/src/interfaces/bst.ts +0 -6
- package/src/interfaces/directed-graph.ts +0 -3
- package/src/interfaces/rb-tree.ts +0 -6
- package/src/interfaces/tree-multiset.ts +0 -7
- package/src/interfaces/undirected-graph.ts +0 -3
- package/src/types/data-structures/abstract-binary-tree.ts +0 -49
- package/src/types/data-structures/abstract-graph.ts +0 -11
- package/src/types/data-structures/avl-tree.ts +0 -5
- package/src/types/data-structures/binary-tree.ts +0 -5
- package/src/types/data-structures/bst.ts +0 -13
- package/src/types/data-structures/heap.ts +0 -5
- package/src/types/data-structures/navigator.ts +0 -13
- package/src/types/data-structures/priority-queue.ts +0 -9
- package/src/types/data-structures/rb-tree.ts +0 -8
- package/src/types/data-structures/tree-multiset.ts +0 -6
- package/test/utils/magnitude.ts +0 -21
- /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{index.js → cjs/index.js} +0 -0
- /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
- /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/avl-tree.js +0 -0
- /package/dist/{types/data-structures/doubly-linked-list.d.ts → cjs/types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
- /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/bst.js +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/binary-tree}/rb-tree.js +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/binary-tree}/segment-tree.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/binary-tree}/segment-tree.js +0 -0
- /package/dist/{interfaces → cjs/types/data-structures/binary-tree}/tree-multiset.js +0 -0
- /package/dist/{interfaces → cjs/types/data-structures/graph}/abstract-graph.js +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/graph}/directed-graph.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/graph}/directed-graph.js +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/graph}/map-graph.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/graph}/map-graph.js +0 -0
- /package/dist/{types/data-structures/singly-linked-list.d.ts → cjs/types/data-structures/graph/undirected-graph.d.ts} +0 -0
- /package/dist/{interfaces → cjs/types/data-structures/graph}/undirected-graph.js +0 -0
- /package/dist/{types/helpers.d.ts → cjs/types/data-structures/hash/coordinate-map.d.ts} +0 -0
- /package/{lib/interfaces/abstract-binary-tree.js → dist/cjs/types/data-structures/hash/coordinate-set.d.ts} +0 -0
- /package/{lib/interfaces/abstract-graph.js → dist/cjs/types/data-structures/hash/hash-map.d.ts} +0 -0
- /package/{lib/interfaces/avl-tree.js → dist/cjs/types/data-structures/hash/hash-table.d.ts} +0 -0
- /package/dist/{types/data-structures/hash.d.ts → cjs/types/data-structures/hash/index.d.ts} +0 -0
- /package/{lib/interfaces/binary-tree.js → dist/cjs/types/data-structures/hash/tree-map.d.ts} +0 -0
- /package/{lib/interfaces/bst.js → dist/cjs/types/data-structures/hash/tree-set.d.ts} +0 -0
- /package/{lib/interfaces → dist/cjs/types/data-structures/heap}/heap.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/heap}/heap.js +0 -0
- /package/{lib/interfaces/directed-graph.js → dist/cjs/types/data-structures/heap/max-heap.d.ts} +0 -0
- /package/{lib/interfaces/doubly-linked-list.d.ts → dist/cjs/types/data-structures/heap/min-heap.d.ts} +0 -0
- /package/{lib/types/data-structures → dist/cjs/types/data-structures/linked-list}/doubly-linked-list.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/linked-list}/doubly-linked-list.js +0 -0
- /package/{lib/interfaces → dist/cjs/types/data-structures/linked-list}/singly-linked-list.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/linked-list}/singly-linked-list.js +0 -0
- /package/{lib/interfaces/doubly-linked-list.js → dist/cjs/types/data-structures/linked-list/skip-linked-list.d.ts} +0 -0
- /package/{lib/interfaces/heap.js → dist/cjs/types/data-structures/matrix/matrix.d.ts} +0 -0
- /package/{lib/interfaces/navigator.d.ts → dist/cjs/types/data-structures/matrix/matrix2d.d.ts} +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/matrix}/navigator.d.ts +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/matrix}/navigator.js +0 -0
- /package/{lib/interfaces/navigator.js → dist/cjs/types/data-structures/matrix/vector2d.d.ts} +0 -0
- /package/{lib → dist/cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
- /package/{lib/interfaces/priority-queue.d.ts → dist/cjs/types/data-structures/priority-queue/max-priority-queue.d.ts} +0 -0
- /package/{lib/interfaces/priority-queue.js → dist/cjs/types/data-structures/priority-queue/min-priority-queue.d.ts} +0 -0
- /package/{lib/interfaces/rb-tree.js → dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts} +0 -0
- /package/dist/{types/data-structures → cjs/types/data-structures/priority-queue}/priority-queue.js +0 -0
- /package/{lib/interfaces/segment-tree.d.ts → dist/cjs/types/data-structures/queue/deque.d.ts} +0 -0
- /package/{lib → dist/cjs/types}/data-structures/queue/index.d.ts +0 -0
- /package/{lib/interfaces/segment-tree.js → dist/cjs/types/data-structures/queue/queue.d.ts} +0 -0
- /package/{lib → dist/cjs/types}/data-structures/stack/index.d.ts +0 -0
- /package/{lib/interfaces/singly-linked-list.js → dist/cjs/types/data-structures/stack/stack.d.ts} +0 -0
- /package/{lib → dist/cjs/types}/data-structures/tree/index.d.ts +0 -0
- /package/{lib/interfaces/tree-multiset.js → dist/cjs/types/data-structures/tree/tree.d.ts} +0 -0
- /package/{lib → dist/cjs/types}/data-structures/trie/index.d.ts +0 -0
- /package/{lib/interfaces/undirected-graph.js → dist/cjs/types/data-structures/trie/trie.d.ts} +0 -0
- /package/dist/{types → cjs/types}/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/index.js +0 -0
- /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/index.js +0 -0
- /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/utils.js +0 -0
- /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
- /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/index.js +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
- /package/{lib/data-structures/priority-queue/index.js → dist/mjs/data-structures/priority-queue/index.d.ts} +0 -0
- /package/{lib/data-structures/queue/index.js → dist/mjs/data-structures/queue/index.d.ts} +0 -0
- /package/{lib/data-structures/stack/index.js → dist/mjs/data-structures/stack/index.d.ts} +0 -0
- /package/{lib/data-structures/tree/index.js → dist/mjs/data-structures/tree/index.d.ts} +0 -0
- /package/{lib/data-structures/trie/index.js → dist/mjs/data-structures/trie/index.d.ts} +0 -0
- /package/{lib → dist/mjs}/index.d.ts +0 -0
- /package/{lib/types/data-structures/abstract-graph.js → dist/mjs/interfaces/doubly-linked-list.d.ts} +0 -0
- /package/{lib/types/data-structures/avl-tree.js → dist/mjs/interfaces/heap.d.ts} +0 -0
- /package/{lib/types/data-structures/binary-tree.js → dist/mjs/interfaces/navigator.d.ts} +0 -0
- /package/{lib/types/data-structures/doubly-linked-list.js → dist/mjs/interfaces/priority-queue.d.ts} +0 -0
- /package/{lib/types/data-structures/hash.js → dist/mjs/interfaces/segment-tree.d.ts} +0 -0
- /package/{lib/types/data-structures → dist/mjs/interfaces}/singly-linked-list.d.ts +0 -0
- /package/{lib/types/data-structures/heap.js → dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
- /package/{lib/types/data-structures → dist/mjs/types/data-structures/binary-tree}/segment-tree.d.ts +0 -0
- /package/{lib/types/data-structures → dist/mjs/types/data-structures/graph}/directed-graph.d.ts +0 -0
- /package/{lib/types/data-structures → dist/mjs/types/data-structures/graph}/map-graph.d.ts +0 -0
- /package/{lib/types/data-structures/map-graph.js → dist/mjs/types/data-structures/graph/undirected-graph.d.ts} +0 -0
- /package/{lib/types/data-structures/navigator.js → dist/mjs/types/data-structures/hash/coordinate-map.d.ts} +0 -0
- /package/{lib/types/data-structures/priority-queue.js → dist/mjs/types/data-structures/hash/coordinate-set.d.ts} +0 -0
- /package/{lib/types/data-structures/segment-tree.js → dist/mjs/types/data-structures/hash/hash-map.d.ts} +0 -0
- /package/{lib/types/data-structures/singly-linked-list.js → dist/mjs/types/data-structures/hash/hash-table.d.ts} +0 -0
- /package/{lib/types/data-structures/hash.d.ts → dist/mjs/types/data-structures/hash/index.d.ts} +0 -0
- /package/{lib/types/data-structures/tree-multiset.js → dist/mjs/types/data-structures/hash/tree-map.d.ts} +0 -0
- /package/{lib/types/helpers.d.ts → dist/mjs/types/data-structures/hash/tree-set.d.ts} +0 -0
- /package/{lib/types/helpers.js → dist/mjs/types/data-structures/heap/heap.d.ts} +0 -0
- /package/{lib/types/utils/utils.js → dist/mjs/types/data-structures/heap/max-heap.d.ts} +0 -0
- /package/{lib/types/utils/validate-type.js → dist/mjs/types/data-structures/heap/min-heap.d.ts} +0 -0
- /package/{src/types/data-structures/doubly-linked-list.ts → dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts} +0 -0
- /package/{src/types/data-structures/singly-linked-list.ts → dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts} +0 -0
- /package/{lib/types/data-structures → dist/mjs/types/data-structures/matrix}/navigator.d.ts +0 -0
- /package/{lib → dist/mjs}/types/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
- /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
- /package/src/types/data-structures/{segment-tree.ts → binary-tree/segment-tree.ts} +0 -0
- /package/src/types/data-structures/{directed-graph.ts → graph/directed-graph.ts} +0 -0
- /package/src/types/data-structures/{map-graph.ts → graph/map-graph.ts} +0 -0
- /package/src/types/data-structures/{hash.ts → hash/index.ts} +0 -0
- /package/{lib/utils/index.js → test/types/index.ts} +0 -0
|
@@ -3,7 +3,7 @@ import {Trie, TrieNode} from '../../../../src';
|
|
|
3
3
|
describe('TrieNode', () => {
|
|
4
4
|
it('should create a TrieNode with the given value', () => {
|
|
5
5
|
const node = new TrieNode('a');
|
|
6
|
-
expect(node.
|
|
6
|
+
expect(node.key).toBe('a');
|
|
7
7
|
expect(node.isEnd).toBe(false);
|
|
8
8
|
expect(node.children.size).toBe(0);
|
|
9
9
|
});
|
|
@@ -27,7 +27,7 @@ describe('TrieNode', () => {
|
|
|
27
27
|
describe('Trie', () => {
|
|
28
28
|
it('should create an empty Trie', () => {
|
|
29
29
|
const trie = new Trie();
|
|
30
|
-
expect(trie.root.
|
|
30
|
+
expect(trie.root.key).toBe('');
|
|
31
31
|
expect(trie.root.children.size).toBe(0);
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -44,25 +44,25 @@ describe('Trie', () => {
|
|
|
44
44
|
const trie = new Trie();
|
|
45
45
|
trie.add('apple');
|
|
46
46
|
trie.add('app');
|
|
47
|
-
expect(trie.
|
|
48
|
-
expect(trie.
|
|
47
|
+
expect(trie.hasPurePrefix('appl')).toBe(true);
|
|
48
|
+
expect(trie.hasPurePrefix('apples')).toBe(false);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it('should check if a string is a prefix', () => {
|
|
52
52
|
const trie = new Trie();
|
|
53
53
|
trie.add('apple');
|
|
54
54
|
trie.add('app');
|
|
55
|
-
expect(trie.
|
|
56
|
-
expect(trie.
|
|
55
|
+
expect(trie.hasPrefix('app')).toBe(true);
|
|
56
|
+
expect(trie.hasPrefix('banana')).toBe(false);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it('should check if a string is a common prefix', () => {
|
|
60
60
|
const trie = new Trie();
|
|
61
61
|
trie.add('apple');
|
|
62
62
|
trie.add('app');
|
|
63
|
-
expect(trie.
|
|
64
|
-
expect(trie.
|
|
65
|
-
expect(trie.
|
|
63
|
+
expect(trie.hasCommonPrefix('ap')).toBe(true);
|
|
64
|
+
expect(trie.hasCommonPrefix('app')).toBe(true);
|
|
65
|
+
expect(trie.hasCommonPrefix('b')).toBe(false);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('should get the longest common prefix', () => {
|
|
@@ -77,19 +77,749 @@ describe('Trie', () => {
|
|
|
77
77
|
trie.add('apple');
|
|
78
78
|
trie.add('app');
|
|
79
79
|
trie.add('application');
|
|
80
|
-
const words = trie.
|
|
80
|
+
const words = trie.getWords('app');
|
|
81
81
|
expect(words).toEqual(['apple', 'application', 'app']);
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
it('should
|
|
84
|
+
it('should delete words from Trie', () => {
|
|
85
85
|
const trie = new Trie();
|
|
86
86
|
trie.add('apple');
|
|
87
87
|
trie.add('app');
|
|
88
88
|
expect(trie.has('apple')).toBe(true);
|
|
89
|
-
trie.
|
|
89
|
+
trie.delete('apple');
|
|
90
90
|
expect(trie.has('apple')).toBe(false);
|
|
91
91
|
expect(trie.has('app')).toBe(true);
|
|
92
|
-
trie.
|
|
92
|
+
trie.delete('app');
|
|
93
93
|
expect(trie.has('app')).toBe(false);
|
|
94
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
|
+
});
|
|
95
825
|
});
|