data-structure-typed 1.43.1 → 1.44.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 +3 -1
- package/CHANGELOG.md +1 -1
- package/README.md +7 -0
- package/benchmark/report.html +30 -30
- package/benchmark/report.json +201 -147
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-tree.d.ts +8 -8
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-tree.js +62 -62
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
- package/dist/{mjs/src → cjs}/data-structures/binary-tree/rb-tree.d.ts +4 -4
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/rb-tree.js +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.js +50 -50
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -0
- package/dist/{mjs/src → cjs}/data-structures/graph/abstract-graph.d.ts +37 -37
- package/dist/cjs/{src/data-structures → data-structures}/graph/abstract-graph.js +37 -37
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-table.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/heap/index.js.map +1 -0
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -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.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.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/cjs/data-structures/matrix/navigator.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/stack/index.js.map +1 -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.js.map +1 -0
- package/dist/cjs/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/data-structures/trie/trie.js.map +1 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/{src/interfaces → interfaces}/binary-tree.d.ts +1 -1
- package/dist/cjs/interfaces/binary-tree.js.map +1 -0
- package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
- package/dist/cjs/{src/interfaces → interfaces}/graph.js.map +1 -1
- package/dist/cjs/{src/interfaces → interfaces}/heap.js.map +1 -1
- 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.js.map +1 -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.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -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-multimap.js.map +1 -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.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.map +1 -0
- package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -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.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -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.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.map +1 -0
- package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -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.map +1 -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.map +1 -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.map +1 -0
- package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/trie.js.map +1 -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/{src/types → types}/utils/utils.js.map +1 -1
- 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.js.map +1 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/avl-tree.js +3 -8
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.js +3 -7
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-tree.d.ts +8 -8
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-tree.js +97 -102
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/bst.js +34 -39
- package/dist/mjs/data-structures/binary-tree/index.js +7 -0
- package/dist/{cjs/src → mjs}/data-structures/binary-tree/rb-tree.d.ts +4 -4
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/rb-tree.js +43 -48
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/segment-tree.js +2 -7
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.js +60 -65
- package/dist/{cjs/src → mjs}/data-structures/graph/abstract-graph.d.ts +37 -37
- package/dist/mjs/{src/data-structures → data-structures}/graph/abstract-graph.js +46 -52
- package/dist/mjs/{src/data-structures → data-structures}/graph/directed-graph.js +9 -15
- package/dist/mjs/data-structures/graph/index.js +4 -0
- package/dist/mjs/{src/data-structures → data-structures}/graph/map-graph.js +4 -10
- package/dist/mjs/{src/data-structures → data-structures}/graph/undirected-graph.js +7 -13
- package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-map.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-set.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/hash/hash-map.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/hash/hash-table.js +2 -7
- package/dist/mjs/data-structures/hash/index.js +6 -0
- package/dist/mjs/data-structures/hash/tree-map.js +2 -0
- package/dist/mjs/data-structures/hash/tree-set.js +2 -0
- package/dist/mjs/{src/data-structures → data-structures}/heap/heap.js +3 -9
- package/dist/mjs/data-structures/heap/index.js +3 -0
- package/dist/mjs/{src/data-structures → data-structures}/heap/max-heap.js +2 -6
- package/dist/mjs/{src/data-structures → data-structures}/heap/min-heap.js +2 -6
- package/dist/mjs/data-structures/index.js +11 -0
- package/dist/mjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.js +2 -7
- package/dist/mjs/data-structures/linked-list/index.js +3 -0
- package/dist/mjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.js +2 -7
- package/dist/mjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.js +2 -7
- package/dist/mjs/data-structures/matrix/index.js +4 -0
- package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix2d.js +4 -8
- package/dist/mjs/{src/data-structures → data-structures}/matrix/navigator.js +2 -7
- package/dist/mjs/{src/data-structures → data-structures}/matrix/vector2d.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.js +2 -6
- package/dist/mjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.js +2 -6
- package/dist/mjs/data-structures/priority-queue/priority-queue.js +13 -0
- package/dist/mjs/{src/data-structures → data-structures}/queue/deque.js +4 -10
- package/dist/mjs/{src/data-structures → data-structures}/queue/queue.js +3 -8
- package/dist/mjs/{src/data-structures → data-structures}/stack/stack.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/tree/tree.js +1 -5
- package/dist/mjs/{src/data-structures → data-structures}/trie/trie.js +2 -7
- package/dist/mjs/index.js +4 -0
- package/dist/mjs/{src/interfaces → interfaces}/binary-tree.d.ts +1 -1
- package/dist/mjs/interfaces/index.js +8 -0
- package/dist/mjs/{src/types → types}/data-structures/binary-tree/binary-tree.js +4 -7
- package/dist/mjs/types/data-structures/binary-tree/index.js +6 -0
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +5 -0
- package/dist/mjs/types/data-structures/graph/directed-graph.js +6 -0
- package/dist/mjs/types/data-structures/graph/index.js +3 -0
- package/dist/mjs/types/data-structures/hash/hash-table.js +1 -0
- package/dist/mjs/types/data-structures/hash/index.js +1 -0
- package/dist/mjs/types/data-structures/hash/tree-map.d.ts +1 -0
- package/dist/mjs/types/data-structures/hash/tree-map.js +1 -0
- package/dist/mjs/types/data-structures/hash/tree-set.d.ts +1 -0
- package/dist/mjs/types/data-structures/hash/tree-set.js +1 -0
- package/dist/mjs/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/heap.js +1 -0
- package/dist/mjs/types/data-structures/heap/index.js +1 -0
- package/dist/mjs/types/data-structures/heap/max-heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/max-heap.js +1 -0
- package/dist/mjs/types/data-structures/heap/min-heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/min-heap.js +1 -0
- package/dist/mjs/types/data-structures/index.js +11 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +1 -0
- package/dist/mjs/types/data-structures/linked-list/index.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +1 -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 +1 -0
- package/dist/mjs/types/data-structures/matrix/index.js +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.js +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.js +1 -0
- package/dist/mjs/types/data-structures/matrix/navigator.js +1 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.js +1 -0
- package/dist/mjs/types/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/mjs/types/data-structures/priority-queue/index.js +3 -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 +1 -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 +1 -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 +1 -0
- package/dist/mjs/types/data-structures/queue/deque.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/deque.js +1 -0
- package/dist/mjs/types/data-structures/queue/index.d.ts +2 -0
- package/dist/mjs/types/data-structures/queue/index.js +2 -0
- package/dist/mjs/types/data-structures/queue/queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/queue.js +1 -0
- package/dist/mjs/types/data-structures/stack/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/index.js +1 -0
- package/dist/mjs/types/data-structures/stack/stack.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/stack.js +1 -0
- package/dist/mjs/types/data-structures/tree/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/index.js +1 -0
- package/dist/mjs/types/data-structures/tree/tree.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/tree.js +1 -0
- package/dist/mjs/types/data-structures/trie/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/index.js +1 -0
- package/dist/mjs/types/data-structures/trie/trie.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/trie.js +1 -0
- package/dist/mjs/types/helpers.js +6 -0
- package/dist/mjs/types/index.js +3 -0
- package/dist/mjs/types/utils/index.js +2 -0
- package/dist/mjs/types/utils/utils.js +1 -0
- package/dist/mjs/types/utils/validate-type.js +1 -0
- package/dist/mjs/utils/index.js +1 -0
- package/dist/mjs/utils/utils.js +54 -0
- package/dist/umd/data-structure-typed.js +10593 -0
- package/dist/umd/data-structure-typed.min.js +5 -10
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +14 -15
- package/src/data-structures/binary-tree/avl-tree.ts +2 -3
- package/src/data-structures/binary-tree/binary-tree.ts +85 -92
- package/src/data-structures/binary-tree/bst.ts +14 -22
- package/src/data-structures/binary-tree/rb-tree.ts +11 -20
- package/src/data-structures/binary-tree/tree-multimap.ts +56 -58
- package/src/data-structures/graph/abstract-graph.ts +6 -22
- package/src/data-structures/graph/directed-graph.ts +3 -9
- package/src/data-structures/graph/map-graph.ts +6 -6
- package/src/data-structures/graph/undirected-graph.ts +1 -2
- package/src/data-structures/heap/heap.ts +1 -6
- package/src/data-structures/trie/trie.ts +1 -1
- package/src/interfaces/binary-tree.ts +1 -1
- package/src/types/utils/validate-type.ts +2 -16
- package/test/integration/index.html +50 -4
- package/test/performance/data-structures/binary-tree/rb-tree.test.ts +18 -19
- package/test/performance/data-structures/hash/hash-map.test.ts +10 -13
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +16 -16
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +1 -3
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +10 -12
- package/test/performance/data-structures/queue/deque.test.ts +18 -19
- package/test/performance/data-structures/queue/queue.test.ts +18 -19
- package/test/performance/data-structures/stack/stack.test.ts +10 -11
- package/test/performance/reportor.ts +4 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +0 -1
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +83 -61
- package/test/unit/data-structures/binary-tree/bst.test.ts +2 -6
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +34 -25
- package/test/unit/data-structures/graph/abstract-graph.test.ts +6 -6
- package/test/unit/data-structures/graph/directed-graph.test.ts +8 -28
- package/test/unit/data-structures/heap/heap.test.ts +1 -8
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +34 -12
- package/test/utils/json2html.ts +2 -6
- package/tsconfig-base.json +0 -1
- package/tsconfig-cjs.json +4 -3
- package/tsconfig-mjs.json +5 -3
- package/tsup.config.js +39 -17
- package/dist/cjs/src/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/index.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/rb-tree.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js.map +0 -1
- package/dist/cjs/src/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/cjs/src/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/cjs/src/data-structures/graph/index.js.map +0 -1
- package/dist/cjs/src/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/src/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/hash-map.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/hash-table.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/index.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/tree-map.js.map +0 -1
- package/dist/cjs/src/data-structures/hash/tree-set.js.map +0 -1
- package/dist/cjs/src/data-structures/heap/heap.js.map +0 -1
- package/dist/cjs/src/data-structures/heap/index.js.map +0 -1
- package/dist/cjs/src/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/src/data-structures/heap/min-heap.js.map +0 -1
- package/dist/cjs/src/data-structures/index.js.map +0 -1
- package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/cjs/src/data-structures/linked-list/index.js.map +0 -1
- package/dist/cjs/src/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/src/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/cjs/src/data-structures/matrix/index.js.map +0 -1
- package/dist/cjs/src/data-structures/matrix/matrix.js.map +0 -1
- package/dist/cjs/src/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/cjs/src/data-structures/matrix/navigator.js.map +0 -1
- package/dist/cjs/src/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/cjs/src/data-structures/priority-queue/index.js.map +0 -1
- package/dist/cjs/src/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/src/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/src/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/src/data-structures/queue/deque.js.map +0 -1
- package/dist/cjs/src/data-structures/queue/index.js.map +0 -1
- package/dist/cjs/src/data-structures/queue/queue.js.map +0 -1
- package/dist/cjs/src/data-structures/stack/index.js.map +0 -1
- package/dist/cjs/src/data-structures/stack/stack.js.map +0 -1
- package/dist/cjs/src/data-structures/tree/index.js.map +0 -1
- package/dist/cjs/src/data-structures/tree/tree.js.map +0 -1
- package/dist/cjs/src/data-structures/trie/index.js.map +0 -1
- package/dist/cjs/src/data-structures/trie/trie.js.map +0 -1
- package/dist/cjs/src/index.js.map +0 -1
- package/dist/cjs/src/interfaces/binary-tree.js.map +0 -1
- package/dist/cjs/src/interfaces/doubly-linked-list.js.map +0 -1
- package/dist/cjs/src/interfaces/index.js.map +0 -1
- package/dist/cjs/src/interfaces/navigator.js.map +0 -1
- package/dist/cjs/src/interfaces/priority-queue.js.map +0 -1
- package/dist/cjs/src/interfaces/segment-tree.js.map +0 -1
- package/dist/cjs/src/interfaces/singly-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/rb-tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/binary-tree/tree-multimap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/hash-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/hash-table.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/tree-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/tree-set.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/min-heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/matrix.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/navigator.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/deque.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/stack/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/stack/stack.js.map +0 -1
- package/dist/cjs/src/types/data-structures/tree/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/tree/tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/trie/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/trie/trie.js.map +0 -1
- package/dist/cjs/src/types/helpers.js.map +0 -1
- package/dist/cjs/src/types/index.js.map +0 -1
- package/dist/cjs/src/types/utils/index.js.map +0 -1
- package/dist/cjs/src/types/utils/validate-type.js.map +0 -1
- package/dist/cjs/src/utils/index.js.map +0 -1
- package/dist/cjs/src/utils/utils.js.map +0 -1
- package/dist/mjs/src/data-structures/binary-tree/index.js +0 -23
- package/dist/mjs/src/data-structures/graph/index.js +0 -20
- package/dist/mjs/src/data-structures/hash/index.js +0 -22
- package/dist/mjs/src/data-structures/hash/tree-map.js +0 -6
- package/dist/mjs/src/data-structures/hash/tree-set.js +0 -6
- package/dist/mjs/src/data-structures/heap/index.js +0 -19
- package/dist/mjs/src/data-structures/index.js +0 -27
- package/dist/mjs/src/data-structures/linked-list/index.js +0 -19
- package/dist/mjs/src/data-structures/matrix/index.js +0 -20
- package/dist/mjs/src/data-structures/priority-queue/index.js +0 -19
- package/dist/mjs/src/data-structures/priority-queue/priority-queue.js +0 -17
- package/dist/mjs/src/data-structures/queue/index.js +0 -18
- package/dist/mjs/src/data-structures/stack/index.js +0 -17
- package/dist/mjs/src/data-structures/tree/index.js +0 -17
- package/dist/mjs/src/data-structures/trie/index.js +0 -17
- package/dist/mjs/src/index.js +0 -20
- package/dist/mjs/src/interfaces/binary-tree.js +0 -2
- package/dist/mjs/src/interfaces/doubly-linked-list.js +0 -2
- package/dist/mjs/src/interfaces/graph.js +0 -2
- package/dist/mjs/src/interfaces/heap.js +0 -2
- package/dist/mjs/src/interfaces/index.js +0 -24
- package/dist/mjs/src/interfaces/navigator.js +0 -2
- package/dist/mjs/src/interfaces/priority-queue.js +0 -2
- package/dist/mjs/src/interfaces/segment-tree.js +0 -2
- package/dist/mjs/src/interfaces/singly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/avl-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/binary-indexed-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/bst.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/index.js +0 -22
- package/dist/mjs/src/types/data-structures/binary-tree/rb-tree.js +0 -8
- package/dist/mjs/src/types/data-structures/binary-tree/segment-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/tree-multimap.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/abstract-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/directed-graph.js +0 -9
- package/dist/mjs/src/types/data-structures/graph/index.js +0 -19
- package/dist/mjs/src/types/data-structures/graph/map-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/undirected-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/coordinate-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/coordinate-set.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/hash-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/hash-table.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/index.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/tree-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/tree-set.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/heap.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/index.js +0 -17
- package/dist/mjs/src/types/data-structures/heap/max-heap.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/min-heap.js +0 -2
- package/dist/mjs/src/types/data-structures/index.js +0 -27
- package/dist/mjs/src/types/data-structures/linked-list/doubly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/linked-list/index.js +0 -18
- package/dist/mjs/src/types/data-structures/linked-list/singly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/linked-list/skip-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/index.js +0 -17
- package/dist/mjs/src/types/data-structures/matrix/matrix.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/matrix2d.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/navigator.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/vector2d.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/index.js +0 -19
- package/dist/mjs/src/types/data-structures/priority-queue/max-priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/min-priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/queue/deque.js +0 -2
- package/dist/mjs/src/types/data-structures/queue/index.js +0 -18
- package/dist/mjs/src/types/data-structures/queue/queue.js +0 -2
- package/dist/mjs/src/types/data-structures/stack/index.js +0 -17
- package/dist/mjs/src/types/data-structures/stack/stack.js +0 -2
- package/dist/mjs/src/types/data-structures/tree/index.js +0 -17
- package/dist/mjs/src/types/data-structures/tree/tree.js +0 -2
- package/dist/mjs/src/types/data-structures/trie/index.js +0 -17
- package/dist/mjs/src/types/data-structures/trie/trie.js +0 -2
- package/dist/mjs/src/types/helpers.js +0 -9
- package/dist/mjs/src/types/index.js +0 -19
- package/dist/mjs/src/types/utils/index.js +0 -18
- package/dist/mjs/src/types/utils/utils.js +0 -2
- package/dist/mjs/src/types/utils/validate-type.js +0 -2
- package/dist/mjs/src/utils/index.js +0 -17
- package/dist/mjs/src/utils/utils.js +0 -64
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/bst.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/bst.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/segment-tree.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/binary-tree/segment-tree.js +0 -0
- package/dist/{mjs/src → cjs}/data-structures/binary-tree/tree-multimap.d.ts +24 -24
- package/dist/cjs/{src/data-structures → data-structures}/graph/directed-graph.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/directed-graph.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/map-graph.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/map-graph.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/undirected-graph.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/graph/undirected-graph.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-map.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-map.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-set.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/coordinate-set.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/hash-map.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/hash-map.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/hash-table.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/hash-table.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/tree-map.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/tree-map.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/tree-set.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/hash/tree-set.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/heap.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/heap.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/max-heap.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/max-heap.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/min-heap.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/heap/min-heap.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix2d.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/matrix2d.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/navigator.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/navigator.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/vector2d.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/matrix/vector2d.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/priority-queue.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/priority-queue/priority-queue.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/deque.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/deque.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/queue.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/queue/queue.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/stack/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/stack/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/stack/stack.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/stack/stack.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/tree/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/tree/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/tree/tree.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/tree/tree.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/trie/index.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/trie/index.js +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/trie/trie.d.ts +0 -0
- package/dist/cjs/{src/data-structures → data-structures}/trie/trie.js +0 -0
- package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
- package/dist/cjs/{src/index.js → index.js} +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/binary-tree.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/doubly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/doubly-linked-list.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/graph.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/graph.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/heap.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/heap.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/index.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/index.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/navigator.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/navigator.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/priority-queue.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/priority-queue.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/segment-tree.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/segment-tree.js +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/singly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/interfaces → interfaces}/singly-linked-list.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/avl-tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/binary-tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/bst.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/bst.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/rb-tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/segment-tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/tree-multimap.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/binary-tree/tree-multimap.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/abstract-graph.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/abstract-graph.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/directed-graph.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/directed-graph.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/heap.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/heap.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/deque.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/deque.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/queue.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/queue/queue.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/stack/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/stack/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/stack/stack.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/stack/stack.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/tree/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/tree/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/tree/tree.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/tree/tree.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/trie/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/trie/index.js +0 -0
- package/dist/cjs/{src/types → types}/data-structures/trie/trie.d.ts +0 -0
- package/dist/cjs/{src/types → types}/data-structures/trie/trie.js +0 -0
- package/dist/cjs/{src/types → types}/helpers.d.ts +0 -0
- package/dist/cjs/{src/types → types}/helpers.js +0 -0
- package/dist/cjs/{src/types → types}/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/index.js +0 -0
- package/dist/cjs/{src/types → types}/utils/index.d.ts +0 -0
- package/dist/cjs/{src/types → types}/utils/index.js +0 -0
- package/dist/cjs/{src/types → types}/utils/utils.d.ts +0 -0
- package/dist/cjs/{src/types → types}/utils/utils.js +0 -0
- package/dist/cjs/{src/types → types}/utils/validate-type.d.ts +0 -0
- package/dist/cjs/{src/types → types}/utils/validate-type.js +0 -0
- package/dist/cjs/{src/utils → utils}/index.d.ts +0 -0
- package/dist/cjs/{src/utils → utils}/index.js +0 -0
- package/dist/cjs/{src/utils → utils}/utils.d.ts +0 -0
- package/dist/cjs/{src/utils → utils}/utils.js +0 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/bst.d.ts +0 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/index.d.ts +0 -0
- package/dist/mjs/{src/data-structures → data-structures}/binary-tree/segment-tree.d.ts +0 -0
- package/dist/{cjs/src → mjs}/data-structures/binary-tree/tree-multimap.d.ts +24 -24
- /package/dist/mjs/{src/data-structures → data-structures}/graph/directed-graph.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/graph/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/graph/map-graph.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/graph/undirected-graph.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-map.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/coordinate-set.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/hash-map.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/hash-table.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/tree-map.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/hash/tree-set.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/heap/heap.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/heap/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/heap/max-heap.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/heap/min-heap.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/linked-list/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/matrix/index.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/matrix/matrix2d.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/matrix/navigator.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/matrix/vector2d.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/index.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/index.d.ts → data-structures/priority-queue/index.js} +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/queue/deque.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/queue/index.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/index.d.ts → data-structures/queue/index.js} +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/queue/queue.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/stack/index.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/stack/index.d.ts → data-structures/stack/index.js} +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/stack/stack.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/tree/index.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/tree/index.d.ts → data-structures/tree/index.js} +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/tree/tree.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/trie/index.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/trie/index.d.ts → data-structures/trie/index.js} +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/trie/trie.d.ts +0 -0
- /package/dist/mjs/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/mjs/{src/interfaces/doubly-linked-list.d.ts → interfaces/binary-tree.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/linked-list → interfaces}/doubly-linked-list.d.ts +0 -0
- /package/dist/mjs/{src/interfaces/heap.d.ts → interfaces/doubly-linked-list.js} +0 -0
- /package/dist/mjs/{src/interfaces → interfaces}/graph.d.ts +0 -0
- /package/dist/mjs/{src/interfaces/navigator.d.ts → interfaces/graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/heap → interfaces}/heap.d.ts +0 -0
- /package/dist/mjs/{src/interfaces/priority-queue.d.ts → interfaces/heap.js} +0 -0
- /package/dist/mjs/{src/interfaces → interfaces}/index.d.ts +0 -0
- /package/dist/mjs/{src/interfaces/segment-tree.d.ts → interfaces/navigator.d.ts} +0 -0
- /package/dist/mjs/{src/interfaces/singly-linked-list.d.ts → interfaces/navigator.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue → interfaces}/priority-queue.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/binary-tree/binary-indexed-tree.d.ts → interfaces/priority-queue.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/graph/undirected-graph.d.ts → interfaces/segment-tree.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/coordinate-map.d.ts → interfaces/segment-tree.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/linked-list → interfaces}/singly-linked-list.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/coordinate-set.d.ts → interfaces/singly-linked-list.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/hash-map.d.ts → types/data-structures/binary-tree/avl-tree.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/hash-table.d.ts → types/data-structures/binary-tree/binary-indexed-tree.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/tree-map.d.ts → types/data-structures/binary-tree/binary-indexed-tree.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/binary-tree.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/bst.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/hash/tree-set.d.ts → types/data-structures/binary-tree/bst.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/heap/max-heap.d.ts → types/data-structures/binary-tree/segment-tree.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/binary-tree/tree-multimap.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/heap/min-heap.d.ts → types/data-structures/binary-tree/tree-multimap.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/linked-list/skip-linked-list.d.ts → types/data-structures/graph/abstract-graph.js} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/matrix.d.ts → types/data-structures/graph/map-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/matrix2d.d.ts → types/data-structures/graph/undirected-graph.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/vector2d.d.ts → types/data-structures/graph/undirected-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/max-priority-queue.d.ts → types/data-structures/hash/coordinate-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/min-priority-queue.d.ts → types/data-structures/hash/coordinate-map.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/deque.d.ts → types/data-structures/hash/coordinate-set.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/queue.d.ts → types/data-structures/hash/coordinate-set.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/stack/stack.d.ts → types/data-structures/hash/hash-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/tree/tree.d.ts → types/data-structures/hash/hash-map.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/trie/trie.d.ts → types/data-structures/hash/hash-table.d.ts} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/helpers.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/utils.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/validate-type.d.ts +0 -0
- /package/dist/mjs/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/mjs/{src/utils → utils}/utils.d.ts +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbstractGraph = exports.AbstractEdge = exports.AbstractVertex = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,10 +5,10 @@ exports.AbstractGraph = exports.AbstractEdge = exports.AbstractVertex = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class AbstractVertex {
|
|
8
|
+
import { uuidV4 } from '../../utils';
|
|
9
|
+
import { PriorityQueue } from '../priority-queue';
|
|
10
|
+
import { Queue } from '../queue';
|
|
11
|
+
export class AbstractVertex {
|
|
15
12
|
key;
|
|
16
13
|
value;
|
|
17
14
|
/**
|
|
@@ -26,8 +23,7 @@ class AbstractVertex {
|
|
|
26
23
|
this.value = value;
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
|
|
30
|
-
class AbstractEdge {
|
|
26
|
+
export class AbstractEdge {
|
|
31
27
|
value;
|
|
32
28
|
weight;
|
|
33
29
|
/**
|
|
@@ -42,15 +38,14 @@ class AbstractEdge {
|
|
|
42
38
|
constructor(weight, value) {
|
|
43
39
|
this.weight = weight !== undefined ? weight : 1;
|
|
44
40
|
this.value = value;
|
|
45
|
-
this._hashCode =
|
|
41
|
+
this._hashCode = uuidV4();
|
|
46
42
|
}
|
|
47
43
|
_hashCode;
|
|
48
44
|
get hashCode() {
|
|
49
45
|
return this._hashCode;
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
|
-
|
|
53
|
-
class AbstractGraph {
|
|
48
|
+
export class AbstractGraph {
|
|
54
49
|
_vertices = new Map();
|
|
55
50
|
get vertices() {
|
|
56
51
|
return this._vertices;
|
|
@@ -310,7 +305,7 @@ class AbstractGraph {
|
|
|
310
305
|
return null;
|
|
311
306
|
}
|
|
312
307
|
const visited = new Map();
|
|
313
|
-
const queue = new
|
|
308
|
+
const queue = new Queue([vertex1]);
|
|
314
309
|
visited.set(vertex1, true);
|
|
315
310
|
let cost = 0;
|
|
316
311
|
while (queue.size > 0) {
|
|
@@ -417,24 +412,24 @@ class AbstractGraph {
|
|
|
417
412
|
* Space Complexity: O(V + E) - Depends on the implementation (Dijkstra's algorithm).
|
|
418
413
|
*/
|
|
419
414
|
/**
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
415
|
+
* Time Complexity: O(V^2 + E) - Quadratic time in the worst case (no heap optimization).
|
|
416
|
+
* Space Complexity: O(V + E) - Depends on the implementation (Dijkstra's algorithm).
|
|
417
|
+
*
|
|
418
|
+
* The function `dijkstraWithoutHeap` implements Dijkstra's algorithm to find the shortest path between two vertices in
|
|
419
|
+
* a graph without using a heap data structure.
|
|
420
|
+
* @param {VO | VertexKey} src - The source vertex from which to start the Dijkstra's algorithm. It can be either a
|
|
421
|
+
* vertex object or a vertex ID.
|
|
422
|
+
* @param {VO | VertexKey | null} [dest] - The `dest` parameter in the `dijkstraWithoutHeap` function is an optional
|
|
423
|
+
* parameter that specifies the destination vertex for the Dijkstra algorithm. It can be either a vertex object or its
|
|
424
|
+
* identifier. If no destination is provided, the value is set to `null`.
|
|
425
|
+
* @param {boolean} [getMinDist] - The `getMinDist` parameter is a boolean flag that determines whether the minimum
|
|
426
|
+
* distance from the source vertex to the destination vertex should be calculated and returned in the result. If
|
|
427
|
+
* `getMinDist` is set to `true`, the `minDist` property in the result will contain the minimum distance
|
|
428
|
+
* @param {boolean} [genPaths] - The `genPaths` parameter is a boolean flag that determines whether or not to generate
|
|
429
|
+
* paths in the Dijkstra algorithm. If `genPaths` is set to `true`, the algorithm will calculate and return the
|
|
430
|
+
* shortest paths from the source vertex to all other vertices in the graph. If `genPaths
|
|
431
|
+
* @returns The function `dijkstraWithoutHeap` returns an object of type `DijkstraResult<VO>`.
|
|
432
|
+
*/
|
|
438
433
|
dijkstraWithoutHeap(src, dest, getMinDist, genPaths) {
|
|
439
434
|
if (getMinDist === undefined)
|
|
440
435
|
getMinDist = false;
|
|
@@ -551,25 +546,25 @@ class AbstractGraph {
|
|
|
551
546
|
* Space Complexity: O(V + E) - Depends on the implementation (using a binary heap).
|
|
552
547
|
*/
|
|
553
548
|
/**
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
549
|
+
* Time Complexity: O((V + E) * log(V)) - Depends on the implementation (using a binary heap).
|
|
550
|
+
* Space Complexity: O(V + E) - Depends on the implementation (using a binary heap).
|
|
551
|
+
*
|
|
552
|
+
* Dijkstra's algorithm is used to find the shortest paths from a source node to all other nodes in a graph. Its basic idea is to repeatedly choose the node closest to the source node and update the distances of other nodes using this node as an intermediary. Dijkstra's algorithm requires that the edge weights in the graph are non-negative.
|
|
553
|
+
* The `dijkstra` function implements Dijkstra's algorithm to find the shortest path between a source vertex and an
|
|
554
|
+
* optional destination vertex, and optionally returns the minimum distance, the paths, and other information.
|
|
555
|
+
* @param {VO | VertexKey} src - The `src` parameter represents the source vertex from which the Dijkstra algorithm will
|
|
556
|
+
* start. It can be either a vertex object or a vertex ID.
|
|
557
|
+
* @param {VO | VertexKey | null} [dest] - The `dest` parameter is the destination vertex or vertex ID. It specifies the
|
|
558
|
+
* vertex to which the shortest path is calculated from the source vertex. If no destination is provided, the algorithm
|
|
559
|
+
* will calculate the shortest paths to all other vertices from the source vertex.
|
|
560
|
+
* @param {boolean} [getMinDist] - The `getMinDist` parameter is a boolean flag that determines whether the minimum
|
|
561
|
+
* distance from the source vertex to the destination vertex should be calculated and returned in the result. If
|
|
562
|
+
* `getMinDist` is set to `true`, the `minDist` property in the result will contain the minimum distance
|
|
563
|
+
* @param {boolean} [genPaths] - The `genPaths` parameter is a boolean flag that determines whether or not to generate
|
|
564
|
+
* paths in the Dijkstra algorithm. If `genPaths` is set to `true`, the algorithm will calculate and return the
|
|
565
|
+
* shortest paths from the source vertex to all other vertices in the graph. If `genPaths
|
|
566
|
+
* @returns The function `dijkstra` returns an object of type `DijkstraResult<VO>`.
|
|
567
|
+
*/
|
|
573
568
|
dijkstra(src, dest, getMinDist, genPaths) {
|
|
574
569
|
if (getMinDist === undefined)
|
|
575
570
|
getMinDist = false;
|
|
@@ -594,7 +589,7 @@ class AbstractGraph {
|
|
|
594
589
|
if (vertexOrKey instanceof AbstractVertex)
|
|
595
590
|
distMap.set(vertexOrKey, Infinity);
|
|
596
591
|
}
|
|
597
|
-
const heap = new
|
|
592
|
+
const heap = new PriorityQueue({ comparator: (a, b) => a.key - b.key });
|
|
598
593
|
heap.add({ key: 0, value: srcVertex });
|
|
599
594
|
distMap.set(srcVertex, 0);
|
|
600
595
|
preMap.set(srcVertex, null);
|
|
@@ -1042,4 +1037,3 @@ class AbstractGraph {
|
|
|
1042
1037
|
return vertexOrKey instanceof AbstractVertex ? vertexOrKey.key : vertexOrKey;
|
|
1043
1038
|
}
|
|
1044
1039
|
}
|
|
1045
|
-
exports.AbstractGraph = AbstractGraph;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DirectedGraph = exports.DirectedEdge = exports.DirectedVertex = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,9 +5,9 @@ exports.DirectedGraph = exports.DirectedEdge = exports.DirectedVertex = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class DirectedVertex extends
|
|
8
|
+
import { arrayRemove } from '../../utils';
|
|
9
|
+
import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
|
|
10
|
+
export class DirectedVertex extends AbstractVertex {
|
|
14
11
|
/**
|
|
15
12
|
* The constructor function initializes a vertex with an optional value.
|
|
16
13
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
|
|
@@ -22,8 +19,7 @@ class DirectedVertex extends abstract_graph_1.AbstractVertex {
|
|
|
22
19
|
super(key, value);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
class DirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
22
|
+
export class DirectedEdge extends AbstractEdge {
|
|
27
23
|
src;
|
|
28
24
|
dest;
|
|
29
25
|
/**
|
|
@@ -43,8 +39,7 @@ class DirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
|
43
39
|
this.dest = dest;
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
|
-
|
|
47
|
-
class DirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
42
|
+
export class DirectedGraph extends AbstractGraph {
|
|
48
43
|
/**
|
|
49
44
|
* The constructor function initializes an instance of a class.
|
|
50
45
|
*/
|
|
@@ -143,11 +138,11 @@ class DirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
143
138
|
}
|
|
144
139
|
const srcOutEdges = this._outEdgeMap.get(src);
|
|
145
140
|
if (srcOutEdges) {
|
|
146
|
-
|
|
141
|
+
arrayRemove(srcOutEdges, (edge) => edge.dest === dest.key);
|
|
147
142
|
}
|
|
148
143
|
const destInEdges = this._inEdgeMap.get(dest);
|
|
149
144
|
if (destInEdges) {
|
|
150
|
-
removed =
|
|
145
|
+
removed = arrayRemove(destInEdges, (edge) => edge.src === src.key)[0] || null;
|
|
151
146
|
}
|
|
152
147
|
return removed;
|
|
153
148
|
}
|
|
@@ -171,11 +166,11 @@ class DirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
171
166
|
if (src && dest) {
|
|
172
167
|
const srcOutEdges = this._outEdgeMap.get(src);
|
|
173
168
|
if (srcOutEdges && srcOutEdges.length > 0) {
|
|
174
|
-
|
|
169
|
+
arrayRemove(srcOutEdges, (edge) => edge.src === src.key);
|
|
175
170
|
}
|
|
176
171
|
const destInEdges = this._inEdgeMap.get(dest);
|
|
177
172
|
if (destInEdges && destInEdges.length > 0) {
|
|
178
|
-
removed =
|
|
173
|
+
removed = arrayRemove(destInEdges, (edge) => edge.dest === dest.key)[0];
|
|
179
174
|
}
|
|
180
175
|
}
|
|
181
176
|
return removed;
|
|
@@ -529,4 +524,3 @@ class DirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
529
524
|
}
|
|
530
525
|
}
|
|
531
526
|
}
|
|
532
|
-
exports.DirectedGraph = DirectedGraph;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.MapGraph = exports.MapEdge = exports.MapVertex = void 0;
|
|
4
|
-
const directed_graph_1 = require("./directed-graph");
|
|
5
|
-
class MapVertex extends directed_graph_1.DirectedVertex {
|
|
1
|
+
import { DirectedEdge, DirectedGraph, DirectedVertex } from './directed-graph';
|
|
2
|
+
export class MapVertex extends DirectedVertex {
|
|
6
3
|
lat;
|
|
7
4
|
long;
|
|
8
5
|
/**
|
|
@@ -23,8 +20,7 @@ class MapVertex extends directed_graph_1.DirectedVertex {
|
|
|
23
20
|
this.long = long;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
class MapEdge extends directed_graph_1.DirectedEdge {
|
|
23
|
+
export class MapEdge extends DirectedEdge {
|
|
28
24
|
/**
|
|
29
25
|
* The constructor function initializes a new instance of a class with the given source, destination, weight, and
|
|
30
26
|
* value.
|
|
@@ -39,8 +35,7 @@ class MapEdge extends directed_graph_1.DirectedEdge {
|
|
|
39
35
|
super(src, dest, weight, value);
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
class MapGraph extends directed_graph_1.DirectedGraph {
|
|
38
|
+
export class MapGraph extends DirectedGraph {
|
|
44
39
|
/**
|
|
45
40
|
* The constructor function initializes the origin and bottomRight properties of a MapGraphCoordinate object.
|
|
46
41
|
* @param {MapGraphCoordinate} origin - The `origin` parameter is a `MapGraphCoordinate` object that represents the
|
|
@@ -93,4 +88,3 @@ class MapGraph extends directed_graph_1.DirectedGraph {
|
|
|
93
88
|
return new MapEdge(src, dest, weight, value);
|
|
94
89
|
}
|
|
95
90
|
}
|
|
96
|
-
exports.MapGraph = MapGraph;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UndirectedGraph = exports.UndirectedEdge = exports.UndirectedVertex = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,9 +5,9 @@ exports.UndirectedGraph = exports.UndirectedEdge = exports.UndirectedVertex = vo
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class UndirectedVertex extends
|
|
8
|
+
import { arrayRemove } from '../../utils';
|
|
9
|
+
import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
|
|
10
|
+
export class UndirectedVertex extends AbstractVertex {
|
|
14
11
|
/**
|
|
15
12
|
* The constructor function initializes a vertex with an optional value.
|
|
16
13
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
|
|
@@ -22,8 +19,7 @@ class UndirectedVertex extends abstract_graph_1.AbstractVertex {
|
|
|
22
19
|
super(key, value);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
class UndirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
22
|
+
export class UndirectedEdge extends AbstractEdge {
|
|
27
23
|
vertices;
|
|
28
24
|
/**
|
|
29
25
|
* The constructor function creates an instance of a class with two vertex IDs, an optional weight, and an optional
|
|
@@ -40,8 +36,7 @@ class UndirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
|
40
36
|
this.vertices = [v1, v2];
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
|
-
|
|
44
|
-
class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
39
|
+
export class UndirectedGraph extends AbstractGraph {
|
|
45
40
|
/**
|
|
46
41
|
* The constructor initializes a new Map object to store edges.
|
|
47
42
|
*/
|
|
@@ -127,11 +122,11 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
127
122
|
const v1Edges = this._edges.get(vertex1);
|
|
128
123
|
let removed = null;
|
|
129
124
|
if (v1Edges) {
|
|
130
|
-
removed =
|
|
125
|
+
removed = arrayRemove(v1Edges, (e) => e.vertices.includes(vertex2.key))[0] || null;
|
|
131
126
|
}
|
|
132
127
|
const v2Edges = this._edges.get(vertex2);
|
|
133
128
|
if (v2Edges) {
|
|
134
|
-
|
|
129
|
+
arrayRemove(v2Edges, (e) => e.vertices.includes(vertex1.key));
|
|
135
130
|
}
|
|
136
131
|
return removed;
|
|
137
132
|
}
|
|
@@ -299,4 +294,3 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
299
294
|
return true;
|
|
300
295
|
}
|
|
301
296
|
}
|
|
302
|
-
exports.UndirectedGraph = UndirectedGraph;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoordinateMap = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.CoordinateMap = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
class CoordinateMap extends Map {
|
|
8
|
+
export class CoordinateMap extends Map {
|
|
12
9
|
constructor(joint) {
|
|
13
10
|
super();
|
|
14
11
|
if (joint !== undefined)
|
|
@@ -59,4 +56,3 @@ class CoordinateMap extends Map {
|
|
|
59
56
|
return super.delete(key.join(this._joint));
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
exports.CoordinateMap = CoordinateMap;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoordinateSet = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.CoordinateSet = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
class CoordinateSet extends Set {
|
|
8
|
+
export class CoordinateSet extends Set {
|
|
12
9
|
constructor(joint) {
|
|
13
10
|
super();
|
|
14
11
|
if (joint !== undefined)
|
|
@@ -49,4 +46,3 @@ class CoordinateSet extends Set {
|
|
|
49
46
|
return super.delete(value.join(this._joint));
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
exports.CoordinateSet = CoordinateSet;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HashMap = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.HashMap = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
class HashMap {
|
|
8
|
+
export class HashMap {
|
|
12
9
|
/**
|
|
13
10
|
* The constructor initializes the properties of a hash table, including the initial capacity, load factor, capacity
|
|
14
11
|
* multiplier, size, table array, and hash function.
|
|
@@ -156,4 +153,3 @@ class HashMap {
|
|
|
156
153
|
this._table = newTable; // Again, here is this._table
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
|
-
exports.HashMap = HashMap;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* data-structure-typed
|
|
4
3
|
*
|
|
@@ -6,9 +5,7 @@
|
|
|
6
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
7
6
|
* @license MIT License
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.HashTable = exports.HashTableNode = void 0;
|
|
11
|
-
class HashTableNode {
|
|
8
|
+
export class HashTableNode {
|
|
12
9
|
key;
|
|
13
10
|
value;
|
|
14
11
|
next;
|
|
@@ -18,8 +15,7 @@ class HashTableNode {
|
|
|
18
15
|
this.next = null;
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
|
|
22
|
-
class HashTable {
|
|
18
|
+
export class HashTable {
|
|
23
19
|
static DEFAULT_CAPACITY = 16;
|
|
24
20
|
static LOAD_FACTOR = 0.75;
|
|
25
21
|
constructor(capacity = HashTable.DEFAULT_CAPACITY, hashFn) {
|
|
@@ -240,4 +236,3 @@ class HashTable {
|
|
|
240
236
|
this._capacity = newCapacity;
|
|
241
237
|
}
|
|
242
238
|
}
|
|
243
|
-
exports.HashTable = HashTable;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* data-structure-typed
|
|
4
3
|
* @author Kirk Qi
|
|
5
4
|
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
6
5
|
* @license MIT License
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.FibonacciHeap = exports.FibonacciHeapNode = exports.Heap = void 0;
|
|
10
|
-
class Heap {
|
|
7
|
+
export class Heap {
|
|
11
8
|
constructor(options) {
|
|
12
9
|
this._comparator = options.comparator;
|
|
13
10
|
if (options.nodes && options.nodes.length > 0) {
|
|
@@ -329,8 +326,7 @@ class Heap {
|
|
|
329
326
|
this.sinkDown(i);
|
|
330
327
|
}
|
|
331
328
|
}
|
|
332
|
-
|
|
333
|
-
class FibonacciHeapNode {
|
|
329
|
+
export class FibonacciHeapNode {
|
|
334
330
|
element;
|
|
335
331
|
degree;
|
|
336
332
|
left;
|
|
@@ -344,8 +340,7 @@ class FibonacciHeapNode {
|
|
|
344
340
|
this.marked = false;
|
|
345
341
|
}
|
|
346
342
|
}
|
|
347
|
-
|
|
348
|
-
class FibonacciHeap {
|
|
343
|
+
export class FibonacciHeap {
|
|
349
344
|
constructor(comparator) {
|
|
350
345
|
this.clear();
|
|
351
346
|
this._comparator = comparator || this.defaultComparator;
|
|
@@ -685,4 +680,3 @@ class FibonacciHeap {
|
|
|
685
680
|
}
|
|
686
681
|
}
|
|
687
682
|
}
|
|
688
|
-
exports.FibonacciHeap = FibonacciHeap;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* data-structure-typed
|
|
4
3
|
*
|
|
@@ -6,10 +5,8 @@
|
|
|
6
5
|
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
7
6
|
* @license MIT License
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const heap_1 = require("./heap");
|
|
12
|
-
class MaxHeap extends heap_1.Heap {
|
|
8
|
+
import { Heap } from './heap';
|
|
9
|
+
export class MaxHeap extends Heap {
|
|
13
10
|
constructor(options = {
|
|
14
11
|
comparator: (a, b) => {
|
|
15
12
|
if (!(typeof a === 'number' && typeof b === 'number')) {
|
|
@@ -23,4 +20,3 @@ class MaxHeap extends heap_1.Heap {
|
|
|
23
20
|
super(options);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.MaxHeap = MaxHeap;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* data-structure-typed
|
|
4
3
|
*
|
|
@@ -6,10 +5,8 @@
|
|
|
6
5
|
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
7
6
|
* @license MIT License
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const heap_1 = require("./heap");
|
|
12
|
-
class MinHeap extends heap_1.Heap {
|
|
8
|
+
import { Heap } from './heap';
|
|
9
|
+
export class MinHeap extends Heap {
|
|
13
10
|
constructor(options = {
|
|
14
11
|
comparator: (a, b) => {
|
|
15
12
|
if (!(typeof a === 'number' && typeof b === 'number')) {
|
|
@@ -23,4 +20,3 @@ class MinHeap extends heap_1.Heap {
|
|
|
23
20
|
super(options);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.MinHeap = MinHeap;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './hash';
|
|
2
|
+
export * from './linked-list';
|
|
3
|
+
export * from './stack';
|
|
4
|
+
export * from './queue';
|
|
5
|
+
export * from './graph';
|
|
6
|
+
export * from './binary-tree';
|
|
7
|
+
export * from './tree';
|
|
8
|
+
export * from './heap';
|
|
9
|
+
export * from './priority-queue';
|
|
10
|
+
export * from './matrix';
|
|
11
|
+
export * from './trie';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DoublyLinkedList = exports.DoublyLinkedListNode = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.DoublyLinkedList = exports.DoublyLinkedListNode = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
class DoublyLinkedListNode {
|
|
8
|
+
export class DoublyLinkedListNode {
|
|
12
9
|
value;
|
|
13
10
|
next;
|
|
14
11
|
prev;
|
|
@@ -23,8 +20,7 @@ class DoublyLinkedListNode {
|
|
|
23
20
|
this.prev = null;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
class DoublyLinkedList {
|
|
23
|
+
export class DoublyLinkedList {
|
|
28
24
|
/**
|
|
29
25
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
30
26
|
*/
|
|
@@ -773,4 +769,3 @@ class DoublyLinkedList {
|
|
|
773
769
|
}
|
|
774
770
|
}
|
|
775
771
|
}
|
|
776
|
-
exports.DoublyLinkedList = DoublyLinkedList;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SinglyLinkedList = exports.SinglyLinkedListNode = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* data-structure-typed
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.SinglyLinkedList = exports.SinglyLinkedListNode = void 0;
|
|
|
8
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
6
|
* @license MIT License
|
|
10
7
|
*/
|
|
11
|
-
class SinglyLinkedListNode {
|
|
8
|
+
export class SinglyLinkedListNode {
|
|
12
9
|
value;
|
|
13
10
|
next;
|
|
14
11
|
/**
|
|
@@ -21,8 +18,7 @@ class SinglyLinkedListNode {
|
|
|
21
18
|
this.next = null;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
class SinglyLinkedList {
|
|
21
|
+
export class SinglyLinkedList {
|
|
26
22
|
/**
|
|
27
23
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
28
24
|
*/
|
|
@@ -717,4 +713,3 @@ class SinglyLinkedList {
|
|
|
717
713
|
}
|
|
718
714
|
}
|
|
719
715
|
}
|
|
720
|
-
exports.SinglyLinkedList = SinglyLinkedList;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* data-structure-typed
|
|
4
3
|
*
|
|
@@ -6,9 +5,7 @@
|
|
|
6
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
7
6
|
* @license MIT License
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.SkipList = exports.SkipListNode = void 0;
|
|
11
|
-
class SkipListNode {
|
|
8
|
+
export class SkipListNode {
|
|
12
9
|
key;
|
|
13
10
|
value;
|
|
14
11
|
forward;
|
|
@@ -18,8 +15,7 @@ class SkipListNode {
|
|
|
18
15
|
this.forward = new Array(level);
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
|
|
22
|
-
class SkipList {
|
|
18
|
+
export class SkipList {
|
|
23
19
|
/**
|
|
24
20
|
* The constructor initializes a SkipList with a specified maximum level and probability.
|
|
25
21
|
* @param [maxLevel=16] - The `maxLevel` parameter represents the maximum level that a skip list can have. It determines
|
|
@@ -255,4 +251,3 @@ class SkipList {
|
|
|
255
251
|
return level;
|
|
256
252
|
}
|
|
257
253
|
}
|
|
258
|
-
exports.SkipList = SkipList;
|