data-structure-typed 1.43.3 → 1.44.1
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/CHANGELOG.md +1 -1
- package/README.md +15 -15
- package/benchmark/report.html +30 -30
- package/benchmark/report.json +152 -206
- 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/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/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/data-structures/binary-tree/tree-multimap.js.map +1 -0
- 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/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.d.ts +1 -0
- package/dist/cjs/types/data-structures/graph/directed-graph.js +3 -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.js +35 -40
- 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/mjs/{src/data-structures → data-structures}/binary-tree/rb-tree.js +42 -47
- 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 +10 -15
- package/dist/mjs/{src/data-structures → data-structures}/graph/abstract-graph.js +9 -15
- 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/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.d.ts +1 -0
- package/dist/mjs/types/data-structures/graph/index.js +3 -0
- package/dist/mjs/types/data-structures/hash/hash-table.d.ts +1 -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 +288 -201
- package/dist/umd/data-structure-typed.min.js +5 -10
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +21 -20
- package/src/types/data-structures/graph/directed-graph.ts +0 -6
- package/test/config.ts +1 -1
- package/test/integration/all-in-one.ts +110 -0
- package/test/performance/reportor.ts +2 -2
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +2 -2
- package/tsconfig-base.json +0 -1
- package/tsconfig-cjs.json +4 -3
- package/tsconfig-mjs.json +5 -3
- package/tsup.config.js +22 -18
- 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.d.ts +0 -6
- package/dist/cjs/src/types/data-structures/graph/directed-graph.js +0 -10
- 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.d.ts +0 -6
- 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/binary-tree.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-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/rb-tree.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/rb-tree.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/cjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.js +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/graph/abstract-graph.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/graph/abstract-graph.js +0 -0
- /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.d.ts +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/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/binary-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/rb-tree.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/binary-tree/tree-multimap.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/graph/abstract-graph.d.ts +0 -0
- /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 → interfaces}/binary-tree.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/data-structures/matrix/matrix.d.ts → types/data-structures/graph/directed-graph.js} +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/matrix2d.d.ts → types/data-structures/graph/map-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/vector2d.d.ts → types/data-structures/graph/undirected-graph.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/max-priority-queue.d.ts → types/data-structures/graph/undirected-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/min-priority-queue.d.ts → types/data-structures/hash/coordinate-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/deque.d.ts → types/data-structures/hash/coordinate-map.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/queue.d.ts → types/data-structures/hash/coordinate-set.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/stack/stack.d.ts → types/data-structures/hash/coordinate-set.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/tree/tree.d.ts → types/data-structures/hash/hash-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/trie/trie.d.ts → types/data-structures/hash/hash-map.js} +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
|
@@ -4,6 +4,12 @@ var dataStructureTyped = (() => {
|
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __knownSymbol = (name, symbol) => {
|
|
8
|
+
if (symbol = Symbol[name])
|
|
9
|
+
return symbol;
|
|
10
|
+
throw Error("Symbol." + name + " is not defined");
|
|
11
|
+
};
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
13
|
var __export = (target, all) => {
|
|
8
14
|
for (var name in all)
|
|
9
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,6 +23,67 @@ var dataStructureTyped = (() => {
|
|
|
17
23
|
return to;
|
|
18
24
|
};
|
|
19
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var __publicField = (obj, key, value) => {
|
|
27
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
var __async = (__this, __arguments, generator) => {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
var fulfilled = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
step(generator.next(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var rejected = (value) => {
|
|
40
|
+
try {
|
|
41
|
+
step(generator.throw(value));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
47
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var __await = function(promise, isYieldStar) {
|
|
51
|
+
this[0] = promise;
|
|
52
|
+
this[1] = isYieldStar;
|
|
53
|
+
};
|
|
54
|
+
var __yieldStar = (value) => {
|
|
55
|
+
var obj = value[__knownSymbol("asyncIterator")];
|
|
56
|
+
var isAwait = false;
|
|
57
|
+
var method;
|
|
58
|
+
var it = {};
|
|
59
|
+
if (obj == null) {
|
|
60
|
+
obj = value[__knownSymbol("iterator")]();
|
|
61
|
+
method = (k) => it[k] = (x) => obj[k](x);
|
|
62
|
+
} else {
|
|
63
|
+
obj = obj.call(value);
|
|
64
|
+
method = (k) => it[k] = (v) => {
|
|
65
|
+
if (isAwait) {
|
|
66
|
+
isAwait = false;
|
|
67
|
+
if (k === "throw")
|
|
68
|
+
throw v;
|
|
69
|
+
return v;
|
|
70
|
+
}
|
|
71
|
+
isAwait = true;
|
|
72
|
+
return {
|
|
73
|
+
done: false,
|
|
74
|
+
value: new __await(new Promise((resolve) => {
|
|
75
|
+
var x = obj[k](v);
|
|
76
|
+
if (!(x instanceof Object))
|
|
77
|
+
throw TypeError("Object expected");
|
|
78
|
+
resolve(x);
|
|
79
|
+
}), 1)
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
|
|
84
|
+
throw x;
|
|
85
|
+
}, "return" in obj && method("return"), it;
|
|
86
|
+
};
|
|
20
87
|
|
|
21
88
|
// src/index.ts
|
|
22
89
|
var src_exports = {};
|
|
@@ -75,7 +142,6 @@ var dataStructureTyped = (() => {
|
|
|
75
142
|
SkipListNode: () => SkipListNode,
|
|
76
143
|
Stack: () => Stack,
|
|
77
144
|
THUNK_SYMBOL: () => THUNK_SYMBOL,
|
|
78
|
-
TopologicalProperty: () => TopologicalProperty,
|
|
79
145
|
TreeMap: () => TreeMap,
|
|
80
146
|
TreeMultimap: () => TreeMultimap,
|
|
81
147
|
TreeMultimapNode: () => TreeMultimapNode,
|
|
@@ -98,37 +164,35 @@ var dataStructureTyped = (() => {
|
|
|
98
164
|
|
|
99
165
|
// src/data-structures/hash/hash-table.ts
|
|
100
166
|
var HashTableNode = class {
|
|
101
|
-
key;
|
|
102
|
-
value;
|
|
103
|
-
next;
|
|
104
167
|
constructor(key, value) {
|
|
168
|
+
__publicField(this, "key");
|
|
169
|
+
__publicField(this, "value");
|
|
170
|
+
__publicField(this, "next");
|
|
105
171
|
this.key = key;
|
|
106
172
|
this.value = value;
|
|
107
173
|
this.next = null;
|
|
108
174
|
}
|
|
109
175
|
};
|
|
110
|
-
var
|
|
111
|
-
static DEFAULT_CAPACITY = 16;
|
|
112
|
-
static LOAD_FACTOR = 0.75;
|
|
176
|
+
var _HashTable = class _HashTable {
|
|
113
177
|
constructor(capacity = _HashTable.DEFAULT_CAPACITY, hashFn) {
|
|
178
|
+
__publicField(this, "_capacity");
|
|
179
|
+
__publicField(this, "_size");
|
|
180
|
+
__publicField(this, "_buckets");
|
|
181
|
+
__publicField(this, "_hashFn");
|
|
114
182
|
this._hashFn = hashFn || this._defaultHashFn;
|
|
115
183
|
this._capacity = Math.max(capacity, _HashTable.DEFAULT_CAPACITY);
|
|
116
184
|
this._size = 0;
|
|
117
185
|
this._buckets = new Array(this._capacity).fill(null);
|
|
118
186
|
}
|
|
119
|
-
_capacity;
|
|
120
187
|
get capacity() {
|
|
121
188
|
return this._capacity;
|
|
122
189
|
}
|
|
123
|
-
_size;
|
|
124
190
|
get size() {
|
|
125
191
|
return this._size;
|
|
126
192
|
}
|
|
127
|
-
_buckets;
|
|
128
193
|
get buckets() {
|
|
129
194
|
return this._buckets;
|
|
130
195
|
}
|
|
131
|
-
_hashFn;
|
|
132
196
|
get hashFn() {
|
|
133
197
|
return this._hashFn;
|
|
134
198
|
}
|
|
@@ -316,15 +380,18 @@ var dataStructureTyped = (() => {
|
|
|
316
380
|
this._capacity = newCapacity;
|
|
317
381
|
}
|
|
318
382
|
};
|
|
383
|
+
__publicField(_HashTable, "DEFAULT_CAPACITY", 16);
|
|
384
|
+
__publicField(_HashTable, "LOAD_FACTOR", 0.75);
|
|
385
|
+
var HashTable = _HashTable;
|
|
319
386
|
|
|
320
387
|
// src/data-structures/hash/coordinate-map.ts
|
|
321
388
|
var CoordinateMap = class extends Map {
|
|
322
389
|
constructor(joint) {
|
|
323
390
|
super();
|
|
391
|
+
__publicField(this, "_joint", "_");
|
|
324
392
|
if (joint !== void 0)
|
|
325
393
|
this._joint = joint;
|
|
326
394
|
}
|
|
327
|
-
_joint = "_";
|
|
328
395
|
get joint() {
|
|
329
396
|
return this._joint;
|
|
330
397
|
}
|
|
@@ -374,10 +441,10 @@ var dataStructureTyped = (() => {
|
|
|
374
441
|
var CoordinateSet = class extends Set {
|
|
375
442
|
constructor(joint) {
|
|
376
443
|
super();
|
|
444
|
+
__publicField(this, "_joint", "_");
|
|
377
445
|
if (joint !== void 0)
|
|
378
446
|
this._joint = joint;
|
|
379
447
|
}
|
|
380
|
-
_joint = "_";
|
|
381
448
|
get joint() {
|
|
382
449
|
return this._joint;
|
|
383
450
|
}
|
|
@@ -436,6 +503,12 @@ var dataStructureTyped = (() => {
|
|
|
436
503
|
* default hash function converts the key to a string, calculates the sum of the
|
|
437
504
|
*/
|
|
438
505
|
constructor(initialCapacity = 16, loadFactor = 0.75, hashFn) {
|
|
506
|
+
__publicField(this, "_initialCapacity");
|
|
507
|
+
__publicField(this, "_loadFactor");
|
|
508
|
+
__publicField(this, "_capacityMultiplier");
|
|
509
|
+
__publicField(this, "_size");
|
|
510
|
+
__publicField(this, "_table");
|
|
511
|
+
__publicField(this, "_hashFn");
|
|
439
512
|
this._initialCapacity = initialCapacity;
|
|
440
513
|
this._loadFactor = loadFactor;
|
|
441
514
|
this._capacityMultiplier = 2;
|
|
@@ -450,27 +523,21 @@ var dataStructureTyped = (() => {
|
|
|
450
523
|
return hash % this.table.length;
|
|
451
524
|
});
|
|
452
525
|
}
|
|
453
|
-
_initialCapacity;
|
|
454
526
|
get initialCapacity() {
|
|
455
527
|
return this._initialCapacity;
|
|
456
528
|
}
|
|
457
|
-
_loadFactor;
|
|
458
529
|
get loadFactor() {
|
|
459
530
|
return this._loadFactor;
|
|
460
531
|
}
|
|
461
|
-
_capacityMultiplier;
|
|
462
532
|
get capacityMultiplier() {
|
|
463
533
|
return this._capacityMultiplier;
|
|
464
534
|
}
|
|
465
|
-
_size;
|
|
466
535
|
get size() {
|
|
467
536
|
return this._size;
|
|
468
537
|
}
|
|
469
|
-
_table;
|
|
470
538
|
get table() {
|
|
471
539
|
return this._table;
|
|
472
540
|
}
|
|
473
|
-
_hashFn;
|
|
474
541
|
get hashFn() {
|
|
475
542
|
return this._hashFn;
|
|
476
543
|
}
|
|
@@ -568,14 +635,14 @@ var dataStructureTyped = (() => {
|
|
|
568
635
|
|
|
569
636
|
// src/data-structures/linked-list/singly-linked-list.ts
|
|
570
637
|
var SinglyLinkedListNode = class {
|
|
571
|
-
value;
|
|
572
|
-
next;
|
|
573
638
|
/**
|
|
574
639
|
* The constructor function initializes an instance of a class with a given value and sets the next property to null.
|
|
575
640
|
* @param {E} value - The "value" parameter is of type E, which means it can be any data type. It represents the value that
|
|
576
641
|
* will be stored in the node of a linked list.
|
|
577
642
|
*/
|
|
578
643
|
constructor(value) {
|
|
644
|
+
__publicField(this, "value");
|
|
645
|
+
__publicField(this, "next");
|
|
579
646
|
this.value = value;
|
|
580
647
|
this.next = null;
|
|
581
648
|
}
|
|
@@ -585,19 +652,19 @@ var dataStructureTyped = (() => {
|
|
|
585
652
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
586
653
|
*/
|
|
587
654
|
constructor() {
|
|
655
|
+
__publicField(this, "_head");
|
|
656
|
+
__publicField(this, "_tail");
|
|
657
|
+
__publicField(this, "_length");
|
|
588
658
|
this._head = null;
|
|
589
659
|
this._tail = null;
|
|
590
660
|
this._length = 0;
|
|
591
661
|
}
|
|
592
|
-
_head;
|
|
593
662
|
get head() {
|
|
594
663
|
return this._head;
|
|
595
664
|
}
|
|
596
|
-
_tail;
|
|
597
665
|
get tail() {
|
|
598
666
|
return this._tail;
|
|
599
667
|
}
|
|
600
|
-
_length;
|
|
601
668
|
get length() {
|
|
602
669
|
return this._length;
|
|
603
670
|
}
|
|
@@ -1272,15 +1339,15 @@ var dataStructureTyped = (() => {
|
|
|
1272
1339
|
|
|
1273
1340
|
// src/data-structures/linked-list/doubly-linked-list.ts
|
|
1274
1341
|
var DoublyLinkedListNode = class {
|
|
1275
|
-
value;
|
|
1276
|
-
next;
|
|
1277
|
-
prev;
|
|
1278
1342
|
/**
|
|
1279
1343
|
* The constructor function initializes the value, next, and previous properties of an object.
|
|
1280
1344
|
* @param {E} value - The "value" parameter is the value that will be stored in the node. It can be of any data type, as it
|
|
1281
1345
|
* is defined as a generic type "E".
|
|
1282
1346
|
*/
|
|
1283
1347
|
constructor(value) {
|
|
1348
|
+
__publicField(this, "value");
|
|
1349
|
+
__publicField(this, "next");
|
|
1350
|
+
__publicField(this, "prev");
|
|
1284
1351
|
this.value = value;
|
|
1285
1352
|
this.next = null;
|
|
1286
1353
|
this.prev = null;
|
|
@@ -1291,19 +1358,19 @@ var dataStructureTyped = (() => {
|
|
|
1291
1358
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
1292
1359
|
*/
|
|
1293
1360
|
constructor() {
|
|
1361
|
+
__publicField(this, "_head");
|
|
1362
|
+
__publicField(this, "_tail");
|
|
1363
|
+
__publicField(this, "_length");
|
|
1294
1364
|
this._head = null;
|
|
1295
1365
|
this._tail = null;
|
|
1296
1366
|
this._length = 0;
|
|
1297
1367
|
}
|
|
1298
|
-
_head;
|
|
1299
1368
|
get head() {
|
|
1300
1369
|
return this._head;
|
|
1301
1370
|
}
|
|
1302
|
-
_tail;
|
|
1303
1371
|
get tail() {
|
|
1304
1372
|
return this._tail;
|
|
1305
1373
|
}
|
|
1306
|
-
_length;
|
|
1307
1374
|
get length() {
|
|
1308
1375
|
return this._length;
|
|
1309
1376
|
}
|
|
@@ -1500,7 +1567,8 @@ var dataStructureTyped = (() => {
|
|
|
1500
1567
|
* @returns The method `getFirst()` returns the first node of the doubly linked list, or `null` if the list is empty.
|
|
1501
1568
|
*/
|
|
1502
1569
|
getFirst() {
|
|
1503
|
-
|
|
1570
|
+
var _a;
|
|
1571
|
+
return (_a = this.head) == null ? void 0 : _a.value;
|
|
1504
1572
|
}
|
|
1505
1573
|
/**
|
|
1506
1574
|
* Time Complexity: O(n), where n is the number of elements in the linked list.
|
|
@@ -1514,7 +1582,8 @@ var dataStructureTyped = (() => {
|
|
|
1514
1582
|
* @returns The method `getLast()` returns the last node of the doubly linked list, or `null` if the list is empty.
|
|
1515
1583
|
*/
|
|
1516
1584
|
getLast() {
|
|
1517
|
-
|
|
1585
|
+
var _a;
|
|
1586
|
+
return (_a = this.tail) == null ? void 0 : _a.value;
|
|
1518
1587
|
}
|
|
1519
1588
|
/**
|
|
1520
1589
|
* Time Complexity: O(n), where n is the number of elements in the linked list.
|
|
@@ -2029,10 +2098,10 @@ var dataStructureTyped = (() => {
|
|
|
2029
2098
|
|
|
2030
2099
|
// src/data-structures/linked-list/skip-linked-list.ts
|
|
2031
2100
|
var SkipListNode = class {
|
|
2032
|
-
key;
|
|
2033
|
-
value;
|
|
2034
|
-
forward;
|
|
2035
2101
|
constructor(key, value, level) {
|
|
2102
|
+
__publicField(this, "key");
|
|
2103
|
+
__publicField(this, "value");
|
|
2104
|
+
__publicField(this, "forward");
|
|
2036
2105
|
this.key = key;
|
|
2037
2106
|
this.value = value;
|
|
2038
2107
|
this.forward = new Array(level);
|
|
@@ -2047,24 +2116,24 @@ var dataStructureTyped = (() => {
|
|
|
2047
2116
|
* level in the skip list. It is used to determine the height of each node in the skip list.
|
|
2048
2117
|
*/
|
|
2049
2118
|
constructor(maxLevel = 16, probability = 0.5) {
|
|
2119
|
+
__publicField(this, "_head");
|
|
2120
|
+
__publicField(this, "_level");
|
|
2121
|
+
__publicField(this, "_maxLevel");
|
|
2122
|
+
__publicField(this, "_probability");
|
|
2050
2123
|
this._head = new SkipListNode(null, null, maxLevel);
|
|
2051
2124
|
this._level = 0;
|
|
2052
2125
|
this._maxLevel = maxLevel;
|
|
2053
2126
|
this._probability = probability;
|
|
2054
2127
|
}
|
|
2055
|
-
_head;
|
|
2056
2128
|
get head() {
|
|
2057
2129
|
return this._head;
|
|
2058
2130
|
}
|
|
2059
|
-
_level;
|
|
2060
2131
|
get level() {
|
|
2061
2132
|
return this._level;
|
|
2062
2133
|
}
|
|
2063
|
-
_maxLevel;
|
|
2064
2134
|
get maxLevel() {
|
|
2065
2135
|
return this._maxLevel;
|
|
2066
2136
|
}
|
|
2067
|
-
_probability;
|
|
2068
2137
|
get probability() {
|
|
2069
2138
|
return this._probability;
|
|
2070
2139
|
}
|
|
@@ -2284,9 +2353,9 @@ var dataStructureTyped = (() => {
|
|
|
2284
2353
|
* is provided and is an array, it is assigned to the `_elements
|
|
2285
2354
|
*/
|
|
2286
2355
|
constructor(elements) {
|
|
2356
|
+
__publicField(this, "_elements");
|
|
2287
2357
|
this._elements = Array.isArray(elements) ? elements : [];
|
|
2288
2358
|
}
|
|
2289
|
-
_elements;
|
|
2290
2359
|
get elements() {
|
|
2291
2360
|
return this._elements;
|
|
2292
2361
|
}
|
|
@@ -2426,7 +2495,8 @@ var dataStructureTyped = (() => {
|
|
|
2426
2495
|
* @returns The `getFirst()` method is returning the value of the `head` node if it exists, otherwise it returns `undefined`.
|
|
2427
2496
|
*/
|
|
2428
2497
|
getFirst() {
|
|
2429
|
-
|
|
2498
|
+
var _a;
|
|
2499
|
+
return (_a = this.head) == null ? void 0 : _a.value;
|
|
2430
2500
|
}
|
|
2431
2501
|
/**
|
|
2432
2502
|
* The `peek` function returns the value of the head node in a linked list, or `undefined` if the list is empty.
|
|
@@ -2444,14 +2514,14 @@ var dataStructureTyped = (() => {
|
|
|
2444
2514
|
* initialized as an empty array.
|
|
2445
2515
|
*/
|
|
2446
2516
|
constructor(elements) {
|
|
2517
|
+
__publicField(this, "_nodes");
|
|
2518
|
+
__publicField(this, "_offset");
|
|
2447
2519
|
this._nodes = elements || [];
|
|
2448
2520
|
this._offset = 0;
|
|
2449
2521
|
}
|
|
2450
|
-
_nodes;
|
|
2451
2522
|
get nodes() {
|
|
2452
2523
|
return this._nodes;
|
|
2453
2524
|
}
|
|
2454
|
-
_offset;
|
|
2455
2525
|
get offset() {
|
|
2456
2526
|
return this._offset;
|
|
2457
2527
|
}
|
|
@@ -2674,26 +2744,26 @@ var dataStructureTyped = (() => {
|
|
|
2674
2744
|
};
|
|
2675
2745
|
var ObjectDeque = class {
|
|
2676
2746
|
constructor(capacity) {
|
|
2747
|
+
__publicField(this, "_nodes", {});
|
|
2748
|
+
__publicField(this, "_capacity", Number.MAX_SAFE_INTEGER);
|
|
2749
|
+
__publicField(this, "_first", -1);
|
|
2750
|
+
__publicField(this, "_last", -1);
|
|
2751
|
+
__publicField(this, "_size", 0);
|
|
2677
2752
|
if (capacity !== void 0)
|
|
2678
2753
|
this._capacity = capacity;
|
|
2679
2754
|
}
|
|
2680
|
-
_nodes = {};
|
|
2681
2755
|
get nodes() {
|
|
2682
2756
|
return this._nodes;
|
|
2683
2757
|
}
|
|
2684
|
-
_capacity = Number.MAX_SAFE_INTEGER;
|
|
2685
2758
|
get capacity() {
|
|
2686
2759
|
return this._capacity;
|
|
2687
2760
|
}
|
|
2688
|
-
_first = -1;
|
|
2689
2761
|
get first() {
|
|
2690
2762
|
return this._first;
|
|
2691
2763
|
}
|
|
2692
|
-
_last = -1;
|
|
2693
2764
|
get last() {
|
|
2694
2765
|
return this._last;
|
|
2695
2766
|
}
|
|
2696
|
-
_size = 0;
|
|
2697
2767
|
get size() {
|
|
2698
2768
|
return this._size;
|
|
2699
2769
|
}
|
|
@@ -2838,7 +2908,9 @@ var dataStructureTyped = (() => {
|
|
|
2838
2908
|
}
|
|
2839
2909
|
};
|
|
2840
2910
|
var ArrayDeque = class {
|
|
2841
|
-
|
|
2911
|
+
constructor() {
|
|
2912
|
+
__publicField(this, "_nodes", []);
|
|
2913
|
+
}
|
|
2842
2914
|
get nodes() {
|
|
2843
2915
|
return this._nodes;
|
|
2844
2916
|
}
|
|
@@ -2872,7 +2944,8 @@ var dataStructureTyped = (() => {
|
|
|
2872
2944
|
* @returns The method `popLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
2873
2945
|
*/
|
|
2874
2946
|
popLast() {
|
|
2875
|
-
|
|
2947
|
+
var _a;
|
|
2948
|
+
return (_a = this.nodes.pop()) != null ? _a : null;
|
|
2876
2949
|
}
|
|
2877
2950
|
/**
|
|
2878
2951
|
* Time Complexity: O(n)
|
|
@@ -2887,7 +2960,8 @@ var dataStructureTyped = (() => {
|
|
|
2887
2960
|
* empty.
|
|
2888
2961
|
*/
|
|
2889
2962
|
popFirst() {
|
|
2890
|
-
|
|
2963
|
+
var _a;
|
|
2964
|
+
return (_a = this.nodes.shift()) != null ? _a : null;
|
|
2891
2965
|
}
|
|
2892
2966
|
/**
|
|
2893
2967
|
* Time Complexity: O(n)
|
|
@@ -2918,7 +2992,8 @@ var dataStructureTyped = (() => {
|
|
|
2918
2992
|
* empty, it will return `null`.
|
|
2919
2993
|
*/
|
|
2920
2994
|
getFirst() {
|
|
2921
|
-
|
|
2995
|
+
var _a;
|
|
2996
|
+
return (_a = this.nodes[0]) != null ? _a : null;
|
|
2922
2997
|
}
|
|
2923
2998
|
/**
|
|
2924
2999
|
* Time Complexity: O(1)
|
|
@@ -2932,7 +3007,8 @@ var dataStructureTyped = (() => {
|
|
|
2932
3007
|
* @returns The method `getLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
2933
3008
|
*/
|
|
2934
3009
|
getLast() {
|
|
2935
|
-
|
|
3010
|
+
var _a;
|
|
3011
|
+
return (_a = this.nodes[this.nodes.length - 1]) != null ? _a : null;
|
|
2936
3012
|
}
|
|
2937
3013
|
/**
|
|
2938
3014
|
* Time Complexity: O(1)
|
|
@@ -2949,7 +3025,8 @@ var dataStructureTyped = (() => {
|
|
|
2949
3025
|
* will be returned. If the element does not exist (i.e., the index is out of bounds), `null` will be returned.
|
|
2950
3026
|
*/
|
|
2951
3027
|
get(index) {
|
|
2952
|
-
|
|
3028
|
+
var _a;
|
|
3029
|
+
return (_a = this.nodes[index]) != null ? _a : null;
|
|
2953
3030
|
}
|
|
2954
3031
|
/**
|
|
2955
3032
|
* Time Complexity: O(1)
|
|
@@ -3060,13 +3137,13 @@ var dataStructureTyped = (() => {
|
|
|
3060
3137
|
var trampolineAsync = (fn) => {
|
|
3061
3138
|
const cont = (...args) => toThunk(() => fn(...args));
|
|
3062
3139
|
return Object.assign(
|
|
3063
|
-
|
|
3064
|
-
let result =
|
|
3140
|
+
(...args) => __async(void 0, null, function* () {
|
|
3141
|
+
let result = yield fn(...args);
|
|
3065
3142
|
while (isThunk(result) && typeof result === "function") {
|
|
3066
|
-
result =
|
|
3143
|
+
result = yield result();
|
|
3067
3144
|
}
|
|
3068
3145
|
return result;
|
|
3069
|
-
},
|
|
3146
|
+
}),
|
|
3070
3147
|
{ cont }
|
|
3071
3148
|
);
|
|
3072
3149
|
};
|
|
@@ -3080,17 +3157,17 @@ var dataStructureTyped = (() => {
|
|
|
3080
3157
|
// src/data-structures/heap/heap.ts
|
|
3081
3158
|
var Heap = class _Heap {
|
|
3082
3159
|
constructor(options) {
|
|
3160
|
+
__publicField(this, "_nodes", []);
|
|
3161
|
+
__publicField(this, "_comparator");
|
|
3083
3162
|
this._comparator = options.comparator;
|
|
3084
3163
|
if (options.nodes && options.nodes.length > 0) {
|
|
3085
3164
|
this._nodes = options.nodes;
|
|
3086
3165
|
this.fix();
|
|
3087
3166
|
}
|
|
3088
3167
|
}
|
|
3089
|
-
_nodes = [];
|
|
3090
3168
|
get nodes() {
|
|
3091
3169
|
return this._nodes;
|
|
3092
3170
|
}
|
|
3093
|
-
_comparator;
|
|
3094
3171
|
get comparator() {
|
|
3095
3172
|
return this._comparator;
|
|
3096
3173
|
}
|
|
@@ -3105,7 +3182,8 @@ var dataStructureTyped = (() => {
|
|
|
3105
3182
|
* @returns The last element or undefined if the heap is empty.
|
|
3106
3183
|
*/
|
|
3107
3184
|
get leaf() {
|
|
3108
|
-
|
|
3185
|
+
var _a;
|
|
3186
|
+
return (_a = this.nodes[this.size - 1]) != null ? _a : void 0;
|
|
3109
3187
|
}
|
|
3110
3188
|
/**
|
|
3111
3189
|
* Static method that creates a binary heap from an array of nodes and a comparison function.
|
|
@@ -3397,14 +3475,14 @@ var dataStructureTyped = (() => {
|
|
|
3397
3475
|
}
|
|
3398
3476
|
};
|
|
3399
3477
|
var FibonacciHeapNode = class {
|
|
3400
|
-
element;
|
|
3401
|
-
degree;
|
|
3402
|
-
left;
|
|
3403
|
-
right;
|
|
3404
|
-
child;
|
|
3405
|
-
parent;
|
|
3406
|
-
marked;
|
|
3407
3478
|
constructor(element, degree = 0) {
|
|
3479
|
+
__publicField(this, "element");
|
|
3480
|
+
__publicField(this, "degree");
|
|
3481
|
+
__publicField(this, "left");
|
|
3482
|
+
__publicField(this, "right");
|
|
3483
|
+
__publicField(this, "child");
|
|
3484
|
+
__publicField(this, "parent");
|
|
3485
|
+
__publicField(this, "marked");
|
|
3408
3486
|
this.element = element;
|
|
3409
3487
|
this.degree = degree;
|
|
3410
3488
|
this.marked = false;
|
|
@@ -3412,25 +3490,25 @@ var dataStructureTyped = (() => {
|
|
|
3412
3490
|
};
|
|
3413
3491
|
var FibonacciHeap = class {
|
|
3414
3492
|
constructor(comparator) {
|
|
3493
|
+
__publicField(this, "_root");
|
|
3494
|
+
__publicField(this, "_size", 0);
|
|
3495
|
+
__publicField(this, "_min");
|
|
3496
|
+
__publicField(this, "_comparator");
|
|
3415
3497
|
this.clear();
|
|
3416
3498
|
this._comparator = comparator || this.defaultComparator;
|
|
3417
3499
|
if (typeof this.comparator !== "function") {
|
|
3418
3500
|
throw new Error("FibonacciHeap constructor: given comparator should be a function.");
|
|
3419
3501
|
}
|
|
3420
3502
|
}
|
|
3421
|
-
_root;
|
|
3422
3503
|
get root() {
|
|
3423
3504
|
return this._root;
|
|
3424
3505
|
}
|
|
3425
|
-
_size = 0;
|
|
3426
3506
|
get size() {
|
|
3427
3507
|
return this._size;
|
|
3428
3508
|
}
|
|
3429
|
-
_min;
|
|
3430
3509
|
get min() {
|
|
3431
3510
|
return this._min;
|
|
3432
3511
|
}
|
|
3433
|
-
_comparator;
|
|
3434
3512
|
get comparator() {
|
|
3435
3513
|
return this._comparator;
|
|
3436
3514
|
}
|
|
@@ -3813,8 +3891,6 @@ var dataStructureTyped = (() => {
|
|
|
3813
3891
|
|
|
3814
3892
|
// src/data-structures/graph/abstract-graph.ts
|
|
3815
3893
|
var AbstractVertex = class {
|
|
3816
|
-
key;
|
|
3817
|
-
value;
|
|
3818
3894
|
/**
|
|
3819
3895
|
* The function is a protected constructor that takes an key and an optional value as parameters.
|
|
3820
3896
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
|
|
@@ -3823,13 +3899,13 @@ var dataStructureTyped = (() => {
|
|
|
3823
3899
|
* vertex. If no value is provided, it will be set to undefined.
|
|
3824
3900
|
*/
|
|
3825
3901
|
constructor(key, value) {
|
|
3902
|
+
__publicField(this, "key");
|
|
3903
|
+
__publicField(this, "value");
|
|
3826
3904
|
this.key = key;
|
|
3827
3905
|
this.value = value;
|
|
3828
3906
|
}
|
|
3829
3907
|
};
|
|
3830
3908
|
var AbstractEdge = class {
|
|
3831
|
-
value;
|
|
3832
|
-
weight;
|
|
3833
3909
|
/**
|
|
3834
3910
|
* The above function is a protected constructor that initializes the weight, value, and hash code properties of an
|
|
3835
3911
|
* object.
|
|
@@ -3840,11 +3916,13 @@ var dataStructureTyped = (() => {
|
|
|
3840
3916
|
* meaning it can be omitted when creating an instance of the class.
|
|
3841
3917
|
*/
|
|
3842
3918
|
constructor(weight, value) {
|
|
3919
|
+
__publicField(this, "value");
|
|
3920
|
+
__publicField(this, "weight");
|
|
3921
|
+
__publicField(this, "_hashCode");
|
|
3843
3922
|
this.weight = weight !== void 0 ? weight : 1;
|
|
3844
3923
|
this.value = value;
|
|
3845
3924
|
this._hashCode = uuidV4();
|
|
3846
3925
|
}
|
|
3847
|
-
_hashCode;
|
|
3848
3926
|
get hashCode() {
|
|
3849
3927
|
return this._hashCode;
|
|
3850
3928
|
}
|
|
@@ -3854,7 +3932,9 @@ var dataStructureTyped = (() => {
|
|
|
3854
3932
|
*/
|
|
3855
3933
|
};
|
|
3856
3934
|
var AbstractGraph = class {
|
|
3857
|
-
|
|
3935
|
+
constructor() {
|
|
3936
|
+
__publicField(this, "_vertices", /* @__PURE__ */ new Map());
|
|
3937
|
+
}
|
|
3858
3938
|
get vertices() {
|
|
3859
3939
|
return this._vertices;
|
|
3860
3940
|
}
|
|
@@ -4063,9 +4143,10 @@ var dataStructureTyped = (() => {
|
|
|
4063
4143
|
* @returns The function `getPathSumWeight` returns the sum of the weights of the edges in the given path.
|
|
4064
4144
|
*/
|
|
4065
4145
|
getPathSumWeight(path) {
|
|
4146
|
+
var _a;
|
|
4066
4147
|
let sum = 0;
|
|
4067
4148
|
for (let i = 0; i < path.length; i++) {
|
|
4068
|
-
sum += this.getEdge(path[i], path[i + 1])
|
|
4149
|
+
sum += ((_a = this.getEdge(path[i], path[i + 1])) == null ? void 0 : _a.weight) || 0;
|
|
4069
4150
|
}
|
|
4070
4151
|
return sum;
|
|
4071
4152
|
}
|
|
@@ -4155,6 +4236,7 @@ var dataStructureTyped = (() => {
|
|
|
4155
4236
|
* two vertices (`v1` and `v2`). If there is no path between the vertices, it returns `null`.
|
|
4156
4237
|
*/
|
|
4157
4238
|
getMinPathBetween(v1, v2, isWeight, isDFS = false) {
|
|
4239
|
+
var _a, _b;
|
|
4158
4240
|
if (isWeight === void 0)
|
|
4159
4241
|
isWeight = false;
|
|
4160
4242
|
if (isWeight) {
|
|
@@ -4173,7 +4255,7 @@ var dataStructureTyped = (() => {
|
|
|
4173
4255
|
}
|
|
4174
4256
|
return allPaths[minIndex] || null;
|
|
4175
4257
|
} else {
|
|
4176
|
-
return this.dijkstra(v1, v2, true, true)
|
|
4258
|
+
return (_b = (_a = this.dijkstra(v1, v2, true, true)) == null ? void 0 : _a.minPath) != null ? _b : [];
|
|
4177
4259
|
}
|
|
4178
4260
|
} else {
|
|
4179
4261
|
let minPath = [];
|
|
@@ -4362,6 +4444,7 @@ var dataStructureTyped = (() => {
|
|
|
4362
4444
|
* @returns The function `dijkstra` returns an object of type `DijkstraResult<VO>`.
|
|
4363
4445
|
*/
|
|
4364
4446
|
dijkstra(src, dest, getMinDist, genPaths) {
|
|
4447
|
+
var _a;
|
|
4365
4448
|
if (getMinDist === void 0)
|
|
4366
4449
|
getMinDist = false;
|
|
4367
4450
|
if (genPaths === void 0)
|
|
@@ -4408,8 +4491,8 @@ var dataStructureTyped = (() => {
|
|
|
4408
4491
|
};
|
|
4409
4492
|
while (heap.size > 0) {
|
|
4410
4493
|
const curHeapNode = heap.poll();
|
|
4411
|
-
const dist = curHeapNode
|
|
4412
|
-
const cur = curHeapNode
|
|
4494
|
+
const dist = curHeapNode == null ? void 0 : curHeapNode.key;
|
|
4495
|
+
const cur = curHeapNode == null ? void 0 : curHeapNode.value;
|
|
4413
4496
|
if (dist !== void 0) {
|
|
4414
4497
|
if (cur) {
|
|
4415
4498
|
seen.add(cur);
|
|
@@ -4425,7 +4508,7 @@ var dataStructureTyped = (() => {
|
|
|
4425
4508
|
const neighbors = this.getNeighbors(cur);
|
|
4426
4509
|
for (const neighbor of neighbors) {
|
|
4427
4510
|
if (!seen.has(neighbor)) {
|
|
4428
|
-
const weight = this.getEdge(cur, neighbor)
|
|
4511
|
+
const weight = (_a = this.getEdge(cur, neighbor)) == null ? void 0 : _a.weight;
|
|
4429
4512
|
if (typeof weight === "number") {
|
|
4430
4513
|
const distSrcToNeighbor = distMap.get(neighbor);
|
|
4431
4514
|
if (distSrcToNeighbor) {
|
|
@@ -4602,6 +4685,7 @@ var dataStructureTyped = (() => {
|
|
|
4602
4685
|
* path between vertices in the
|
|
4603
4686
|
*/
|
|
4604
4687
|
floydWarshall() {
|
|
4688
|
+
var _a;
|
|
4605
4689
|
const idAndVertices = [...this._vertices];
|
|
4606
4690
|
const n = idAndVertices.length;
|
|
4607
4691
|
const costs = [];
|
|
@@ -4615,7 +4699,7 @@ var dataStructureTyped = (() => {
|
|
|
4615
4699
|
}
|
|
4616
4700
|
for (let i = 0; i < n; i++) {
|
|
4617
4701
|
for (let j = 0; j < n; j++) {
|
|
4618
|
-
costs[i][j] = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])
|
|
4702
|
+
costs[i][j] = ((_a = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])) == null ? void 0 : _a.weight) || Infinity;
|
|
4619
4703
|
}
|
|
4620
4704
|
}
|
|
4621
4705
|
for (let k = 0; k < n; k++) {
|
|
@@ -4726,10 +4810,11 @@ var dataStructureTyped = (() => {
|
|
|
4726
4810
|
const getSCCs = () => {
|
|
4727
4811
|
const SCCs2 = /* @__PURE__ */ new Map();
|
|
4728
4812
|
lowMap.forEach((low, vertex) => {
|
|
4813
|
+
var _a;
|
|
4729
4814
|
if (!SCCs2.has(low)) {
|
|
4730
4815
|
SCCs2.set(low, [vertex]);
|
|
4731
4816
|
} else {
|
|
4732
|
-
SCCs2.get(low)
|
|
4817
|
+
(_a = SCCs2.get(low)) == null ? void 0 : _a.push(vertex);
|
|
4733
4818
|
}
|
|
4734
4819
|
});
|
|
4735
4820
|
return SCCs2;
|
|
@@ -4834,8 +4919,6 @@ var dataStructureTyped = (() => {
|
|
|
4834
4919
|
}
|
|
4835
4920
|
};
|
|
4836
4921
|
var DirectedEdge = class extends AbstractEdge {
|
|
4837
|
-
src;
|
|
4838
|
-
dest;
|
|
4839
4922
|
/**
|
|
4840
4923
|
* The constructor function initializes the source and destination vertices of an edge, along with an optional weight
|
|
4841
4924
|
* and value.
|
|
@@ -4849,6 +4932,8 @@ var dataStructureTyped = (() => {
|
|
|
4849
4932
|
*/
|
|
4850
4933
|
constructor(src, dest, weight, value) {
|
|
4851
4934
|
super(weight, value);
|
|
4935
|
+
__publicField(this, "src");
|
|
4936
|
+
__publicField(this, "dest");
|
|
4852
4937
|
this.src = src;
|
|
4853
4938
|
this.dest = dest;
|
|
4854
4939
|
}
|
|
@@ -4859,12 +4944,12 @@ var dataStructureTyped = (() => {
|
|
|
4859
4944
|
*/
|
|
4860
4945
|
constructor() {
|
|
4861
4946
|
super();
|
|
4947
|
+
__publicField(this, "_outEdgeMap", /* @__PURE__ */ new Map());
|
|
4948
|
+
__publicField(this, "_inEdgeMap", /* @__PURE__ */ new Map());
|
|
4862
4949
|
}
|
|
4863
|
-
_outEdgeMap = /* @__PURE__ */ new Map();
|
|
4864
4950
|
get outEdgeMap() {
|
|
4865
4951
|
return this._outEdgeMap;
|
|
4866
4952
|
}
|
|
4867
|
-
_inEdgeMap = /* @__PURE__ */ new Map();
|
|
4868
4953
|
get inEdgeMap() {
|
|
4869
4954
|
return this._inEdgeMap;
|
|
4870
4955
|
}
|
|
@@ -4882,7 +4967,7 @@ var dataStructureTyped = (() => {
|
|
|
4882
4967
|
* @returns a new instance of a DirectedVertex object, casted as type VO.
|
|
4883
4968
|
*/
|
|
4884
4969
|
createVertex(key, value) {
|
|
4885
|
-
return new DirectedVertex(key, value
|
|
4970
|
+
return new DirectedVertex(key, value != null ? value : key);
|
|
4886
4971
|
}
|
|
4887
4972
|
/**
|
|
4888
4973
|
* In TypeScript, a subclass inherits the interface implementation of its parent class, without needing to implement the same interface again in the subclass. This behavior differs from Java's approach. In Java, if a parent class implements an interface, the subclass needs to explicitly implement the same interface, even if the parent class has already implemented it.
|
|
@@ -4899,7 +4984,7 @@ var dataStructureTyped = (() => {
|
|
|
4899
4984
|
* @returns a new instance of a DirectedEdge object, casted as type EO.
|
|
4900
4985
|
*/
|
|
4901
4986
|
createEdge(src, dest, weight, value) {
|
|
4902
|
-
return new DirectedEdge(src, dest, weight
|
|
4987
|
+
return new DirectedEdge(src, dest, weight != null ? weight : 1, value);
|
|
4903
4988
|
}
|
|
4904
4989
|
/**
|
|
4905
4990
|
* Time Complexity: O(|V|) where |V| is the number of vertices
|
|
@@ -5187,7 +5272,7 @@ var dataStructureTyped = (() => {
|
|
|
5187
5272
|
* @returns an array of vertices or vertex IDs in topological order. If there is a cycle in the graph, it returns null.
|
|
5188
5273
|
*/
|
|
5189
5274
|
topologicalSort(propertyName) {
|
|
5190
|
-
propertyName = propertyName
|
|
5275
|
+
propertyName = propertyName != null ? propertyName : "key";
|
|
5191
5276
|
const statusMap = /* @__PURE__ */ new Map();
|
|
5192
5277
|
for (const entry of this.vertices) {
|
|
5193
5278
|
statusMap.set(entry[1], 0);
|
|
@@ -5344,7 +5429,6 @@ var dataStructureTyped = (() => {
|
|
|
5344
5429
|
}
|
|
5345
5430
|
};
|
|
5346
5431
|
var UndirectedEdge = class extends AbstractEdge {
|
|
5347
|
-
vertices;
|
|
5348
5432
|
/**
|
|
5349
5433
|
* The constructor function creates an instance of a class with two vertex IDs, an optional weight, and an optional
|
|
5350
5434
|
* value.
|
|
@@ -5357,6 +5441,7 @@ var dataStructureTyped = (() => {
|
|
|
5357
5441
|
*/
|
|
5358
5442
|
constructor(v1, v2, weight, value) {
|
|
5359
5443
|
super(weight, value);
|
|
5444
|
+
__publicField(this, "vertices");
|
|
5360
5445
|
this.vertices = [v1, v2];
|
|
5361
5446
|
}
|
|
5362
5447
|
};
|
|
@@ -5366,9 +5451,9 @@ var dataStructureTyped = (() => {
|
|
|
5366
5451
|
*/
|
|
5367
5452
|
constructor() {
|
|
5368
5453
|
super();
|
|
5454
|
+
__publicField(this, "_edges");
|
|
5369
5455
|
this._edges = /* @__PURE__ */ new Map();
|
|
5370
5456
|
}
|
|
5371
|
-
_edges;
|
|
5372
5457
|
get edges() {
|
|
5373
5458
|
return this._edges;
|
|
5374
5459
|
}
|
|
@@ -5382,7 +5467,7 @@ var dataStructureTyped = (() => {
|
|
|
5382
5467
|
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `VO`.
|
|
5383
5468
|
*/
|
|
5384
5469
|
createVertex(key, value) {
|
|
5385
|
-
return new UndirectedVertex(key, value
|
|
5470
|
+
return new UndirectedVertex(key, value != null ? value : key);
|
|
5386
5471
|
}
|
|
5387
5472
|
/**
|
|
5388
5473
|
* The function creates an undirected edge between two vertices with an optional weight and value.
|
|
@@ -5395,7 +5480,7 @@ var dataStructureTyped = (() => {
|
|
|
5395
5480
|
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `EO`.
|
|
5396
5481
|
*/
|
|
5397
5482
|
createEdge(v1, v2, weight, value) {
|
|
5398
|
-
return new UndirectedEdge(v1, v2, weight
|
|
5483
|
+
return new UndirectedEdge(v1, v2, weight != null ? weight : 1, value);
|
|
5399
5484
|
}
|
|
5400
5485
|
/**
|
|
5401
5486
|
* Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
|
|
@@ -5413,12 +5498,13 @@ var dataStructureTyped = (() => {
|
|
|
5413
5498
|
* @returns an edge (EO) or null.
|
|
5414
5499
|
*/
|
|
5415
5500
|
getEdge(v1, v2) {
|
|
5501
|
+
var _a;
|
|
5416
5502
|
let edges = [];
|
|
5417
5503
|
if (v1 !== null && v2 !== null) {
|
|
5418
5504
|
const vertex1 = this._getVertex(v1);
|
|
5419
5505
|
const vertex2 = this._getVertex(v2);
|
|
5420
5506
|
if (vertex1 && vertex2) {
|
|
5421
|
-
edges = this._edges.get(vertex1)
|
|
5507
|
+
edges = (_a = this._edges.get(vertex1)) == null ? void 0 : _a.filter((e) => e.vertices.includes(vertex2.key));
|
|
5422
5508
|
}
|
|
5423
5509
|
}
|
|
5424
5510
|
return edges ? edges[0] || null : null;
|
|
@@ -5484,9 +5570,10 @@ var dataStructureTyped = (() => {
|
|
|
5484
5570
|
* edges connected to that vertex.
|
|
5485
5571
|
*/
|
|
5486
5572
|
degreeOf(vertexOrKey) {
|
|
5573
|
+
var _a;
|
|
5487
5574
|
const vertex = this._getVertex(vertexOrKey);
|
|
5488
5575
|
if (vertex) {
|
|
5489
|
-
return this._edges.get(vertex)
|
|
5576
|
+
return ((_a = this._edges.get(vertex)) == null ? void 0 : _a.length) || 0;
|
|
5490
5577
|
} else {
|
|
5491
5578
|
return 0;
|
|
5492
5579
|
}
|
|
@@ -5617,8 +5704,6 @@ var dataStructureTyped = (() => {
|
|
|
5617
5704
|
|
|
5618
5705
|
// src/data-structures/graph/map-graph.ts
|
|
5619
5706
|
var MapVertex = class extends DirectedVertex {
|
|
5620
|
-
lat;
|
|
5621
|
-
long;
|
|
5622
5707
|
/**
|
|
5623
5708
|
* The constructor function initializes an object with an key, latitude, longitude, and an optional value.
|
|
5624
5709
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex.
|
|
@@ -5633,6 +5718,8 @@ var dataStructureTyped = (() => {
|
|
|
5633
5718
|
*/
|
|
5634
5719
|
constructor(key, value, lat, long) {
|
|
5635
5720
|
super(key, value);
|
|
5721
|
+
__publicField(this, "lat");
|
|
5722
|
+
__publicField(this, "long");
|
|
5636
5723
|
this.lat = lat;
|
|
5637
5724
|
this.long = long;
|
|
5638
5725
|
}
|
|
@@ -5664,14 +5751,14 @@ var dataStructureTyped = (() => {
|
|
|
5664
5751
|
*/
|
|
5665
5752
|
constructor(origin, bottomRight) {
|
|
5666
5753
|
super();
|
|
5754
|
+
__publicField(this, "_origin", [0, 0]);
|
|
5755
|
+
__publicField(this, "_bottomRight");
|
|
5667
5756
|
this._origin = origin;
|
|
5668
5757
|
this._bottomRight = bottomRight;
|
|
5669
5758
|
}
|
|
5670
|
-
_origin = [0, 0];
|
|
5671
5759
|
get origin() {
|
|
5672
5760
|
return this._origin;
|
|
5673
5761
|
}
|
|
5674
|
-
_bottomRight;
|
|
5675
5762
|
get bottomRight() {
|
|
5676
5763
|
return this._bottomRight;
|
|
5677
5764
|
}
|
|
@@ -5730,14 +5817,6 @@ var dataStructureTyped = (() => {
|
|
|
5730
5817
|
return RBTNColor2;
|
|
5731
5818
|
})(RBTNColor || {});
|
|
5732
5819
|
|
|
5733
|
-
// src/types/data-structures/graph/directed-graph.ts
|
|
5734
|
-
var TopologicalProperty = /* @__PURE__ */ ((TopologicalProperty2) => {
|
|
5735
|
-
TopologicalProperty2["VAL"] = "VAL";
|
|
5736
|
-
TopologicalProperty2["NODE"] = "NODE";
|
|
5737
|
-
TopologicalProperty2["ID"] = "ID";
|
|
5738
|
-
return TopologicalProperty2;
|
|
5739
|
-
})(TopologicalProperty || {});
|
|
5740
|
-
|
|
5741
5820
|
// src/types/helpers.ts
|
|
5742
5821
|
var CP = /* @__PURE__ */ ((CP2) => {
|
|
5743
5822
|
CP2["lt"] = "lt";
|
|
@@ -5748,28 +5827,29 @@ var dataStructureTyped = (() => {
|
|
|
5748
5827
|
|
|
5749
5828
|
// src/data-structures/binary-tree/binary-tree.ts
|
|
5750
5829
|
var BinaryTreeNode = class {
|
|
5751
|
-
/**
|
|
5752
|
-
* The key associated with the node.
|
|
5753
|
-
*/
|
|
5754
|
-
key;
|
|
5755
|
-
/**
|
|
5756
|
-
* The value stored in the node.
|
|
5757
|
-
*/
|
|
5758
|
-
value;
|
|
5759
|
-
/**
|
|
5760
|
-
* The parent node of the current node.
|
|
5761
|
-
*/
|
|
5762
|
-
parent;
|
|
5763
5830
|
/**
|
|
5764
5831
|
* Creates a new instance of BinaryTreeNode.
|
|
5765
5832
|
* @param {BTNKey} key - The key associated with the node.
|
|
5766
5833
|
* @param {V} value - The value stored in the node.
|
|
5767
5834
|
*/
|
|
5768
5835
|
constructor(key, value) {
|
|
5836
|
+
/**
|
|
5837
|
+
* The key associated with the node.
|
|
5838
|
+
*/
|
|
5839
|
+
__publicField(this, "key");
|
|
5840
|
+
/**
|
|
5841
|
+
* The value stored in the node.
|
|
5842
|
+
*/
|
|
5843
|
+
__publicField(this, "value");
|
|
5844
|
+
/**
|
|
5845
|
+
* The parent node of the current node.
|
|
5846
|
+
*/
|
|
5847
|
+
__publicField(this, "parent");
|
|
5848
|
+
__publicField(this, "_left");
|
|
5849
|
+
__publicField(this, "_right");
|
|
5769
5850
|
this.key = key;
|
|
5770
5851
|
this.value = value;
|
|
5771
5852
|
}
|
|
5772
|
-
_left;
|
|
5773
5853
|
/**
|
|
5774
5854
|
* Get the left child node.
|
|
5775
5855
|
*/
|
|
@@ -5786,7 +5866,6 @@ var dataStructureTyped = (() => {
|
|
|
5786
5866
|
}
|
|
5787
5867
|
this._left = v;
|
|
5788
5868
|
}
|
|
5789
|
-
_right;
|
|
5790
5869
|
/**
|
|
5791
5870
|
* Get the right child node.
|
|
5792
5871
|
*/
|
|
@@ -5821,26 +5900,27 @@ var dataStructureTyped = (() => {
|
|
|
5821
5900
|
}
|
|
5822
5901
|
};
|
|
5823
5902
|
var BinaryTree = class {
|
|
5824
|
-
iterationType = "ITERATIVE" /* ITERATIVE */;
|
|
5825
5903
|
/**
|
|
5826
5904
|
* Creates a new instance of BinaryTree.
|
|
5827
5905
|
* @param {BinaryTreeOptions} [options] - The options for the binary tree.
|
|
5828
5906
|
*/
|
|
5829
5907
|
constructor(options) {
|
|
5908
|
+
__publicField(this, "iterationType", "ITERATIVE" /* ITERATIVE */);
|
|
5909
|
+
__publicField(this, "_root");
|
|
5910
|
+
__publicField(this, "_size");
|
|
5911
|
+
__publicField(this, "_defaultOneParamCallback", (node) => node.key);
|
|
5830
5912
|
if (options) {
|
|
5831
5913
|
const { iterationType = "ITERATIVE" /* ITERATIVE */ } = options;
|
|
5832
5914
|
this.iterationType = iterationType;
|
|
5833
5915
|
}
|
|
5834
5916
|
this._size = 0;
|
|
5835
5917
|
}
|
|
5836
|
-
_root;
|
|
5837
5918
|
/**
|
|
5838
5919
|
* Get the root node of the binary tree.
|
|
5839
5920
|
*/
|
|
5840
5921
|
get root() {
|
|
5841
5922
|
return this._root;
|
|
5842
5923
|
}
|
|
5843
|
-
_size;
|
|
5844
5924
|
/**
|
|
5845
5925
|
* Get the number of nodes in the binary tree.
|
|
5846
5926
|
*/
|
|
@@ -5941,7 +6021,7 @@ var dataStructureTyped = (() => {
|
|
|
5941
6021
|
if (keyOrNode === null) {
|
|
5942
6022
|
return this.add(null);
|
|
5943
6023
|
}
|
|
5944
|
-
const value = values
|
|
6024
|
+
const value = values == null ? void 0 : values[i];
|
|
5945
6025
|
return this.add(keyOrNode, value);
|
|
5946
6026
|
});
|
|
5947
6027
|
}
|
|
@@ -5993,7 +6073,7 @@ var dataStructureTyped = (() => {
|
|
|
5993
6073
|
const curr = this.getNode(identifier, callback);
|
|
5994
6074
|
if (!curr)
|
|
5995
6075
|
return deletedResult;
|
|
5996
|
-
const parent = curr
|
|
6076
|
+
const parent = (curr == null ? void 0 : curr.parent) ? curr.parent : null;
|
|
5997
6077
|
let needBalanced = void 0;
|
|
5998
6078
|
let orgCurrent = curr;
|
|
5999
6079
|
if (!curr.left) {
|
|
@@ -6049,7 +6129,7 @@ var dataStructureTyped = (() => {
|
|
|
6049
6129
|
distNode = this.ensureNotKey(distNode);
|
|
6050
6130
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
6051
6131
|
let depth = 0;
|
|
6052
|
-
while (distNode
|
|
6132
|
+
while (distNode == null ? void 0 : distNode.parent) {
|
|
6053
6133
|
if (distNode === beginRoot) {
|
|
6054
6134
|
return depth;
|
|
6055
6135
|
}
|
|
@@ -6123,6 +6203,7 @@ var dataStructureTyped = (() => {
|
|
|
6123
6203
|
* @returns The function `getMinHeight` returns the minimum height of a binary tree.
|
|
6124
6204
|
*/
|
|
6125
6205
|
getMinHeight(beginRoot = this.root, iterationType = this.iterationType) {
|
|
6206
|
+
var _a, _b, _c;
|
|
6126
6207
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
6127
6208
|
if (!beginRoot)
|
|
6128
6209
|
return -1;
|
|
@@ -6150,8 +6231,8 @@ var dataStructureTyped = (() => {
|
|
|
6150
6231
|
if (!node.right || last === node.right) {
|
|
6151
6232
|
node = stack.pop();
|
|
6152
6233
|
if (node) {
|
|
6153
|
-
const leftMinHeight = node.left ? depths.get(node.left)
|
|
6154
|
-
const rightMinHeight = node.right ? depths.get(node.right)
|
|
6234
|
+
const leftMinHeight = node.left ? (_a = depths.get(node.left)) != null ? _a : -1 : -1;
|
|
6235
|
+
const rightMinHeight = node.right ? (_b = depths.get(node.right)) != null ? _b : -1 : -1;
|
|
6155
6236
|
depths.set(node, 1 + Math.min(leftMinHeight, rightMinHeight));
|
|
6156
6237
|
last = node;
|
|
6157
6238
|
node = null;
|
|
@@ -6160,7 +6241,7 @@ var dataStructureTyped = (() => {
|
|
|
6160
6241
|
node = node.right;
|
|
6161
6242
|
}
|
|
6162
6243
|
}
|
|
6163
|
-
return depths.get(beginRoot)
|
|
6244
|
+
return (_c = depths.get(beginRoot)) != null ? _c : -1;
|
|
6164
6245
|
}
|
|
6165
6246
|
}
|
|
6166
6247
|
/**
|
|
@@ -6302,9 +6383,10 @@ var dataStructureTyped = (() => {
|
|
|
6302
6383
|
* @returns a value of type `N | null | undefined`.
|
|
6303
6384
|
*/
|
|
6304
6385
|
getNode(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
6386
|
+
var _a;
|
|
6305
6387
|
if ((!callback || callback === this._defaultOneParamCallback) && identifier instanceof BinaryTreeNode)
|
|
6306
6388
|
callback = (node) => node;
|
|
6307
|
-
return this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]
|
|
6389
|
+
return (_a = this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]) != null ? _a : null;
|
|
6308
6390
|
}
|
|
6309
6391
|
/**
|
|
6310
6392
|
* Time Complexity: O(n)
|
|
@@ -6393,9 +6475,10 @@ var dataStructureTyped = (() => {
|
|
|
6393
6475
|
* found, `undefined` is returned.
|
|
6394
6476
|
*/
|
|
6395
6477
|
get(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
6478
|
+
var _a, _b;
|
|
6396
6479
|
if ((!callback || callback === this._defaultOneParamCallback) && identifier instanceof BinaryTreeNode)
|
|
6397
6480
|
callback = (node) => node;
|
|
6398
|
-
return this.getNode(identifier, callback, beginRoot, iterationType)
|
|
6481
|
+
return (_b = (_a = this.getNode(identifier, callback, beginRoot, iterationType)) == null ? void 0 : _a.value) != null ? _b : void 0;
|
|
6399
6482
|
}
|
|
6400
6483
|
/**
|
|
6401
6484
|
* Clear the binary tree, removing all nodes.
|
|
@@ -7126,11 +7209,11 @@ var dataStructureTyped = (() => {
|
|
|
7126
7209
|
}
|
|
7127
7210
|
} else {
|
|
7128
7211
|
if (node.left) {
|
|
7129
|
-
yield* this[Symbol.iterator](node.left);
|
|
7212
|
+
yield* __yieldStar(this[Symbol.iterator](node.left));
|
|
7130
7213
|
}
|
|
7131
7214
|
yield node.key;
|
|
7132
7215
|
if (node.right) {
|
|
7133
|
-
yield* this[Symbol.iterator](node.right);
|
|
7216
|
+
yield* __yieldStar(this[Symbol.iterator](node.right));
|
|
7134
7217
|
}
|
|
7135
7218
|
}
|
|
7136
7219
|
}
|
|
@@ -7195,7 +7278,6 @@ var dataStructureTyped = (() => {
|
|
|
7195
7278
|
};
|
|
7196
7279
|
display(beginRoot);
|
|
7197
7280
|
}
|
|
7198
|
-
_defaultOneParamCallback = (node) => node.key;
|
|
7199
7281
|
/**
|
|
7200
7282
|
* Swap the data of two nodes in the binary tree.
|
|
7201
7283
|
* @param {N} srcNode - The source node to swap.
|
|
@@ -7268,14 +7350,15 @@ var dataStructureTyped = (() => {
|
|
|
7268
7350
|
|
|
7269
7351
|
// src/data-structures/binary-tree/bst.ts
|
|
7270
7352
|
var BSTNode = class extends BinaryTreeNode {
|
|
7271
|
-
parent;
|
|
7272
7353
|
constructor(key, value) {
|
|
7273
7354
|
super(key, value);
|
|
7355
|
+
__publicField(this, "parent");
|
|
7356
|
+
__publicField(this, "_left");
|
|
7357
|
+
__publicField(this, "_right");
|
|
7274
7358
|
this.parent = void 0;
|
|
7275
7359
|
this._left = void 0;
|
|
7276
7360
|
this._right = void 0;
|
|
7277
7361
|
}
|
|
7278
|
-
_left;
|
|
7279
7362
|
/**
|
|
7280
7363
|
* Get the left child node.
|
|
7281
7364
|
*/
|
|
@@ -7292,7 +7375,6 @@ var dataStructureTyped = (() => {
|
|
|
7292
7375
|
}
|
|
7293
7376
|
this._left = v;
|
|
7294
7377
|
}
|
|
7295
|
-
_right;
|
|
7296
7378
|
/**
|
|
7297
7379
|
* Get the right child node.
|
|
7298
7380
|
*/
|
|
@@ -7318,6 +7400,8 @@ var dataStructureTyped = (() => {
|
|
|
7318
7400
|
*/
|
|
7319
7401
|
constructor(options) {
|
|
7320
7402
|
super(options);
|
|
7403
|
+
__publicField(this, "_root");
|
|
7404
|
+
__publicField(this, "_comparator", (a, b) => a - b);
|
|
7321
7405
|
this._root = void 0;
|
|
7322
7406
|
if (options !== void 0) {
|
|
7323
7407
|
const { comparator } = options;
|
|
@@ -7326,7 +7410,6 @@ var dataStructureTyped = (() => {
|
|
|
7326
7410
|
}
|
|
7327
7411
|
}
|
|
7328
7412
|
}
|
|
7329
|
-
_root;
|
|
7330
7413
|
/**
|
|
7331
7414
|
* Get the root node of the binary tree.
|
|
7332
7415
|
*/
|
|
@@ -7450,10 +7533,10 @@ var dataStructureTyped = (() => {
|
|
|
7450
7533
|
return arr.indexOf(void 0) === -1;
|
|
7451
7534
|
}
|
|
7452
7535
|
if (!isBalanceAdd || !hasNoUndefined(keysOrNodes)) {
|
|
7453
|
-
return super.addMany(keysOrNodes, data).map((n) => n
|
|
7536
|
+
return super.addMany(keysOrNodes, data).map((n) => n != null ? n : void 0);
|
|
7454
7537
|
}
|
|
7455
7538
|
const inserted = [];
|
|
7456
|
-
const combinedArr = keysOrNodes.map((value, index) => [value, data
|
|
7539
|
+
const combinedArr = keysOrNodes.map((value, index) => [value, data == null ? void 0 : data[index]]);
|
|
7457
7540
|
let sorted = [];
|
|
7458
7541
|
function _isNodeOrUndefinedTuple(arr) {
|
|
7459
7542
|
for (const [keyOrNode] of arr)
|
|
@@ -7481,10 +7564,10 @@ var dataStructureTyped = (() => {
|
|
|
7481
7564
|
if (arr.length === 0)
|
|
7482
7565
|
return;
|
|
7483
7566
|
const mid = Math.floor((arr.length - 1) / 2);
|
|
7484
|
-
const newNode = this.add(arr[mid], data2
|
|
7567
|
+
const newNode = this.add(arr[mid], data2 == null ? void 0 : data2[mid]);
|
|
7485
7568
|
inserted.push(newNode);
|
|
7486
|
-
_dfs(arr.slice(0, mid), data2
|
|
7487
|
-
_dfs(arr.slice(mid + 1), data2
|
|
7569
|
+
_dfs(arr.slice(0, mid), data2 == null ? void 0 : data2.slice(0, mid));
|
|
7570
|
+
_dfs(arr.slice(mid + 1), data2 == null ? void 0 : data2.slice(mid + 1));
|
|
7488
7571
|
};
|
|
7489
7572
|
const _iterate = () => {
|
|
7490
7573
|
const n = sorted.length;
|
|
@@ -7495,7 +7578,7 @@ var dataStructureTyped = (() => {
|
|
|
7495
7578
|
const [l, r] = popped;
|
|
7496
7579
|
if (l <= r) {
|
|
7497
7580
|
const m = l + Math.floor((r - l) / 2);
|
|
7498
|
-
const newNode = this.add(sortedKeysOrNodes[m], sortedData
|
|
7581
|
+
const newNode = this.add(sortedKeysOrNodes[m], sortedData == null ? void 0 : sortedData[m]);
|
|
7499
7582
|
inserted.push(newNode);
|
|
7500
7583
|
stack.push([m + 1, r]);
|
|
7501
7584
|
stack.push([l, m - 1]);
|
|
@@ -7530,12 +7613,13 @@ var dataStructureTyped = (() => {
|
|
|
7530
7613
|
* rightmost node otherwise. If no node is found, it returns 0.
|
|
7531
7614
|
*/
|
|
7532
7615
|
lastKey(beginRoot = this.root, iterationType = this.iterationType) {
|
|
7616
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7533
7617
|
if (this._compare(0, 1) === "lt" /* lt */)
|
|
7534
|
-
return this.getRightMost(beginRoot, iterationType)
|
|
7618
|
+
return (_b = (_a = this.getRightMost(beginRoot, iterationType)) == null ? void 0 : _a.key) != null ? _b : 0;
|
|
7535
7619
|
else if (this._compare(0, 1) === "gt" /* gt */)
|
|
7536
|
-
return this.getLeftMost(beginRoot, iterationType)
|
|
7620
|
+
return (_d = (_c = this.getLeftMost(beginRoot, iterationType)) == null ? void 0 : _c.key) != null ? _d : 0;
|
|
7537
7621
|
else
|
|
7538
|
-
return this.getRightMost(beginRoot, iterationType)
|
|
7622
|
+
return (_f = (_e = this.getRightMost(beginRoot, iterationType)) == null ? void 0 : _e.key) != null ? _f : 0;
|
|
7539
7623
|
}
|
|
7540
7624
|
/**
|
|
7541
7625
|
* Time Complexity: O(log n) - Average case for a balanced tree.
|
|
@@ -7813,6 +7897,7 @@ var dataStructureTyped = (() => {
|
|
|
7813
7897
|
* @returns a boolean value.
|
|
7814
7898
|
*/
|
|
7815
7899
|
isAVLBalanced(iterationType = this.iterationType) {
|
|
7900
|
+
var _a, _b;
|
|
7816
7901
|
if (!this.root)
|
|
7817
7902
|
return true;
|
|
7818
7903
|
let balanced = true;
|
|
@@ -7839,8 +7924,8 @@ var dataStructureTyped = (() => {
|
|
|
7839
7924
|
if (!node.right || last === node.right) {
|
|
7840
7925
|
node = stack.pop();
|
|
7841
7926
|
if (node) {
|
|
7842
|
-
const left = node.left ? depths.get(node.left)
|
|
7843
|
-
const right = node.right ? depths.get(node.right)
|
|
7927
|
+
const left = node.left ? (_a = depths.get(node.left)) != null ? _a : -1 : -1;
|
|
7928
|
+
const right = node.right ? (_b = depths.get(node.right)) != null ? _b : -1 : -1;
|
|
7844
7929
|
if (Math.abs(left - right) > 1)
|
|
7845
7930
|
return false;
|
|
7846
7931
|
depths.set(node, 1 + Math.max(left, right));
|
|
@@ -7854,7 +7939,6 @@ var dataStructureTyped = (() => {
|
|
|
7854
7939
|
}
|
|
7855
7940
|
return balanced;
|
|
7856
7941
|
}
|
|
7857
|
-
_comparator = (a, b) => a - b;
|
|
7858
7942
|
_setRoot(v) {
|
|
7859
7943
|
if (v) {
|
|
7860
7944
|
v.parent = void 0;
|
|
@@ -7882,8 +7966,6 @@ var dataStructureTyped = (() => {
|
|
|
7882
7966
|
|
|
7883
7967
|
// src/data-structures/binary-tree/binary-indexed-tree.ts
|
|
7884
7968
|
var BinaryIndexedTree = class {
|
|
7885
|
-
_freq;
|
|
7886
|
-
_max;
|
|
7887
7969
|
/**
|
|
7888
7970
|
* The constructor initializes the properties of an object, including default frequency, maximum
|
|
7889
7971
|
* value, a freqMap data structure, the most significant bit, and the count of negative frequencies.
|
|
@@ -7891,21 +7973,23 @@ var dataStructureTyped = (() => {
|
|
|
7891
7973
|
* value of 0.
|
|
7892
7974
|
*/
|
|
7893
7975
|
constructor({ frequency = 0, max }) {
|
|
7976
|
+
__publicField(this, "_freq");
|
|
7977
|
+
__publicField(this, "_max");
|
|
7978
|
+
__publicField(this, "_freqMap");
|
|
7979
|
+
__publicField(this, "_msb");
|
|
7980
|
+
__publicField(this, "_negativeCount");
|
|
7894
7981
|
this._freq = frequency;
|
|
7895
7982
|
this._max = max;
|
|
7896
7983
|
this._freqMap = { 0: 0 };
|
|
7897
7984
|
this._msb = getMSB(max);
|
|
7898
7985
|
this._negativeCount = frequency < 0 ? max : 0;
|
|
7899
7986
|
}
|
|
7900
|
-
_freqMap;
|
|
7901
7987
|
get freqMap() {
|
|
7902
7988
|
return this._freqMap;
|
|
7903
7989
|
}
|
|
7904
|
-
_msb;
|
|
7905
7990
|
get msb() {
|
|
7906
7991
|
return this._msb;
|
|
7907
7992
|
}
|
|
7908
|
-
_negativeCount;
|
|
7909
7993
|
get negativeCount() {
|
|
7910
7994
|
return this._negativeCount;
|
|
7911
7995
|
}
|
|
@@ -8144,13 +8228,13 @@ var dataStructureTyped = (() => {
|
|
|
8144
8228
|
|
|
8145
8229
|
// src/data-structures/binary-tree/segment-tree.ts
|
|
8146
8230
|
var SegmentTreeNode = class {
|
|
8147
|
-
start = 0;
|
|
8148
|
-
end = 0;
|
|
8149
|
-
value = null;
|
|
8150
|
-
sum = 0;
|
|
8151
|
-
left = null;
|
|
8152
|
-
right = null;
|
|
8153
8231
|
constructor(start, end, sum, value) {
|
|
8232
|
+
__publicField(this, "start", 0);
|
|
8233
|
+
__publicField(this, "end", 0);
|
|
8234
|
+
__publicField(this, "value", null);
|
|
8235
|
+
__publicField(this, "sum", 0);
|
|
8236
|
+
__publicField(this, "left", null);
|
|
8237
|
+
__publicField(this, "right", null);
|
|
8154
8238
|
this.start = start;
|
|
8155
8239
|
this.end = end;
|
|
8156
8240
|
this.sum = sum;
|
|
@@ -8168,6 +8252,10 @@ var dataStructureTyped = (() => {
|
|
|
8168
8252
|
* included in the range. If not provided, it defaults to the index of the last element in the "values" array.
|
|
8169
8253
|
*/
|
|
8170
8254
|
constructor(values, start, end) {
|
|
8255
|
+
__publicField(this, "_values", []);
|
|
8256
|
+
__publicField(this, "_start", 0);
|
|
8257
|
+
__publicField(this, "_end");
|
|
8258
|
+
__publicField(this, "_root");
|
|
8171
8259
|
start = start || 0;
|
|
8172
8260
|
end = end || values.length - 1;
|
|
8173
8261
|
this._values = values;
|
|
@@ -8180,19 +8268,15 @@ var dataStructureTyped = (() => {
|
|
|
8180
8268
|
this._values = [];
|
|
8181
8269
|
}
|
|
8182
8270
|
}
|
|
8183
|
-
_values = [];
|
|
8184
8271
|
get values() {
|
|
8185
8272
|
return this._values;
|
|
8186
8273
|
}
|
|
8187
|
-
_start = 0;
|
|
8188
8274
|
get start() {
|
|
8189
8275
|
return this._start;
|
|
8190
8276
|
}
|
|
8191
|
-
_end;
|
|
8192
8277
|
get end() {
|
|
8193
8278
|
return this._end;
|
|
8194
8279
|
}
|
|
8195
|
-
_root;
|
|
8196
8280
|
get root() {
|
|
8197
8281
|
return this._root;
|
|
8198
8282
|
}
|
|
@@ -8308,9 +8392,9 @@ var dataStructureTyped = (() => {
|
|
|
8308
8392
|
|
|
8309
8393
|
// src/data-structures/binary-tree/avl-tree.ts
|
|
8310
8394
|
var AVLTreeNode = class extends BSTNode {
|
|
8311
|
-
height;
|
|
8312
8395
|
constructor(key, value) {
|
|
8313
8396
|
super(key, value);
|
|
8397
|
+
__publicField(this, "height");
|
|
8314
8398
|
this.height = 0;
|
|
8315
8399
|
}
|
|
8316
8400
|
};
|
|
@@ -8526,7 +8610,7 @@ var dataStructureTyped = (() => {
|
|
|
8526
8610
|
if (B)
|
|
8527
8611
|
this._setRoot(B);
|
|
8528
8612
|
} else {
|
|
8529
|
-
if (parentOfA
|
|
8613
|
+
if ((parentOfA == null ? void 0 : parentOfA.left) === A) {
|
|
8530
8614
|
parentOfA.left = B;
|
|
8531
8615
|
} else {
|
|
8532
8616
|
if (parentOfA)
|
|
@@ -8693,14 +8777,13 @@ var dataStructureTyped = (() => {
|
|
|
8693
8777
|
|
|
8694
8778
|
// src/data-structures/binary-tree/rb-tree.ts
|
|
8695
8779
|
var RedBlackTreeNode = class extends BSTNode {
|
|
8696
|
-
color;
|
|
8697
8780
|
constructor(key, value, color = 0 /* BLACK */) {
|
|
8698
8781
|
super(key, value);
|
|
8782
|
+
__publicField(this, "color");
|
|
8699
8783
|
this.color = color;
|
|
8700
8784
|
}
|
|
8701
8785
|
};
|
|
8702
8786
|
var RedBlackTree = class extends BST {
|
|
8703
|
-
NIL = new RedBlackTreeNode(NaN);
|
|
8704
8787
|
/**
|
|
8705
8788
|
* The constructor function initializes a Red-Black Tree with an optional set of options.
|
|
8706
8789
|
* @param {RBTreeOptions} [options] - The `options` parameter is an optional object that can be
|
|
@@ -8708,13 +8791,14 @@ var dataStructureTyped = (() => {
|
|
|
8708
8791
|
*/
|
|
8709
8792
|
constructor(options) {
|
|
8710
8793
|
super(options);
|
|
8794
|
+
__publicField(this, "NIL", new RedBlackTreeNode(NaN));
|
|
8795
|
+
__publicField(this, "_root");
|
|
8796
|
+
__publicField(this, "_size", 0);
|
|
8711
8797
|
this._root = this.NIL;
|
|
8712
8798
|
}
|
|
8713
|
-
_root;
|
|
8714
8799
|
get root() {
|
|
8715
8800
|
return this._root;
|
|
8716
8801
|
}
|
|
8717
|
-
_size = 0;
|
|
8718
8802
|
get size() {
|
|
8719
8803
|
return this._size;
|
|
8720
8804
|
}
|
|
@@ -8755,7 +8839,7 @@ var dataStructureTyped = (() => {
|
|
|
8755
8839
|
if (x && node.key < x.key) {
|
|
8756
8840
|
x = x.left;
|
|
8757
8841
|
} else {
|
|
8758
|
-
x = x
|
|
8842
|
+
x = x == null ? void 0 : x.right;
|
|
8759
8843
|
}
|
|
8760
8844
|
}
|
|
8761
8845
|
node.parent = y;
|
|
@@ -8814,7 +8898,7 @@ var dataStructureTyped = (() => {
|
|
|
8814
8898
|
if (node && identifier && callback(node) <= identifier) {
|
|
8815
8899
|
node = node.right;
|
|
8816
8900
|
} else {
|
|
8817
|
-
node = node
|
|
8901
|
+
node = node == null ? void 0 : node.left;
|
|
8818
8902
|
}
|
|
8819
8903
|
}
|
|
8820
8904
|
if (z === this.NIL) {
|
|
@@ -8882,10 +8966,11 @@ var dataStructureTyped = (() => {
|
|
|
8882
8966
|
* @returns a value of type `N`, `null`, or `undefined`.
|
|
8883
8967
|
*/
|
|
8884
8968
|
getNode(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
8969
|
+
var _a;
|
|
8885
8970
|
if (identifier instanceof BinaryTreeNode)
|
|
8886
8971
|
callback = (node) => node;
|
|
8887
8972
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
8888
|
-
return this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]
|
|
8973
|
+
return (_a = this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]) != null ? _a : void 0;
|
|
8889
8974
|
}
|
|
8890
8975
|
/**
|
|
8891
8976
|
* Time Complexity: O(log n) on average (where n is the number of nodes in the tree)
|
|
@@ -8900,8 +8985,9 @@ var dataStructureTyped = (() => {
|
|
|
8900
8985
|
* @returns the successor of the given RedBlackTreeNode.
|
|
8901
8986
|
*/
|
|
8902
8987
|
getSuccessor(x) {
|
|
8988
|
+
var _a;
|
|
8903
8989
|
if (x.right !== this.NIL) {
|
|
8904
|
-
return this.getLeftMost(x.right)
|
|
8990
|
+
return (_a = this.getLeftMost(x.right)) != null ? _a : void 0;
|
|
8905
8991
|
}
|
|
8906
8992
|
let y = x.parent;
|
|
8907
8993
|
while (y !== this.NIL && y !== void 0 && x === y.right) {
|
|
@@ -9159,7 +9245,6 @@ var dataStructureTyped = (() => {
|
|
|
9159
9245
|
|
|
9160
9246
|
// src/data-structures/binary-tree/tree-multimap.ts
|
|
9161
9247
|
var TreeMultimapNode = class extends AVLTreeNode {
|
|
9162
|
-
count;
|
|
9163
9248
|
/**
|
|
9164
9249
|
* The constructor function initializes a BinaryTreeNode object with a key, value, and count.
|
|
9165
9250
|
* @param {BTNKey} key - The `key` parameter is of type `BTNKey` and represents the unique identifier
|
|
@@ -9172,6 +9257,7 @@ var dataStructureTyped = (() => {
|
|
|
9172
9257
|
*/
|
|
9173
9258
|
constructor(key, value, count = 1) {
|
|
9174
9259
|
super(key, value);
|
|
9260
|
+
__publicField(this, "count");
|
|
9175
9261
|
this.count = count;
|
|
9176
9262
|
}
|
|
9177
9263
|
};
|
|
@@ -9184,8 +9270,8 @@ var dataStructureTyped = (() => {
|
|
|
9184
9270
|
*/
|
|
9185
9271
|
constructor(options) {
|
|
9186
9272
|
super(options);
|
|
9273
|
+
__publicField(this, "_count", 0);
|
|
9187
9274
|
}
|
|
9188
|
-
_count = 0;
|
|
9189
9275
|
get count() {
|
|
9190
9276
|
return this._count;
|
|
9191
9277
|
}
|
|
@@ -9311,7 +9397,7 @@ var dataStructureTyped = (() => {
|
|
|
9311
9397
|
inserted.push(this.add(NaN, void 0, 0));
|
|
9312
9398
|
continue;
|
|
9313
9399
|
}
|
|
9314
|
-
inserted.push(this.add(keyOrNode, data
|
|
9400
|
+
inserted.push(this.add(keyOrNode, data == null ? void 0 : data[i], 1));
|
|
9315
9401
|
}
|
|
9316
9402
|
return inserted;
|
|
9317
9403
|
}
|
|
@@ -9389,13 +9475,14 @@ var dataStructureTyped = (() => {
|
|
|
9389
9475
|
* @returns an array of `BiTreeDeleteResult<N>`.
|
|
9390
9476
|
*/
|
|
9391
9477
|
delete(identifier, callback = this._defaultOneParamCallback, ignoreCount = false) {
|
|
9478
|
+
var _a;
|
|
9392
9479
|
const deletedResult = [];
|
|
9393
9480
|
if (!this.root)
|
|
9394
9481
|
return deletedResult;
|
|
9395
|
-
const curr = this.getNode(identifier, callback)
|
|
9482
|
+
const curr = (_a = this.getNode(identifier, callback)) != null ? _a : void 0;
|
|
9396
9483
|
if (!curr)
|
|
9397
9484
|
return deletedResult;
|
|
9398
|
-
const parent = curr
|
|
9485
|
+
const parent = (curr == null ? void 0 : curr.parent) ? curr.parent : void 0;
|
|
9399
9486
|
let needBalanced = void 0, orgCurrent = curr;
|
|
9400
9487
|
if (curr.count > 1 && !ignoreCount) {
|
|
9401
9488
|
curr.count--;
|
|
@@ -9523,10 +9610,10 @@ var dataStructureTyped = (() => {
|
|
|
9523
9610
|
|
|
9524
9611
|
// src/data-structures/tree/tree.ts
|
|
9525
9612
|
var TreeNode = class _TreeNode {
|
|
9526
|
-
key;
|
|
9527
|
-
value;
|
|
9528
|
-
children;
|
|
9529
9613
|
constructor(key, value, children) {
|
|
9614
|
+
__publicField(this, "key");
|
|
9615
|
+
__publicField(this, "value");
|
|
9616
|
+
__publicField(this, "children");
|
|
9530
9617
|
this.key = key;
|
|
9531
9618
|
this.value = value || void 0;
|
|
9532
9619
|
this.children = children || [];
|
|
@@ -9563,13 +9650,13 @@ var dataStructureTyped = (() => {
|
|
|
9563
9650
|
|
|
9564
9651
|
// src/data-structures/matrix/matrix.ts
|
|
9565
9652
|
var MatrixNTI2D = class {
|
|
9566
|
-
_matrix;
|
|
9567
9653
|
/**
|
|
9568
9654
|
* The constructor creates a matrix with the specified number of rows and columns, and initializes all elements to a
|
|
9569
9655
|
* given initial value or 0 if not provided.
|
|
9570
9656
|
* @param options - An object containing the following properties:
|
|
9571
9657
|
*/
|
|
9572
9658
|
constructor(options) {
|
|
9659
|
+
__publicField(this, "_matrix");
|
|
9573
9660
|
const { row, col, initialVal } = options;
|
|
9574
9661
|
this._matrix = new Array(row).fill(void 0).map(() => new Array(col).fill(initialVal || 0));
|
|
9575
9662
|
}
|
|
@@ -9861,7 +9948,6 @@ var dataStructureTyped = (() => {
|
|
|
9861
9948
|
|
|
9862
9949
|
// src/data-structures/matrix/matrix2d.ts
|
|
9863
9950
|
var Matrix2D = class _Matrix2D {
|
|
9864
|
-
_matrix;
|
|
9865
9951
|
/**
|
|
9866
9952
|
* The constructor function initializes a Matrix2D object with either a default identity matrix, or a provided matrix
|
|
9867
9953
|
* or Vector2D object.
|
|
@@ -9869,6 +9955,7 @@ var dataStructureTyped = (() => {
|
|
|
9869
9955
|
* an instance of the `Vector2D` class.
|
|
9870
9956
|
*/
|
|
9871
9957
|
constructor(value) {
|
|
9958
|
+
__publicField(this, "_matrix");
|
|
9872
9959
|
if (typeof value === "undefined") {
|
|
9873
9960
|
this._matrix = _Matrix2D.identity;
|
|
9874
9961
|
} else if (value instanceof Vector2D) {
|
|
@@ -10049,8 +10136,6 @@ var dataStructureTyped = (() => {
|
|
|
10049
10136
|
|
|
10050
10137
|
// src/data-structures/matrix/navigator.ts
|
|
10051
10138
|
var Character = class _Character {
|
|
10052
|
-
direction;
|
|
10053
|
-
turn;
|
|
10054
10139
|
/**
|
|
10055
10140
|
* The constructor function takes in a direction and turning object and sets the direction and turn properties of the
|
|
10056
10141
|
* Character class.
|
|
@@ -10060,22 +10145,24 @@ var dataStructureTyped = (() => {
|
|
|
10060
10145
|
* turning direction. It is used to determine the new direction when the character turns.
|
|
10061
10146
|
*/
|
|
10062
10147
|
constructor(direction, turning) {
|
|
10148
|
+
__publicField(this, "direction");
|
|
10149
|
+
__publicField(this, "turn");
|
|
10063
10150
|
this.direction = direction;
|
|
10064
10151
|
this.turn = () => new _Character(turning[direction], turning);
|
|
10065
10152
|
}
|
|
10066
10153
|
};
|
|
10067
10154
|
var Navigator = class {
|
|
10068
|
-
onMove;
|
|
10069
|
-
_matrix;
|
|
10070
|
-
_cur;
|
|
10071
|
-
_character;
|
|
10072
|
-
_VISITED;
|
|
10073
10155
|
/**
|
|
10074
10156
|
* The constructor initializes the Navigator object with the given parameters and sets the current position as visited
|
|
10075
10157
|
* in the matrix.
|
|
10076
10158
|
* @param - - `matrix`: a 2D array representing the grid or map
|
|
10077
10159
|
*/
|
|
10078
10160
|
constructor({ matrix, turning, onMove, init: { cur, charDir, VISITED } }) {
|
|
10161
|
+
__publicField(this, "onMove");
|
|
10162
|
+
__publicField(this, "_matrix");
|
|
10163
|
+
__publicField(this, "_cur");
|
|
10164
|
+
__publicField(this, "_character");
|
|
10165
|
+
__publicField(this, "_VISITED");
|
|
10079
10166
|
this._matrix = matrix;
|
|
10080
10167
|
this._cur = cur;
|
|
10081
10168
|
this._character = new Character(charDir, turning);
|
|
@@ -10158,10 +10245,10 @@ var dataStructureTyped = (() => {
|
|
|
10158
10245
|
|
|
10159
10246
|
// src/data-structures/trie/trie.ts
|
|
10160
10247
|
var TrieNode = class {
|
|
10161
|
-
key;
|
|
10162
|
-
children;
|
|
10163
|
-
isEnd;
|
|
10164
10248
|
constructor(key) {
|
|
10249
|
+
__publicField(this, "key");
|
|
10250
|
+
__publicField(this, "children");
|
|
10251
|
+
__publicField(this, "isEnd");
|
|
10165
10252
|
this.key = key;
|
|
10166
10253
|
this.isEnd = false;
|
|
10167
10254
|
this.children = /* @__PURE__ */ new Map();
|
|
@@ -10169,6 +10256,8 @@ var dataStructureTyped = (() => {
|
|
|
10169
10256
|
};
|
|
10170
10257
|
var Trie = class {
|
|
10171
10258
|
constructor(words, caseSensitive = true) {
|
|
10259
|
+
__publicField(this, "_caseSensitive");
|
|
10260
|
+
__publicField(this, "_root");
|
|
10172
10261
|
this._root = new TrieNode("");
|
|
10173
10262
|
this._caseSensitive = caseSensitive;
|
|
10174
10263
|
if (words) {
|
|
@@ -10177,11 +10266,9 @@ var dataStructureTyped = (() => {
|
|
|
10177
10266
|
}
|
|
10178
10267
|
}
|
|
10179
10268
|
}
|
|
10180
|
-
_caseSensitive;
|
|
10181
10269
|
get caseSensitive() {
|
|
10182
10270
|
return this._caseSensitive;
|
|
10183
10271
|
}
|
|
10184
|
-
_root;
|
|
10185
10272
|
get root() {
|
|
10186
10273
|
return this._root;
|
|
10187
10274
|
}
|