data-structure-typed 1.40.0-rc → 1.41.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 +23 -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 +363 -0
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +1136 -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 +97 -0
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +389 -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 +4 -0
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.js +14 -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 +363 -0
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +1147 -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 +97 -0
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +393 -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 +4 -0
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +13 -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 +1263 -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 +416 -356
- 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 +240 -41
- 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 +0 -9
- 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}/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
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HashMap = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* data-structure-typed
|
|
6
|
-
*
|
|
7
|
-
* @author Tyler Zeng
|
|
8
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
|
-
* @license MIT License
|
|
10
|
-
*/
|
|
11
|
-
class HashMap {
|
|
12
|
-
get hashFn() {
|
|
13
|
-
return this._hashFn;
|
|
14
|
-
}
|
|
15
|
-
set hashFn(value) {
|
|
16
|
-
this._hashFn = value;
|
|
17
|
-
}
|
|
18
|
-
get table() {
|
|
19
|
-
return this._table;
|
|
20
|
-
}
|
|
21
|
-
set table(value) {
|
|
22
|
-
this._table = value;
|
|
23
|
-
}
|
|
24
|
-
get capacityMultiplier() {
|
|
25
|
-
return this._capacityMultiplier;
|
|
26
|
-
}
|
|
27
|
-
set capacityMultiplier(value) {
|
|
28
|
-
this._capacityMultiplier = value;
|
|
29
|
-
}
|
|
30
|
-
get loadFactor() {
|
|
31
|
-
return this._loadFactor;
|
|
32
|
-
}
|
|
33
|
-
set loadFactor(value) {
|
|
34
|
-
this._loadFactor = value;
|
|
35
|
-
}
|
|
36
|
-
get initialCapacity() {
|
|
37
|
-
return this._initialCapacity;
|
|
38
|
-
}
|
|
39
|
-
set initialCapacity(value) {
|
|
40
|
-
this._initialCapacity = value;
|
|
41
|
-
}
|
|
42
|
-
get size() {
|
|
43
|
-
return this._size;
|
|
44
|
-
}
|
|
45
|
-
set size(value) {
|
|
46
|
-
this._size = value;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The constructor initializes the properties of a hash table, including the initial capacity, load factor, capacity
|
|
50
|
-
* multiplier, size, table array, and hash function.
|
|
51
|
-
* @param [initialCapacity=16] - The initial capacity is the initial size of the hash table. It determines the number of
|
|
52
|
-
* buckets or slots available for storing key-value pairs. The default value is 16.
|
|
53
|
-
* @param [loadFactor=0.75] - The load factor is a measure of how full the hash table can be before it is resized. It is
|
|
54
|
-
* a value between 0 and 1, where 1 means the hash table is completely full and 0 means it is completely empty. When the
|
|
55
|
-
* load factor is reached, the hash table will
|
|
56
|
-
* @param [hashFn] - The `hashFn` parameter is an optional parameter that represents the hash function used to calculate
|
|
57
|
-
* the index of a key in the hash table. If a custom hash function is not provided, a default hash function is used. The
|
|
58
|
-
* default hash function converts the key to a string, calculates the sum of the
|
|
59
|
-
*/
|
|
60
|
-
constructor(initialCapacity = 16, loadFactor = 0.75, hashFn) {
|
|
61
|
-
this._initialCapacity = initialCapacity;
|
|
62
|
-
this._loadFactor = loadFactor;
|
|
63
|
-
this._capacityMultiplier = 2;
|
|
64
|
-
this._size = 0;
|
|
65
|
-
this._table = new Array(initialCapacity);
|
|
66
|
-
this._hashFn =
|
|
67
|
-
hashFn ||
|
|
68
|
-
((key) => {
|
|
69
|
-
const strKey = String(key);
|
|
70
|
-
let hash = 0;
|
|
71
|
-
for (let i = 0; i < strKey.length; i++) {
|
|
72
|
-
hash += strKey.charCodeAt(i);
|
|
73
|
-
}
|
|
74
|
-
return hash % this.table.length;
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
_hash(key) {
|
|
78
|
-
return this._hashFn(key);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* The `resizeTable` function resizes the table used in a hash map by creating a new table with a specified capacity and
|
|
82
|
-
* rehashing the key-value pairs from the old table into the new table.
|
|
83
|
-
* @param {number} newCapacity - The newCapacity parameter is the desired capacity for the resized table. It represents
|
|
84
|
-
* the number of buckets that the new table should have.
|
|
85
|
-
*/
|
|
86
|
-
resizeTable(newCapacity) {
|
|
87
|
-
const newTable = new Array(newCapacity);
|
|
88
|
-
for (const bucket of this._table) {
|
|
89
|
-
// Note that this is this._table
|
|
90
|
-
if (bucket) {
|
|
91
|
-
for (const [key, value] of bucket) {
|
|
92
|
-
const newIndex = this._hash(key) % newCapacity;
|
|
93
|
-
if (!newTable[newIndex]) {
|
|
94
|
-
newTable[newIndex] = [];
|
|
95
|
-
}
|
|
96
|
-
newTable[newIndex].push([key, value]);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
this._table = newTable; // Again, here is this._table
|
|
101
|
-
}
|
|
102
|
-
set(key, value) {
|
|
103
|
-
const loadFactor = this.size / this.table.length;
|
|
104
|
-
if (loadFactor >= this.loadFactor) {
|
|
105
|
-
this.resizeTable(this.table.length * this.capacityMultiplier);
|
|
106
|
-
}
|
|
107
|
-
const index = this._hash(key);
|
|
108
|
-
if (!this.table[index]) {
|
|
109
|
-
this.table[index] = [];
|
|
110
|
-
}
|
|
111
|
-
// Check if the key already exists in the bucket
|
|
112
|
-
for (let i = 0; i < this.table[index].length; i++) {
|
|
113
|
-
if (this.table[index][i][0] === key) {
|
|
114
|
-
this.table[index][i][1] = value;
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
this.table[index].push([key, value]);
|
|
119
|
-
this.size++;
|
|
120
|
-
}
|
|
121
|
-
get(key) {
|
|
122
|
-
const index = this._hash(key);
|
|
123
|
-
if (!this.table[index]) {
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
for (const [k, v] of this.table[index]) {
|
|
127
|
-
if (k === key) {
|
|
128
|
-
return v;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return undefined;
|
|
132
|
-
}
|
|
133
|
-
remove(key) {
|
|
134
|
-
const index = this._hash(key);
|
|
135
|
-
if (!this.table[index]) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
for (let i = 0; i < this.table[index].length; i++) {
|
|
139
|
-
if (this.table[index][i][0] === key) {
|
|
140
|
-
this.table[index].splice(i, 1);
|
|
141
|
-
this.size--;
|
|
142
|
-
// Check if the table needs to be resized down
|
|
143
|
-
const loadFactor = this.size / this.table.length;
|
|
144
|
-
if (loadFactor < this.loadFactor / this.capacityMultiplier) {
|
|
145
|
-
this.resizeTable(this.table.length / this.capacityMultiplier);
|
|
146
|
-
}
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
*entries() {
|
|
152
|
-
for (const bucket of this.table) {
|
|
153
|
-
if (bucket) {
|
|
154
|
-
for (const [key, value] of bucket) {
|
|
155
|
-
yield [key, value];
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
[Symbol.iterator]() {
|
|
161
|
-
return this.entries();
|
|
162
|
-
}
|
|
163
|
-
clear() {
|
|
164
|
-
this.size = 0;
|
|
165
|
-
this.table = new Array(this.initialCapacity);
|
|
166
|
-
}
|
|
167
|
-
isEmpty() {
|
|
168
|
-
return this.size === 0;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
exports.HashMap = HashMap;
|
|
172
|
-
//# sourceMappingURL=hash-map.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/hash-map.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,MAAa,OAAO;IAClB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,CAAC,KAAsB;QAC/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IACD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAA2B;QACnC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,mBA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right Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
|
-
* @license MIT License
|
|
7
|
-
*/
|
|
8
|
-
export declare class HashTableNode<K, V> {
|
|
9
|
-
key: K;
|
|
10
|
-
val: V;
|
|
11
|
-
next: HashTableNode<K, V> | null;
|
|
12
|
-
constructor(key: K, val: V);
|
|
13
|
-
}
|
|
14
|
-
import { HashFunction } from '../../types';
|
|
15
|
-
export declare class HashTable<K, V> {
|
|
16
|
-
get hashFn(): HashFunction<K>;
|
|
17
|
-
set hashFn(value: HashFunction<K>);
|
|
18
|
-
get buckets(): Array<HashTableNode<K, V> | null>;
|
|
19
|
-
set buckets(value: Array<HashTableNode<K, V> | null>);
|
|
20
|
-
get capacity(): number;
|
|
21
|
-
set capacity(value: number);
|
|
22
|
-
private static readonly DEFAULT_CAPACITY;
|
|
23
|
-
private static readonly LOAD_FACTOR;
|
|
24
|
-
private _capacity;
|
|
25
|
-
private _size;
|
|
26
|
-
private _buckets;
|
|
27
|
-
private _hashFn;
|
|
28
|
-
constructor(capacity?: number, hashFn?: HashFunction<K>);
|
|
29
|
-
/**
|
|
30
|
-
* The function `_defaultHashFn` calculates the hash value of a given key and returns the remainder when divided by the
|
|
31
|
-
* capacity of the data structure.
|
|
32
|
-
* @param {K} key - The `key` parameter is the input value that needs to be hashed. It can be of any type, but in this
|
|
33
|
-
* code snippet, it is checked whether the key is a string or an object. If it is a string, the `_murmurStringHashFn`
|
|
34
|
-
* function is used to
|
|
35
|
-
* @returns the hash value of the key modulo the capacity of the data structure.
|
|
36
|
-
*/
|
|
37
|
-
protected _defaultHashFn(key: K): number;
|
|
38
|
-
/**
|
|
39
|
-
* The `_multiplicativeStringHashFn` function calculates a hash value for a given string key using the multiplicative
|
|
40
|
-
* string hash function.
|
|
41
|
-
* @param {K} key - The `key` parameter is the input value for which we want to calculate the hash. It can be of any
|
|
42
|
-
* type, as it is generic (`K`). The function converts the `key` to a string using the `String()` function.
|
|
43
|
-
* @returns a number, which is the result of the multiplicative string hash function applied to the input key.
|
|
44
|
-
*/
|
|
45
|
-
protected _multiplicativeStringHashFn<K>(key: K): number;
|
|
46
|
-
/**
|
|
47
|
-
* The function `_murmurStringHashFn` calculates a hash value for a given string key using the MurmurHash algorithm.
|
|
48
|
-
* @param {K} key - The `key` parameter is the input value for which you want to calculate the hash. It can be of any
|
|
49
|
-
* type, but it will be converted to a string using the `String()` function before calculating the hash.
|
|
50
|
-
* @returns a number, which is the hash value calculated for the given key.
|
|
51
|
-
*/
|
|
52
|
-
protected _murmurStringHashFn<K>(key: K): number;
|
|
53
|
-
/**
|
|
54
|
-
* The _hash function takes a key and returns a number.
|
|
55
|
-
* @param {K} key - The parameter "key" is of type K, which represents the type of the key that will be hashed.
|
|
56
|
-
* @returns The hash function is returning a number.
|
|
57
|
-
*/
|
|
58
|
-
protected _hash(key: K): number;
|
|
59
|
-
/**
|
|
60
|
-
* The function calculates a hash value for a given string using the djb2 algorithm.
|
|
61
|
-
* @param {string} key - The `key` parameter in the `stringHash` function is a string value that represents the input for
|
|
62
|
-
* which we want to calculate the hash value.
|
|
63
|
-
* @returns a number, which is the hash value of the input string.
|
|
64
|
-
*/
|
|
65
|
-
protected _stringHash(key: string): number;
|
|
66
|
-
/**
|
|
67
|
-
* The function `_objectHash` takes a key and returns a hash value, using a custom hash function for objects.
|
|
68
|
-
* @param {K} key - The parameter "key" is of type "K", which means it can be any type. It could be a string, number,
|
|
69
|
-
* boolean, object, or any other type of value. The purpose of the objectHash function is to generate a hash value for
|
|
70
|
-
* the key, which can be used for
|
|
71
|
-
* @returns a number, which is the hash value of the key.
|
|
72
|
-
*/
|
|
73
|
-
protected _objectHash(key: K): number;
|
|
74
|
-
/**
|
|
75
|
-
* The set function adds a key-value pair to the hash table, handling collisions and resizing if necessary.
|
|
76
|
-
* @param {K} key - The key parameter represents the key of the key-value pair that you want to insert into the hash
|
|
77
|
-
* table. It is of type K, which is a generic type representing the key's data type.
|
|
78
|
-
* @param {V} val - The parameter `val` represents the value that you want to associate with the given key in the hash
|
|
79
|
-
* table.
|
|
80
|
-
* @returns Nothing is being returned. The return type of the `put` method is `void`, which means it does not return any
|
|
81
|
-
* value.
|
|
82
|
-
*/
|
|
83
|
-
set(key: K, val: V): void;
|
|
84
|
-
/**
|
|
85
|
-
* The `get` function retrieves the value associated with a given key from a hash table.
|
|
86
|
-
* @param {K} key - The `key` parameter represents the key of the element that we want to retrieve from the data
|
|
87
|
-
* structure.
|
|
88
|
-
* @returns The method is returning the value associated with the given key if it exists in the hash table. If the key is
|
|
89
|
-
* not found, it returns `undefined`.
|
|
90
|
-
*/
|
|
91
|
-
get(key: K): V | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* The remove function removes a key-value pair from a hash table.
|
|
94
|
-
* @param {K} key - The `key` parameter represents the key of the key-value pair that needs to be removed from the hash
|
|
95
|
-
* table.
|
|
96
|
-
* @returns Nothing is being returned. The `remove` method has a return type of `void`, which means it does not return
|
|
97
|
-
* any value.
|
|
98
|
-
*/
|
|
99
|
-
remove(key: K): void;
|
|
100
|
-
/**
|
|
101
|
-
* The `expand` function increases the capacity of a hash table by creating a new array of buckets with double the
|
|
102
|
-
* capacity and rehashing all the existing key-value pairs into the new buckets.
|
|
103
|
-
*/
|
|
104
|
-
protected _expand(): void;
|
|
105
|
-
get size(): number;
|
|
106
|
-
}
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* data-structure-typed
|
|
4
|
-
*
|
|
5
|
-
* @author Tyler Zeng
|
|
6
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
7
|
-
* @license MIT License
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HashTable = exports.HashTableNode = void 0;
|
|
11
|
-
class HashTableNode {
|
|
12
|
-
constructor(key, val) {
|
|
13
|
-
this.key = key;
|
|
14
|
-
this.val = val;
|
|
15
|
-
this.next = null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.HashTableNode = HashTableNode;
|
|
19
|
-
class HashTable {
|
|
20
|
-
get hashFn() {
|
|
21
|
-
return this._hashFn;
|
|
22
|
-
}
|
|
23
|
-
set hashFn(value) {
|
|
24
|
-
this._hashFn = value;
|
|
25
|
-
}
|
|
26
|
-
get buckets() {
|
|
27
|
-
return this._buckets;
|
|
28
|
-
}
|
|
29
|
-
set buckets(value) {
|
|
30
|
-
this._buckets = value;
|
|
31
|
-
}
|
|
32
|
-
get capacity() {
|
|
33
|
-
return this._capacity;
|
|
34
|
-
}
|
|
35
|
-
set capacity(value) {
|
|
36
|
-
this._capacity = value;
|
|
37
|
-
}
|
|
38
|
-
constructor(capacity = HashTable.DEFAULT_CAPACITY, hashFn) {
|
|
39
|
-
this._hashFn = hashFn || this._defaultHashFn;
|
|
40
|
-
this._capacity = Math.max(capacity, HashTable.DEFAULT_CAPACITY);
|
|
41
|
-
this._size = 0;
|
|
42
|
-
this._buckets = new Array(this._capacity).fill(null);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The function `_defaultHashFn` calculates the hash value of a given key and returns the remainder when divided by the
|
|
46
|
-
* capacity of the data structure.
|
|
47
|
-
* @param {K} key - The `key` parameter is the input value that needs to be hashed. It can be of any type, but in this
|
|
48
|
-
* code snippet, it is checked whether the key is a string or an object. If it is a string, the `_murmurStringHashFn`
|
|
49
|
-
* function is used to
|
|
50
|
-
* @returns the hash value of the key modulo the capacity of the data structure.
|
|
51
|
-
*/
|
|
52
|
-
_defaultHashFn(key) {
|
|
53
|
-
// Can be replaced with other hash functions as needed
|
|
54
|
-
const hashValue = typeof key === 'string' ? this._murmurStringHashFn(key) : this._objectHash(key);
|
|
55
|
-
return hashValue % this._capacity;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* The `_multiplicativeStringHashFn` function calculates a hash value for a given string key using the multiplicative
|
|
59
|
-
* string hash function.
|
|
60
|
-
* @param {K} key - The `key` parameter is the input value for which we want to calculate the hash. It can be of any
|
|
61
|
-
* type, as it is generic (`K`). The function converts the `key` to a string using the `String()` function.
|
|
62
|
-
* @returns a number, which is the result of the multiplicative string hash function applied to the input key.
|
|
63
|
-
*/
|
|
64
|
-
_multiplicativeStringHashFn(key) {
|
|
65
|
-
const keyString = String(key);
|
|
66
|
-
let hash = 0;
|
|
67
|
-
for (let i = 0; i < keyString.length; i++) {
|
|
68
|
-
const charCode = keyString.charCodeAt(i);
|
|
69
|
-
// Some constants for adjusting the hash function
|
|
70
|
-
const A = 0.618033988749895;
|
|
71
|
-
const M = 1 << 30; // 2^30
|
|
72
|
-
hash = (hash * A + charCode) % M;
|
|
73
|
-
}
|
|
74
|
-
return Math.abs(hash); // Take absolute value to ensure non-negative numbers
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* The function `_murmurStringHashFn` calculates a hash value for a given string key using the MurmurHash algorithm.
|
|
78
|
-
* @param {K} key - The `key` parameter is the input value for which you want to calculate the hash. It can be of any
|
|
79
|
-
* type, but it will be converted to a string using the `String()` function before calculating the hash.
|
|
80
|
-
* @returns a number, which is the hash value calculated for the given key.
|
|
81
|
-
*/
|
|
82
|
-
_murmurStringHashFn(key) {
|
|
83
|
-
const keyString = String(key);
|
|
84
|
-
const seed = 0;
|
|
85
|
-
let hash = seed;
|
|
86
|
-
for (let i = 0; i < keyString.length; i++) {
|
|
87
|
-
const char = keyString.charCodeAt(i);
|
|
88
|
-
hash = (hash ^ char) * 0x5bd1e995;
|
|
89
|
-
hash = (hash ^ (hash >>> 15)) * 0x27d4eb2d;
|
|
90
|
-
hash = hash ^ (hash >>> 15);
|
|
91
|
-
}
|
|
92
|
-
return Math.abs(hash);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* The _hash function takes a key and returns a number.
|
|
96
|
-
* @param {K} key - The parameter "key" is of type K, which represents the type of the key that will be hashed.
|
|
97
|
-
* @returns The hash function is returning a number.
|
|
98
|
-
*/
|
|
99
|
-
_hash(key) {
|
|
100
|
-
return this.hashFn(key);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* The function calculates a hash value for a given string using the djb2 algorithm.
|
|
104
|
-
* @param {string} key - The `key` parameter in the `stringHash` function is a string value that represents the input for
|
|
105
|
-
* which we want to calculate the hash value.
|
|
106
|
-
* @returns a number, which is the hash value of the input string.
|
|
107
|
-
*/
|
|
108
|
-
_stringHash(key) {
|
|
109
|
-
let hash = 0;
|
|
110
|
-
for (let i = 0; i < key.length; i++) {
|
|
111
|
-
hash = (hash * 31 + key.charCodeAt(i)) & 0xffffffff;
|
|
112
|
-
}
|
|
113
|
-
return hash;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The function `_objectHash` takes a key and returns a hash value, using a custom hash function for objects.
|
|
117
|
-
* @param {K} key - The parameter "key" is of type "K", which means it can be any type. It could be a string, number,
|
|
118
|
-
* boolean, object, or any other type of value. The purpose of the objectHash function is to generate a hash value for
|
|
119
|
-
* the key, which can be used for
|
|
120
|
-
* @returns a number, which is the hash value of the key.
|
|
121
|
-
*/
|
|
122
|
-
_objectHash(key) {
|
|
123
|
-
// If the key is an object, you can write a custom hash function
|
|
124
|
-
// For example, convert the object's properties to a string and use string hashing
|
|
125
|
-
// This is just an example; you should write a specific object hash function as needed
|
|
126
|
-
return this._stringHash(JSON.stringify(key));
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* The set function adds a key-value pair to the hash table, handling collisions and resizing if necessary.
|
|
130
|
-
* @param {K} key - The key parameter represents the key of the key-value pair that you want to insert into the hash
|
|
131
|
-
* table. It is of type K, which is a generic type representing the key's data type.
|
|
132
|
-
* @param {V} val - The parameter `val` represents the value that you want to associate with the given key in the hash
|
|
133
|
-
* table.
|
|
134
|
-
* @returns Nothing is being returned. The return type of the `put` method is `void`, which means it does not return any
|
|
135
|
-
* value.
|
|
136
|
-
*/
|
|
137
|
-
set(key, val) {
|
|
138
|
-
const index = this._hash(key);
|
|
139
|
-
const newNode = new HashTableNode(key, val);
|
|
140
|
-
if (!this._buckets[index]) {
|
|
141
|
-
this._buckets[index] = newNode;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
// Handle collisions, consider using open addressing, etc.
|
|
145
|
-
let currentNode = this._buckets[index];
|
|
146
|
-
while (currentNode) {
|
|
147
|
-
if (currentNode.key === key) {
|
|
148
|
-
// If the key already exists, update the value
|
|
149
|
-
currentNode.val = val;
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (!currentNode.next) {
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
currentNode = currentNode.next;
|
|
156
|
-
}
|
|
157
|
-
// Add to the end of the linked list
|
|
158
|
-
currentNode.next = newNode;
|
|
159
|
-
}
|
|
160
|
-
this._size++;
|
|
161
|
-
// If the load factor is too high, resize the hash table
|
|
162
|
-
if (this._size / this._capacity >= HashTable.LOAD_FACTOR) {
|
|
163
|
-
this._expand();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* The `get` function retrieves the value associated with a given key from a hash table.
|
|
168
|
-
* @param {K} key - The `key` parameter represents the key of the element that we want to retrieve from the data
|
|
169
|
-
* structure.
|
|
170
|
-
* @returns The method is returning the value associated with the given key if it exists in the hash table. If the key is
|
|
171
|
-
* not found, it returns `undefined`.
|
|
172
|
-
*/
|
|
173
|
-
get(key) {
|
|
174
|
-
const index = this._hash(key);
|
|
175
|
-
let currentNode = this._buckets[index];
|
|
176
|
-
while (currentNode) {
|
|
177
|
-
if (currentNode.key === key) {
|
|
178
|
-
return currentNode.val;
|
|
179
|
-
}
|
|
180
|
-
currentNode = currentNode.next;
|
|
181
|
-
}
|
|
182
|
-
return undefined; // Key not found
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* The remove function removes a key-value pair from a hash table.
|
|
186
|
-
* @param {K} key - The `key` parameter represents the key of the key-value pair that needs to be removed from the hash
|
|
187
|
-
* table.
|
|
188
|
-
* @returns Nothing is being returned. The `remove` method has a return type of `void`, which means it does not return
|
|
189
|
-
* any value.
|
|
190
|
-
*/
|
|
191
|
-
remove(key) {
|
|
192
|
-
const index = this._hash(key);
|
|
193
|
-
let currentNode = this._buckets[index];
|
|
194
|
-
let prevNode = null;
|
|
195
|
-
while (currentNode) {
|
|
196
|
-
if (currentNode.key === key) {
|
|
197
|
-
if (prevNode) {
|
|
198
|
-
prevNode.next = currentNode.next;
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
this._buckets[index] = currentNode.next;
|
|
202
|
-
}
|
|
203
|
-
this._size--;
|
|
204
|
-
currentNode.next = null; // Release memory
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
prevNode = currentNode;
|
|
208
|
-
currentNode = currentNode.next;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* The `expand` function increases the capacity of a hash table by creating a new array of buckets with double the
|
|
213
|
-
* capacity and rehashing all the existing key-value pairs into the new buckets.
|
|
214
|
-
*/
|
|
215
|
-
_expand() {
|
|
216
|
-
const newCapacity = this._capacity * 2;
|
|
217
|
-
const newBuckets = new Array(newCapacity).fill(null);
|
|
218
|
-
for (const bucket of this._buckets) {
|
|
219
|
-
let currentNode = bucket;
|
|
220
|
-
while (currentNode) {
|
|
221
|
-
const newIndex = this._hash(currentNode.key);
|
|
222
|
-
const newNode = new HashTableNode(currentNode.key, currentNode.val);
|
|
223
|
-
if (!newBuckets[newIndex]) {
|
|
224
|
-
newBuckets[newIndex] = newNode;
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
let currentNewNode = newBuckets[newIndex];
|
|
228
|
-
while (currentNewNode.next) {
|
|
229
|
-
currentNewNode = currentNewNode.next;
|
|
230
|
-
}
|
|
231
|
-
currentNewNode.next = newNode;
|
|
232
|
-
}
|
|
233
|
-
currentNode = currentNode.next;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
this._buckets = newBuckets;
|
|
237
|
-
this._capacity = newCapacity;
|
|
238
|
-
}
|
|
239
|
-
get size() {
|
|
240
|
-
return this._size;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.HashTable = HashTable;
|
|
244
|
-
HashTable.DEFAULT_CAPACITY = 16;
|
|
245
|
-
HashTable.LOAD_FACTOR = 0.75;
|
|
246
|
-
//# sourceMappingURL=hash-table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash-table.js","sourceRoot":"","sources":["../../../src/data-structures/hash/hash-table.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAa,aAAa;IAKxB,YAAY,GAAM,EAAE,GAAM;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,sCAUC;AAID,MAAa,SAAS;IACpB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,CAAC,KAAsB;QAC/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,KAAwC;QAClD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,QAAQ,CAAC,KAAa;QACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAUD,YAAY,WAAmB,SAAS,CAAC,gBAAgB,EAAE,MAAwB;QACjF,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC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C,OAAO,cAAc,CAAC,IAAI,EAAE;wBAC1B,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC;qBACtC;oBACD,cAAc,CAAC,IAAI,GAAG,OAAO,CAAC;iBAC/B;gBACD,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC;aAChC;SACF;QAED,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AA7PH,8BA8PC;AArOyB,0BAAgB,GAAG,EAAE,CAAC;AACtB,qBAAW,GAAG,IAAI,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./hash-table"), exports);
|
|
18
|
-
__exportStar(require("./coordinate-map"), exports);
|
|
19
|
-
__exportStar(require("./coordinate-set"), exports);
|
|
20
|
-
__exportStar(require("./pair"), exports);
|
|
21
|
-
__exportStar(require("./tree-map"), exports);
|
|
22
|
-
__exportStar(require("./tree-set"), exports);
|
|
23
|
-
__exportStar(require("./hash-map"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-structures/hash/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,mDAAiC;AACjC,mDAAiC;AACjC,yCAAuB;AACvB,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pair.js","sourceRoot":"","sources":["../../../src/data-structures/hash/pair.ts"],"names":[],"mappings":";;;AAAA,MAAa,IAAI;CAAG;AAApB,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/tree-map.ts"],"names":[],"mappings":";;;AAAA,MAAa,OAAO;CAAG;AAAvB,0BAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-set.js","sourceRoot":"","sources":["../../../src/data-structures/hash/tree-set.ts"],"names":[],"mappings":";;;AAAA,MAAa,OAAO;CAAG;AAAvB,0BAAuB"}
|