data-structure-typed 1.43.3 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- 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.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.js +6 -0
- package/dist/mjs/types/data-structures/graph/index.js +3 -0
- package/dist/mjs/types/data-structures/hash/hash-table.js +1 -0
- package/dist/mjs/types/data-structures/hash/index.js +1 -0
- package/dist/mjs/types/data-structures/hash/tree-map.d.ts +1 -0
- package/dist/mjs/types/data-structures/hash/tree-map.js +1 -0
- package/dist/mjs/types/data-structures/hash/tree-set.d.ts +1 -0
- package/dist/mjs/types/data-structures/hash/tree-set.js +1 -0
- package/dist/mjs/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/heap.js +1 -0
- package/dist/mjs/types/data-structures/heap/index.js +1 -0
- package/dist/mjs/types/data-structures/heap/max-heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/max-heap.js +1 -0
- package/dist/mjs/types/data-structures/heap/min-heap.d.ts +1 -0
- package/dist/mjs/types/data-structures/heap/min-heap.js +1 -0
- package/dist/mjs/types/data-structures/index.js +11 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +1 -0
- package/dist/mjs/types/data-structures/linked-list/index.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +1 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +1 -0
- package/dist/mjs/types/data-structures/matrix/index.js +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.js +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.js +1 -0
- package/dist/mjs/types/data-structures/matrix/navigator.js +1 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.js +1 -0
- package/dist/mjs/types/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/mjs/types/data-structures/priority-queue/index.js +3 -0
- package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +1 -0
- package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +1 -0
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +1 -0
- package/dist/mjs/types/data-structures/queue/deque.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/deque.js +1 -0
- package/dist/mjs/types/data-structures/queue/index.d.ts +2 -0
- package/dist/mjs/types/data-structures/queue/index.js +2 -0
- package/dist/mjs/types/data-structures/queue/queue.d.ts +1 -0
- package/dist/mjs/types/data-structures/queue/queue.js +1 -0
- package/dist/mjs/types/data-structures/stack/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/index.js +1 -0
- package/dist/mjs/types/data-structures/stack/stack.d.ts +1 -0
- package/dist/mjs/types/data-structures/stack/stack.js +1 -0
- package/dist/mjs/types/data-structures/tree/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/index.js +1 -0
- package/dist/mjs/types/data-structures/tree/tree.d.ts +1 -0
- package/dist/mjs/types/data-structures/tree/tree.js +1 -0
- package/dist/mjs/types/data-structures/trie/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/index.js +1 -0
- package/dist/mjs/types/data-structures/trie/trie.d.ts +1 -0
- package/dist/mjs/types/data-structures/trie/trie.js +1 -0
- package/dist/mjs/types/helpers.js +6 -0
- package/dist/mjs/types/index.js +3 -0
- package/dist/mjs/types/utils/index.js +2 -0
- package/dist/mjs/types/utils/utils.js +1 -0
- package/dist/mjs/types/utils/validate-type.js +1 -0
- package/dist/mjs/utils/index.js +1 -0
- package/dist/mjs/utils/utils.js +54 -0
- package/dist/umd/data-structure-typed.js +288 -192
- package/dist/umd/data-structure-typed.min.js +5 -10
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +14 -15
- package/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.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/hash-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/hash-table.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/tree-map.js.map +0 -1
- package/dist/cjs/src/types/data-structures/hash/tree-set.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/heap/min-heap.js.map +0 -1
- package/dist/cjs/src/types/data-structures/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/matrix.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/navigator.js.map +0 -1
- package/dist/cjs/src/types/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/deque.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/queue/queue.js.map +0 -1
- package/dist/cjs/src/types/data-structures/stack/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/stack/stack.js.map +0 -1
- package/dist/cjs/src/types/data-structures/tree/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/tree/tree.js.map +0 -1
- package/dist/cjs/src/types/data-structures/trie/index.js.map +0 -1
- package/dist/cjs/src/types/data-structures/trie/trie.js.map +0 -1
- package/dist/cjs/src/types/helpers.js.map +0 -1
- package/dist/cjs/src/types/index.js.map +0 -1
- package/dist/cjs/src/types/utils/index.js.map +0 -1
- package/dist/cjs/src/types/utils/validate-type.js.map +0 -1
- package/dist/cjs/src/utils/index.js.map +0 -1
- package/dist/cjs/src/utils/utils.js.map +0 -1
- package/dist/mjs/src/data-structures/binary-tree/index.js +0 -23
- package/dist/mjs/src/data-structures/graph/index.js +0 -20
- package/dist/mjs/src/data-structures/hash/index.js +0 -22
- package/dist/mjs/src/data-structures/hash/tree-map.js +0 -6
- package/dist/mjs/src/data-structures/hash/tree-set.js +0 -6
- package/dist/mjs/src/data-structures/heap/index.js +0 -19
- package/dist/mjs/src/data-structures/index.js +0 -27
- package/dist/mjs/src/data-structures/linked-list/index.js +0 -19
- package/dist/mjs/src/data-structures/matrix/index.js +0 -20
- package/dist/mjs/src/data-structures/priority-queue/index.js +0 -19
- package/dist/mjs/src/data-structures/priority-queue/priority-queue.js +0 -17
- package/dist/mjs/src/data-structures/queue/index.js +0 -18
- package/dist/mjs/src/data-structures/stack/index.js +0 -17
- package/dist/mjs/src/data-structures/tree/index.js +0 -17
- package/dist/mjs/src/data-structures/trie/index.js +0 -17
- package/dist/mjs/src/index.js +0 -20
- package/dist/mjs/src/interfaces/binary-tree.js +0 -2
- package/dist/mjs/src/interfaces/doubly-linked-list.js +0 -2
- package/dist/mjs/src/interfaces/graph.js +0 -2
- package/dist/mjs/src/interfaces/heap.js +0 -2
- package/dist/mjs/src/interfaces/index.js +0 -24
- package/dist/mjs/src/interfaces/navigator.js +0 -2
- package/dist/mjs/src/interfaces/priority-queue.js +0 -2
- package/dist/mjs/src/interfaces/segment-tree.js +0 -2
- package/dist/mjs/src/interfaces/singly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/avl-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/binary-indexed-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/bst.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/index.js +0 -22
- package/dist/mjs/src/types/data-structures/binary-tree/rb-tree.js +0 -8
- package/dist/mjs/src/types/data-structures/binary-tree/segment-tree.js +0 -2
- package/dist/mjs/src/types/data-structures/binary-tree/tree-multimap.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/abstract-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/directed-graph.js +0 -9
- package/dist/mjs/src/types/data-structures/graph/index.js +0 -19
- package/dist/mjs/src/types/data-structures/graph/map-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/graph/undirected-graph.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/coordinate-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/coordinate-set.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/hash-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/hash-table.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/index.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/tree-map.js +0 -2
- package/dist/mjs/src/types/data-structures/hash/tree-set.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/heap.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/index.js +0 -17
- package/dist/mjs/src/types/data-structures/heap/max-heap.js +0 -2
- package/dist/mjs/src/types/data-structures/heap/min-heap.js +0 -2
- package/dist/mjs/src/types/data-structures/index.js +0 -27
- package/dist/mjs/src/types/data-structures/linked-list/doubly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/linked-list/index.js +0 -18
- package/dist/mjs/src/types/data-structures/linked-list/singly-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/linked-list/skip-linked-list.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/index.js +0 -17
- package/dist/mjs/src/types/data-structures/matrix/matrix.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/matrix2d.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/navigator.js +0 -2
- package/dist/mjs/src/types/data-structures/matrix/vector2d.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/index.js +0 -19
- package/dist/mjs/src/types/data-structures/priority-queue/max-priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/min-priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/priority-queue/priority-queue.js +0 -2
- package/dist/mjs/src/types/data-structures/queue/deque.js +0 -2
- package/dist/mjs/src/types/data-structures/queue/index.js +0 -18
- package/dist/mjs/src/types/data-structures/queue/queue.js +0 -2
- package/dist/mjs/src/types/data-structures/stack/index.js +0 -17
- package/dist/mjs/src/types/data-structures/stack/stack.js +0 -2
- package/dist/mjs/src/types/data-structures/tree/index.js +0 -17
- package/dist/mjs/src/types/data-structures/tree/tree.js +0 -2
- package/dist/mjs/src/types/data-structures/trie/index.js +0 -17
- package/dist/mjs/src/types/data-structures/trie/trie.js +0 -2
- package/dist/mjs/src/types/helpers.js +0 -9
- package/dist/mjs/src/types/index.js +0 -19
- package/dist/mjs/src/types/utils/index.js +0 -18
- package/dist/mjs/src/types/utils/utils.js +0 -2
- package/dist/mjs/src/types/utils/validate-type.js +0 -2
- package/dist/mjs/src/utils/index.js +0 -17
- package/dist/mjs/src/utils/utils.js +0 -64
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/avl-tree.js +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.js +0 -0
- /package/dist/cjs/{src/data-structures → data-structures}/binary-tree/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/directed-graph.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/directed-graph.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/map-graph.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/graph/undirected-graph.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-map.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/coordinate-set.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/hash-map.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/hash-table.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/tree-map.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/hash/tree-set.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/heap.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/heap.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/max-heap.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/heap/min-heap.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/doubly-linked-list.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/singly-linked-list.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/linked-list/skip-linked-list.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/matrix.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/matrix2d.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/navigator.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/matrix/vector2d.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/max-priority-queue.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/min-priority-queue.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/priority-queue/priority-queue.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/deque.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/deque.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/queue.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/queue/queue.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/stack/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/stack/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/stack/stack.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/stack/stack.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/tree/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/tree/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/tree/tree.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/tree/tree.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/trie/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/trie/index.js +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/trie/trie.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/data-structures/trie/trie.js +0 -0
- /package/dist/cjs/{src/types → types}/helpers.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/helpers.js +0 -0
- /package/dist/cjs/{src/types → types}/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/index.js +0 -0
- /package/dist/cjs/{src/types → types}/utils/index.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/utils/index.js +0 -0
- /package/dist/cjs/{src/types → types}/utils/utils.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/utils/utils.js +0 -0
- /package/dist/cjs/{src/types → types}/utils/validate-type.d.ts +0 -0
- /package/dist/cjs/{src/types → types}/utils/validate-type.js +0 -0
- /package/dist/cjs/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/cjs/{src/utils → utils}/index.js +0 -0
- /package/dist/cjs/{src/utils → utils}/utils.d.ts +0 -0
- /package/dist/cjs/{src/utils → utils}/utils.js +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/mjs/{src/data-structures → data-structures}/binary-tree/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 → types}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/matrix.d.ts → types/data-structures/graph/map-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/matrix2d.d.ts → types/data-structures/graph/undirected-graph.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/matrix/vector2d.d.ts → types/data-structures/graph/undirected-graph.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/max-priority-queue.d.ts → types/data-structures/hash/coordinate-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/priority-queue/min-priority-queue.d.ts → types/data-structures/hash/coordinate-map.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/deque.d.ts → types/data-structures/hash/coordinate-set.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/queue/queue.d.ts → types/data-structures/hash/coordinate-set.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/stack/stack.d.ts → types/data-structures/hash/hash-map.d.ts} +0 -0
- /package/dist/mjs/{src/types/data-structures/tree/tree.d.ts → types/data-structures/hash/hash-map.js} +0 -0
- /package/dist/mjs/{src/types/data-structures/trie/trie.d.ts → types/data-structures/hash/hash-table.d.ts} +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/hash/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/heap/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/helpers.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/index.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/utils.d.ts +0 -0
- /package/dist/mjs/{src/types → types}/utils/validate-type.d.ts +0 -0
- /package/dist/mjs/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/mjs/{src/utils → utils}/utils.d.ts +0 -0
|
@@ -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 = {};
|
|
@@ -98,37 +165,35 @@ var dataStructureTyped = (() => {
|
|
|
98
165
|
|
|
99
166
|
// src/data-structures/hash/hash-table.ts
|
|
100
167
|
var HashTableNode = class {
|
|
101
|
-
key;
|
|
102
|
-
value;
|
|
103
|
-
next;
|
|
104
168
|
constructor(key, value) {
|
|
169
|
+
__publicField(this, "key");
|
|
170
|
+
__publicField(this, "value");
|
|
171
|
+
__publicField(this, "next");
|
|
105
172
|
this.key = key;
|
|
106
173
|
this.value = value;
|
|
107
174
|
this.next = null;
|
|
108
175
|
}
|
|
109
176
|
};
|
|
110
|
-
var
|
|
111
|
-
static DEFAULT_CAPACITY = 16;
|
|
112
|
-
static LOAD_FACTOR = 0.75;
|
|
177
|
+
var _HashTable = class _HashTable {
|
|
113
178
|
constructor(capacity = _HashTable.DEFAULT_CAPACITY, hashFn) {
|
|
179
|
+
__publicField(this, "_capacity");
|
|
180
|
+
__publicField(this, "_size");
|
|
181
|
+
__publicField(this, "_buckets");
|
|
182
|
+
__publicField(this, "_hashFn");
|
|
114
183
|
this._hashFn = hashFn || this._defaultHashFn;
|
|
115
184
|
this._capacity = Math.max(capacity, _HashTable.DEFAULT_CAPACITY);
|
|
116
185
|
this._size = 0;
|
|
117
186
|
this._buckets = new Array(this._capacity).fill(null);
|
|
118
187
|
}
|
|
119
|
-
_capacity;
|
|
120
188
|
get capacity() {
|
|
121
189
|
return this._capacity;
|
|
122
190
|
}
|
|
123
|
-
_size;
|
|
124
191
|
get size() {
|
|
125
192
|
return this._size;
|
|
126
193
|
}
|
|
127
|
-
_buckets;
|
|
128
194
|
get buckets() {
|
|
129
195
|
return this._buckets;
|
|
130
196
|
}
|
|
131
|
-
_hashFn;
|
|
132
197
|
get hashFn() {
|
|
133
198
|
return this._hashFn;
|
|
134
199
|
}
|
|
@@ -316,15 +381,18 @@ var dataStructureTyped = (() => {
|
|
|
316
381
|
this._capacity = newCapacity;
|
|
317
382
|
}
|
|
318
383
|
};
|
|
384
|
+
__publicField(_HashTable, "DEFAULT_CAPACITY", 16);
|
|
385
|
+
__publicField(_HashTable, "LOAD_FACTOR", 0.75);
|
|
386
|
+
var HashTable = _HashTable;
|
|
319
387
|
|
|
320
388
|
// src/data-structures/hash/coordinate-map.ts
|
|
321
389
|
var CoordinateMap = class extends Map {
|
|
322
390
|
constructor(joint) {
|
|
323
391
|
super();
|
|
392
|
+
__publicField(this, "_joint", "_");
|
|
324
393
|
if (joint !== void 0)
|
|
325
394
|
this._joint = joint;
|
|
326
395
|
}
|
|
327
|
-
_joint = "_";
|
|
328
396
|
get joint() {
|
|
329
397
|
return this._joint;
|
|
330
398
|
}
|
|
@@ -374,10 +442,10 @@ var dataStructureTyped = (() => {
|
|
|
374
442
|
var CoordinateSet = class extends Set {
|
|
375
443
|
constructor(joint) {
|
|
376
444
|
super();
|
|
445
|
+
__publicField(this, "_joint", "_");
|
|
377
446
|
if (joint !== void 0)
|
|
378
447
|
this._joint = joint;
|
|
379
448
|
}
|
|
380
|
-
_joint = "_";
|
|
381
449
|
get joint() {
|
|
382
450
|
return this._joint;
|
|
383
451
|
}
|
|
@@ -436,6 +504,12 @@ var dataStructureTyped = (() => {
|
|
|
436
504
|
* default hash function converts the key to a string, calculates the sum of the
|
|
437
505
|
*/
|
|
438
506
|
constructor(initialCapacity = 16, loadFactor = 0.75, hashFn) {
|
|
507
|
+
__publicField(this, "_initialCapacity");
|
|
508
|
+
__publicField(this, "_loadFactor");
|
|
509
|
+
__publicField(this, "_capacityMultiplier");
|
|
510
|
+
__publicField(this, "_size");
|
|
511
|
+
__publicField(this, "_table");
|
|
512
|
+
__publicField(this, "_hashFn");
|
|
439
513
|
this._initialCapacity = initialCapacity;
|
|
440
514
|
this._loadFactor = loadFactor;
|
|
441
515
|
this._capacityMultiplier = 2;
|
|
@@ -450,27 +524,21 @@ var dataStructureTyped = (() => {
|
|
|
450
524
|
return hash % this.table.length;
|
|
451
525
|
});
|
|
452
526
|
}
|
|
453
|
-
_initialCapacity;
|
|
454
527
|
get initialCapacity() {
|
|
455
528
|
return this._initialCapacity;
|
|
456
529
|
}
|
|
457
|
-
_loadFactor;
|
|
458
530
|
get loadFactor() {
|
|
459
531
|
return this._loadFactor;
|
|
460
532
|
}
|
|
461
|
-
_capacityMultiplier;
|
|
462
533
|
get capacityMultiplier() {
|
|
463
534
|
return this._capacityMultiplier;
|
|
464
535
|
}
|
|
465
|
-
_size;
|
|
466
536
|
get size() {
|
|
467
537
|
return this._size;
|
|
468
538
|
}
|
|
469
|
-
_table;
|
|
470
539
|
get table() {
|
|
471
540
|
return this._table;
|
|
472
541
|
}
|
|
473
|
-
_hashFn;
|
|
474
542
|
get hashFn() {
|
|
475
543
|
return this._hashFn;
|
|
476
544
|
}
|
|
@@ -568,14 +636,14 @@ var dataStructureTyped = (() => {
|
|
|
568
636
|
|
|
569
637
|
// src/data-structures/linked-list/singly-linked-list.ts
|
|
570
638
|
var SinglyLinkedListNode = class {
|
|
571
|
-
value;
|
|
572
|
-
next;
|
|
573
639
|
/**
|
|
574
640
|
* The constructor function initializes an instance of a class with a given value and sets the next property to null.
|
|
575
641
|
* @param {E} value - The "value" parameter is of type E, which means it can be any data type. It represents the value that
|
|
576
642
|
* will be stored in the node of a linked list.
|
|
577
643
|
*/
|
|
578
644
|
constructor(value) {
|
|
645
|
+
__publicField(this, "value");
|
|
646
|
+
__publicField(this, "next");
|
|
579
647
|
this.value = value;
|
|
580
648
|
this.next = null;
|
|
581
649
|
}
|
|
@@ -585,19 +653,19 @@ var dataStructureTyped = (() => {
|
|
|
585
653
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
586
654
|
*/
|
|
587
655
|
constructor() {
|
|
656
|
+
__publicField(this, "_head");
|
|
657
|
+
__publicField(this, "_tail");
|
|
658
|
+
__publicField(this, "_length");
|
|
588
659
|
this._head = null;
|
|
589
660
|
this._tail = null;
|
|
590
661
|
this._length = 0;
|
|
591
662
|
}
|
|
592
|
-
_head;
|
|
593
663
|
get head() {
|
|
594
664
|
return this._head;
|
|
595
665
|
}
|
|
596
|
-
_tail;
|
|
597
666
|
get tail() {
|
|
598
667
|
return this._tail;
|
|
599
668
|
}
|
|
600
|
-
_length;
|
|
601
669
|
get length() {
|
|
602
670
|
return this._length;
|
|
603
671
|
}
|
|
@@ -1272,15 +1340,15 @@ var dataStructureTyped = (() => {
|
|
|
1272
1340
|
|
|
1273
1341
|
// src/data-structures/linked-list/doubly-linked-list.ts
|
|
1274
1342
|
var DoublyLinkedListNode = class {
|
|
1275
|
-
value;
|
|
1276
|
-
next;
|
|
1277
|
-
prev;
|
|
1278
1343
|
/**
|
|
1279
1344
|
* The constructor function initializes the value, next, and previous properties of an object.
|
|
1280
1345
|
* @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
1346
|
* is defined as a generic type "E".
|
|
1282
1347
|
*/
|
|
1283
1348
|
constructor(value) {
|
|
1349
|
+
__publicField(this, "value");
|
|
1350
|
+
__publicField(this, "next");
|
|
1351
|
+
__publicField(this, "prev");
|
|
1284
1352
|
this.value = value;
|
|
1285
1353
|
this.next = null;
|
|
1286
1354
|
this.prev = null;
|
|
@@ -1291,19 +1359,19 @@ var dataStructureTyped = (() => {
|
|
|
1291
1359
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
1292
1360
|
*/
|
|
1293
1361
|
constructor() {
|
|
1362
|
+
__publicField(this, "_head");
|
|
1363
|
+
__publicField(this, "_tail");
|
|
1364
|
+
__publicField(this, "_length");
|
|
1294
1365
|
this._head = null;
|
|
1295
1366
|
this._tail = null;
|
|
1296
1367
|
this._length = 0;
|
|
1297
1368
|
}
|
|
1298
|
-
_head;
|
|
1299
1369
|
get head() {
|
|
1300
1370
|
return this._head;
|
|
1301
1371
|
}
|
|
1302
|
-
_tail;
|
|
1303
1372
|
get tail() {
|
|
1304
1373
|
return this._tail;
|
|
1305
1374
|
}
|
|
1306
|
-
_length;
|
|
1307
1375
|
get length() {
|
|
1308
1376
|
return this._length;
|
|
1309
1377
|
}
|
|
@@ -1500,7 +1568,8 @@ var dataStructureTyped = (() => {
|
|
|
1500
1568
|
* @returns The method `getFirst()` returns the first node of the doubly linked list, or `null` if the list is empty.
|
|
1501
1569
|
*/
|
|
1502
1570
|
getFirst() {
|
|
1503
|
-
|
|
1571
|
+
var _a;
|
|
1572
|
+
return (_a = this.head) == null ? void 0 : _a.value;
|
|
1504
1573
|
}
|
|
1505
1574
|
/**
|
|
1506
1575
|
* Time Complexity: O(n), where n is the number of elements in the linked list.
|
|
@@ -1514,7 +1583,8 @@ var dataStructureTyped = (() => {
|
|
|
1514
1583
|
* @returns The method `getLast()` returns the last node of the doubly linked list, or `null` if the list is empty.
|
|
1515
1584
|
*/
|
|
1516
1585
|
getLast() {
|
|
1517
|
-
|
|
1586
|
+
var _a;
|
|
1587
|
+
return (_a = this.tail) == null ? void 0 : _a.value;
|
|
1518
1588
|
}
|
|
1519
1589
|
/**
|
|
1520
1590
|
* Time Complexity: O(n), where n is the number of elements in the linked list.
|
|
@@ -2029,10 +2099,10 @@ var dataStructureTyped = (() => {
|
|
|
2029
2099
|
|
|
2030
2100
|
// src/data-structures/linked-list/skip-linked-list.ts
|
|
2031
2101
|
var SkipListNode = class {
|
|
2032
|
-
key;
|
|
2033
|
-
value;
|
|
2034
|
-
forward;
|
|
2035
2102
|
constructor(key, value, level) {
|
|
2103
|
+
__publicField(this, "key");
|
|
2104
|
+
__publicField(this, "value");
|
|
2105
|
+
__publicField(this, "forward");
|
|
2036
2106
|
this.key = key;
|
|
2037
2107
|
this.value = value;
|
|
2038
2108
|
this.forward = new Array(level);
|
|
@@ -2047,24 +2117,24 @@ var dataStructureTyped = (() => {
|
|
|
2047
2117
|
* level in the skip list. It is used to determine the height of each node in the skip list.
|
|
2048
2118
|
*/
|
|
2049
2119
|
constructor(maxLevel = 16, probability = 0.5) {
|
|
2120
|
+
__publicField(this, "_head");
|
|
2121
|
+
__publicField(this, "_level");
|
|
2122
|
+
__publicField(this, "_maxLevel");
|
|
2123
|
+
__publicField(this, "_probability");
|
|
2050
2124
|
this._head = new SkipListNode(null, null, maxLevel);
|
|
2051
2125
|
this._level = 0;
|
|
2052
2126
|
this._maxLevel = maxLevel;
|
|
2053
2127
|
this._probability = probability;
|
|
2054
2128
|
}
|
|
2055
|
-
_head;
|
|
2056
2129
|
get head() {
|
|
2057
2130
|
return this._head;
|
|
2058
2131
|
}
|
|
2059
|
-
_level;
|
|
2060
2132
|
get level() {
|
|
2061
2133
|
return this._level;
|
|
2062
2134
|
}
|
|
2063
|
-
_maxLevel;
|
|
2064
2135
|
get maxLevel() {
|
|
2065
2136
|
return this._maxLevel;
|
|
2066
2137
|
}
|
|
2067
|
-
_probability;
|
|
2068
2138
|
get probability() {
|
|
2069
2139
|
return this._probability;
|
|
2070
2140
|
}
|
|
@@ -2284,9 +2354,9 @@ var dataStructureTyped = (() => {
|
|
|
2284
2354
|
* is provided and is an array, it is assigned to the `_elements
|
|
2285
2355
|
*/
|
|
2286
2356
|
constructor(elements) {
|
|
2357
|
+
__publicField(this, "_elements");
|
|
2287
2358
|
this._elements = Array.isArray(elements) ? elements : [];
|
|
2288
2359
|
}
|
|
2289
|
-
_elements;
|
|
2290
2360
|
get elements() {
|
|
2291
2361
|
return this._elements;
|
|
2292
2362
|
}
|
|
@@ -2426,7 +2496,8 @@ var dataStructureTyped = (() => {
|
|
|
2426
2496
|
* @returns The `getFirst()` method is returning the value of the `head` node if it exists, otherwise it returns `undefined`.
|
|
2427
2497
|
*/
|
|
2428
2498
|
getFirst() {
|
|
2429
|
-
|
|
2499
|
+
var _a;
|
|
2500
|
+
return (_a = this.head) == null ? void 0 : _a.value;
|
|
2430
2501
|
}
|
|
2431
2502
|
/**
|
|
2432
2503
|
* The `peek` function returns the value of the head node in a linked list, or `undefined` if the list is empty.
|
|
@@ -2444,14 +2515,14 @@ var dataStructureTyped = (() => {
|
|
|
2444
2515
|
* initialized as an empty array.
|
|
2445
2516
|
*/
|
|
2446
2517
|
constructor(elements) {
|
|
2518
|
+
__publicField(this, "_nodes");
|
|
2519
|
+
__publicField(this, "_offset");
|
|
2447
2520
|
this._nodes = elements || [];
|
|
2448
2521
|
this._offset = 0;
|
|
2449
2522
|
}
|
|
2450
|
-
_nodes;
|
|
2451
2523
|
get nodes() {
|
|
2452
2524
|
return this._nodes;
|
|
2453
2525
|
}
|
|
2454
|
-
_offset;
|
|
2455
2526
|
get offset() {
|
|
2456
2527
|
return this._offset;
|
|
2457
2528
|
}
|
|
@@ -2674,26 +2745,26 @@ var dataStructureTyped = (() => {
|
|
|
2674
2745
|
};
|
|
2675
2746
|
var ObjectDeque = class {
|
|
2676
2747
|
constructor(capacity) {
|
|
2748
|
+
__publicField(this, "_nodes", {});
|
|
2749
|
+
__publicField(this, "_capacity", Number.MAX_SAFE_INTEGER);
|
|
2750
|
+
__publicField(this, "_first", -1);
|
|
2751
|
+
__publicField(this, "_last", -1);
|
|
2752
|
+
__publicField(this, "_size", 0);
|
|
2677
2753
|
if (capacity !== void 0)
|
|
2678
2754
|
this._capacity = capacity;
|
|
2679
2755
|
}
|
|
2680
|
-
_nodes = {};
|
|
2681
2756
|
get nodes() {
|
|
2682
2757
|
return this._nodes;
|
|
2683
2758
|
}
|
|
2684
|
-
_capacity = Number.MAX_SAFE_INTEGER;
|
|
2685
2759
|
get capacity() {
|
|
2686
2760
|
return this._capacity;
|
|
2687
2761
|
}
|
|
2688
|
-
_first = -1;
|
|
2689
2762
|
get first() {
|
|
2690
2763
|
return this._first;
|
|
2691
2764
|
}
|
|
2692
|
-
_last = -1;
|
|
2693
2765
|
get last() {
|
|
2694
2766
|
return this._last;
|
|
2695
2767
|
}
|
|
2696
|
-
_size = 0;
|
|
2697
2768
|
get size() {
|
|
2698
2769
|
return this._size;
|
|
2699
2770
|
}
|
|
@@ -2838,7 +2909,9 @@ var dataStructureTyped = (() => {
|
|
|
2838
2909
|
}
|
|
2839
2910
|
};
|
|
2840
2911
|
var ArrayDeque = class {
|
|
2841
|
-
|
|
2912
|
+
constructor() {
|
|
2913
|
+
__publicField(this, "_nodes", []);
|
|
2914
|
+
}
|
|
2842
2915
|
get nodes() {
|
|
2843
2916
|
return this._nodes;
|
|
2844
2917
|
}
|
|
@@ -2872,7 +2945,8 @@ var dataStructureTyped = (() => {
|
|
|
2872
2945
|
* @returns The method `popLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
2873
2946
|
*/
|
|
2874
2947
|
popLast() {
|
|
2875
|
-
|
|
2948
|
+
var _a;
|
|
2949
|
+
return (_a = this.nodes.pop()) != null ? _a : null;
|
|
2876
2950
|
}
|
|
2877
2951
|
/**
|
|
2878
2952
|
* Time Complexity: O(n)
|
|
@@ -2887,7 +2961,8 @@ var dataStructureTyped = (() => {
|
|
|
2887
2961
|
* empty.
|
|
2888
2962
|
*/
|
|
2889
2963
|
popFirst() {
|
|
2890
|
-
|
|
2964
|
+
var _a;
|
|
2965
|
+
return (_a = this.nodes.shift()) != null ? _a : null;
|
|
2891
2966
|
}
|
|
2892
2967
|
/**
|
|
2893
2968
|
* Time Complexity: O(n)
|
|
@@ -2918,7 +2993,8 @@ var dataStructureTyped = (() => {
|
|
|
2918
2993
|
* empty, it will return `null`.
|
|
2919
2994
|
*/
|
|
2920
2995
|
getFirst() {
|
|
2921
|
-
|
|
2996
|
+
var _a;
|
|
2997
|
+
return (_a = this.nodes[0]) != null ? _a : null;
|
|
2922
2998
|
}
|
|
2923
2999
|
/**
|
|
2924
3000
|
* Time Complexity: O(1)
|
|
@@ -2932,7 +3008,8 @@ var dataStructureTyped = (() => {
|
|
|
2932
3008
|
* @returns The method `getLast()` returns the last element of the `_nodes` array, or `null` if the array is empty.
|
|
2933
3009
|
*/
|
|
2934
3010
|
getLast() {
|
|
2935
|
-
|
|
3011
|
+
var _a;
|
|
3012
|
+
return (_a = this.nodes[this.nodes.length - 1]) != null ? _a : null;
|
|
2936
3013
|
}
|
|
2937
3014
|
/**
|
|
2938
3015
|
* Time Complexity: O(1)
|
|
@@ -2949,7 +3026,8 @@ var dataStructureTyped = (() => {
|
|
|
2949
3026
|
* will be returned. If the element does not exist (i.e., the index is out of bounds), `null` will be returned.
|
|
2950
3027
|
*/
|
|
2951
3028
|
get(index) {
|
|
2952
|
-
|
|
3029
|
+
var _a;
|
|
3030
|
+
return (_a = this.nodes[index]) != null ? _a : null;
|
|
2953
3031
|
}
|
|
2954
3032
|
/**
|
|
2955
3033
|
* Time Complexity: O(1)
|
|
@@ -3060,13 +3138,13 @@ var dataStructureTyped = (() => {
|
|
|
3060
3138
|
var trampolineAsync = (fn) => {
|
|
3061
3139
|
const cont = (...args) => toThunk(() => fn(...args));
|
|
3062
3140
|
return Object.assign(
|
|
3063
|
-
|
|
3064
|
-
let result =
|
|
3141
|
+
(...args) => __async(void 0, null, function* () {
|
|
3142
|
+
let result = yield fn(...args);
|
|
3065
3143
|
while (isThunk(result) && typeof result === "function") {
|
|
3066
|
-
result =
|
|
3144
|
+
result = yield result();
|
|
3067
3145
|
}
|
|
3068
3146
|
return result;
|
|
3069
|
-
},
|
|
3147
|
+
}),
|
|
3070
3148
|
{ cont }
|
|
3071
3149
|
);
|
|
3072
3150
|
};
|
|
@@ -3080,17 +3158,17 @@ var dataStructureTyped = (() => {
|
|
|
3080
3158
|
// src/data-structures/heap/heap.ts
|
|
3081
3159
|
var Heap = class _Heap {
|
|
3082
3160
|
constructor(options) {
|
|
3161
|
+
__publicField(this, "_nodes", []);
|
|
3162
|
+
__publicField(this, "_comparator");
|
|
3083
3163
|
this._comparator = options.comparator;
|
|
3084
3164
|
if (options.nodes && options.nodes.length > 0) {
|
|
3085
3165
|
this._nodes = options.nodes;
|
|
3086
3166
|
this.fix();
|
|
3087
3167
|
}
|
|
3088
3168
|
}
|
|
3089
|
-
_nodes = [];
|
|
3090
3169
|
get nodes() {
|
|
3091
3170
|
return this._nodes;
|
|
3092
3171
|
}
|
|
3093
|
-
_comparator;
|
|
3094
3172
|
get comparator() {
|
|
3095
3173
|
return this._comparator;
|
|
3096
3174
|
}
|
|
@@ -3105,7 +3183,8 @@ var dataStructureTyped = (() => {
|
|
|
3105
3183
|
* @returns The last element or undefined if the heap is empty.
|
|
3106
3184
|
*/
|
|
3107
3185
|
get leaf() {
|
|
3108
|
-
|
|
3186
|
+
var _a;
|
|
3187
|
+
return (_a = this.nodes[this.size - 1]) != null ? _a : void 0;
|
|
3109
3188
|
}
|
|
3110
3189
|
/**
|
|
3111
3190
|
* Static method that creates a binary heap from an array of nodes and a comparison function.
|
|
@@ -3397,14 +3476,14 @@ var dataStructureTyped = (() => {
|
|
|
3397
3476
|
}
|
|
3398
3477
|
};
|
|
3399
3478
|
var FibonacciHeapNode = class {
|
|
3400
|
-
element;
|
|
3401
|
-
degree;
|
|
3402
|
-
left;
|
|
3403
|
-
right;
|
|
3404
|
-
child;
|
|
3405
|
-
parent;
|
|
3406
|
-
marked;
|
|
3407
3479
|
constructor(element, degree = 0) {
|
|
3480
|
+
__publicField(this, "element");
|
|
3481
|
+
__publicField(this, "degree");
|
|
3482
|
+
__publicField(this, "left");
|
|
3483
|
+
__publicField(this, "right");
|
|
3484
|
+
__publicField(this, "child");
|
|
3485
|
+
__publicField(this, "parent");
|
|
3486
|
+
__publicField(this, "marked");
|
|
3408
3487
|
this.element = element;
|
|
3409
3488
|
this.degree = degree;
|
|
3410
3489
|
this.marked = false;
|
|
@@ -3412,25 +3491,25 @@ var dataStructureTyped = (() => {
|
|
|
3412
3491
|
};
|
|
3413
3492
|
var FibonacciHeap = class {
|
|
3414
3493
|
constructor(comparator) {
|
|
3494
|
+
__publicField(this, "_root");
|
|
3495
|
+
__publicField(this, "_size", 0);
|
|
3496
|
+
__publicField(this, "_min");
|
|
3497
|
+
__publicField(this, "_comparator");
|
|
3415
3498
|
this.clear();
|
|
3416
3499
|
this._comparator = comparator || this.defaultComparator;
|
|
3417
3500
|
if (typeof this.comparator !== "function") {
|
|
3418
3501
|
throw new Error("FibonacciHeap constructor: given comparator should be a function.");
|
|
3419
3502
|
}
|
|
3420
3503
|
}
|
|
3421
|
-
_root;
|
|
3422
3504
|
get root() {
|
|
3423
3505
|
return this._root;
|
|
3424
3506
|
}
|
|
3425
|
-
_size = 0;
|
|
3426
3507
|
get size() {
|
|
3427
3508
|
return this._size;
|
|
3428
3509
|
}
|
|
3429
|
-
_min;
|
|
3430
3510
|
get min() {
|
|
3431
3511
|
return this._min;
|
|
3432
3512
|
}
|
|
3433
|
-
_comparator;
|
|
3434
3513
|
get comparator() {
|
|
3435
3514
|
return this._comparator;
|
|
3436
3515
|
}
|
|
@@ -3813,8 +3892,6 @@ var dataStructureTyped = (() => {
|
|
|
3813
3892
|
|
|
3814
3893
|
// src/data-structures/graph/abstract-graph.ts
|
|
3815
3894
|
var AbstractVertex = class {
|
|
3816
|
-
key;
|
|
3817
|
-
value;
|
|
3818
3895
|
/**
|
|
3819
3896
|
* The function is a protected constructor that takes an key and an optional value as parameters.
|
|
3820
3897
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex. It is
|
|
@@ -3823,13 +3900,13 @@ var dataStructureTyped = (() => {
|
|
|
3823
3900
|
* vertex. If no value is provided, it will be set to undefined.
|
|
3824
3901
|
*/
|
|
3825
3902
|
constructor(key, value) {
|
|
3903
|
+
__publicField(this, "key");
|
|
3904
|
+
__publicField(this, "value");
|
|
3826
3905
|
this.key = key;
|
|
3827
3906
|
this.value = value;
|
|
3828
3907
|
}
|
|
3829
3908
|
};
|
|
3830
3909
|
var AbstractEdge = class {
|
|
3831
|
-
value;
|
|
3832
|
-
weight;
|
|
3833
3910
|
/**
|
|
3834
3911
|
* The above function is a protected constructor that initializes the weight, value, and hash code properties of an
|
|
3835
3912
|
* object.
|
|
@@ -3840,11 +3917,13 @@ var dataStructureTyped = (() => {
|
|
|
3840
3917
|
* meaning it can be omitted when creating an instance of the class.
|
|
3841
3918
|
*/
|
|
3842
3919
|
constructor(weight, value) {
|
|
3920
|
+
__publicField(this, "value");
|
|
3921
|
+
__publicField(this, "weight");
|
|
3922
|
+
__publicField(this, "_hashCode");
|
|
3843
3923
|
this.weight = weight !== void 0 ? weight : 1;
|
|
3844
3924
|
this.value = value;
|
|
3845
3925
|
this._hashCode = uuidV4();
|
|
3846
3926
|
}
|
|
3847
|
-
_hashCode;
|
|
3848
3927
|
get hashCode() {
|
|
3849
3928
|
return this._hashCode;
|
|
3850
3929
|
}
|
|
@@ -3854,7 +3933,9 @@ var dataStructureTyped = (() => {
|
|
|
3854
3933
|
*/
|
|
3855
3934
|
};
|
|
3856
3935
|
var AbstractGraph = class {
|
|
3857
|
-
|
|
3936
|
+
constructor() {
|
|
3937
|
+
__publicField(this, "_vertices", /* @__PURE__ */ new Map());
|
|
3938
|
+
}
|
|
3858
3939
|
get vertices() {
|
|
3859
3940
|
return this._vertices;
|
|
3860
3941
|
}
|
|
@@ -4063,9 +4144,10 @@ var dataStructureTyped = (() => {
|
|
|
4063
4144
|
* @returns The function `getPathSumWeight` returns the sum of the weights of the edges in the given path.
|
|
4064
4145
|
*/
|
|
4065
4146
|
getPathSumWeight(path) {
|
|
4147
|
+
var _a;
|
|
4066
4148
|
let sum = 0;
|
|
4067
4149
|
for (let i = 0; i < path.length; i++) {
|
|
4068
|
-
sum += this.getEdge(path[i], path[i + 1])
|
|
4150
|
+
sum += ((_a = this.getEdge(path[i], path[i + 1])) == null ? void 0 : _a.weight) || 0;
|
|
4069
4151
|
}
|
|
4070
4152
|
return sum;
|
|
4071
4153
|
}
|
|
@@ -4155,6 +4237,7 @@ var dataStructureTyped = (() => {
|
|
|
4155
4237
|
* two vertices (`v1` and `v2`). If there is no path between the vertices, it returns `null`.
|
|
4156
4238
|
*/
|
|
4157
4239
|
getMinPathBetween(v1, v2, isWeight, isDFS = false) {
|
|
4240
|
+
var _a, _b;
|
|
4158
4241
|
if (isWeight === void 0)
|
|
4159
4242
|
isWeight = false;
|
|
4160
4243
|
if (isWeight) {
|
|
@@ -4173,7 +4256,7 @@ var dataStructureTyped = (() => {
|
|
|
4173
4256
|
}
|
|
4174
4257
|
return allPaths[minIndex] || null;
|
|
4175
4258
|
} else {
|
|
4176
|
-
return this.dijkstra(v1, v2, true, true)
|
|
4259
|
+
return (_b = (_a = this.dijkstra(v1, v2, true, true)) == null ? void 0 : _a.minPath) != null ? _b : [];
|
|
4177
4260
|
}
|
|
4178
4261
|
} else {
|
|
4179
4262
|
let minPath = [];
|
|
@@ -4362,6 +4445,7 @@ var dataStructureTyped = (() => {
|
|
|
4362
4445
|
* @returns The function `dijkstra` returns an object of type `DijkstraResult<VO>`.
|
|
4363
4446
|
*/
|
|
4364
4447
|
dijkstra(src, dest, getMinDist, genPaths) {
|
|
4448
|
+
var _a;
|
|
4365
4449
|
if (getMinDist === void 0)
|
|
4366
4450
|
getMinDist = false;
|
|
4367
4451
|
if (genPaths === void 0)
|
|
@@ -4408,8 +4492,8 @@ var dataStructureTyped = (() => {
|
|
|
4408
4492
|
};
|
|
4409
4493
|
while (heap.size > 0) {
|
|
4410
4494
|
const curHeapNode = heap.poll();
|
|
4411
|
-
const dist = curHeapNode
|
|
4412
|
-
const cur = curHeapNode
|
|
4495
|
+
const dist = curHeapNode == null ? void 0 : curHeapNode.key;
|
|
4496
|
+
const cur = curHeapNode == null ? void 0 : curHeapNode.value;
|
|
4413
4497
|
if (dist !== void 0) {
|
|
4414
4498
|
if (cur) {
|
|
4415
4499
|
seen.add(cur);
|
|
@@ -4425,7 +4509,7 @@ var dataStructureTyped = (() => {
|
|
|
4425
4509
|
const neighbors = this.getNeighbors(cur);
|
|
4426
4510
|
for (const neighbor of neighbors) {
|
|
4427
4511
|
if (!seen.has(neighbor)) {
|
|
4428
|
-
const weight = this.getEdge(cur, neighbor)
|
|
4512
|
+
const weight = (_a = this.getEdge(cur, neighbor)) == null ? void 0 : _a.weight;
|
|
4429
4513
|
if (typeof weight === "number") {
|
|
4430
4514
|
const distSrcToNeighbor = distMap.get(neighbor);
|
|
4431
4515
|
if (distSrcToNeighbor) {
|
|
@@ -4602,6 +4686,7 @@ var dataStructureTyped = (() => {
|
|
|
4602
4686
|
* path between vertices in the
|
|
4603
4687
|
*/
|
|
4604
4688
|
floydWarshall() {
|
|
4689
|
+
var _a;
|
|
4605
4690
|
const idAndVertices = [...this._vertices];
|
|
4606
4691
|
const n = idAndVertices.length;
|
|
4607
4692
|
const costs = [];
|
|
@@ -4615,7 +4700,7 @@ var dataStructureTyped = (() => {
|
|
|
4615
4700
|
}
|
|
4616
4701
|
for (let i = 0; i < n; i++) {
|
|
4617
4702
|
for (let j = 0; j < n; j++) {
|
|
4618
|
-
costs[i][j] = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])
|
|
4703
|
+
costs[i][j] = ((_a = this.getEdge(idAndVertices[i][1], idAndVertices[j][1])) == null ? void 0 : _a.weight) || Infinity;
|
|
4619
4704
|
}
|
|
4620
4705
|
}
|
|
4621
4706
|
for (let k = 0; k < n; k++) {
|
|
@@ -4726,10 +4811,11 @@ var dataStructureTyped = (() => {
|
|
|
4726
4811
|
const getSCCs = () => {
|
|
4727
4812
|
const SCCs2 = /* @__PURE__ */ new Map();
|
|
4728
4813
|
lowMap.forEach((low, vertex) => {
|
|
4814
|
+
var _a;
|
|
4729
4815
|
if (!SCCs2.has(low)) {
|
|
4730
4816
|
SCCs2.set(low, [vertex]);
|
|
4731
4817
|
} else {
|
|
4732
|
-
SCCs2.get(low)
|
|
4818
|
+
(_a = SCCs2.get(low)) == null ? void 0 : _a.push(vertex);
|
|
4733
4819
|
}
|
|
4734
4820
|
});
|
|
4735
4821
|
return SCCs2;
|
|
@@ -4834,8 +4920,6 @@ var dataStructureTyped = (() => {
|
|
|
4834
4920
|
}
|
|
4835
4921
|
};
|
|
4836
4922
|
var DirectedEdge = class extends AbstractEdge {
|
|
4837
|
-
src;
|
|
4838
|
-
dest;
|
|
4839
4923
|
/**
|
|
4840
4924
|
* The constructor function initializes the source and destination vertices of an edge, along with an optional weight
|
|
4841
4925
|
* and value.
|
|
@@ -4849,6 +4933,8 @@ var dataStructureTyped = (() => {
|
|
|
4849
4933
|
*/
|
|
4850
4934
|
constructor(src, dest, weight, value) {
|
|
4851
4935
|
super(weight, value);
|
|
4936
|
+
__publicField(this, "src");
|
|
4937
|
+
__publicField(this, "dest");
|
|
4852
4938
|
this.src = src;
|
|
4853
4939
|
this.dest = dest;
|
|
4854
4940
|
}
|
|
@@ -4859,12 +4945,12 @@ var dataStructureTyped = (() => {
|
|
|
4859
4945
|
*/
|
|
4860
4946
|
constructor() {
|
|
4861
4947
|
super();
|
|
4948
|
+
__publicField(this, "_outEdgeMap", /* @__PURE__ */ new Map());
|
|
4949
|
+
__publicField(this, "_inEdgeMap", /* @__PURE__ */ new Map());
|
|
4862
4950
|
}
|
|
4863
|
-
_outEdgeMap = /* @__PURE__ */ new Map();
|
|
4864
4951
|
get outEdgeMap() {
|
|
4865
4952
|
return this._outEdgeMap;
|
|
4866
4953
|
}
|
|
4867
|
-
_inEdgeMap = /* @__PURE__ */ new Map();
|
|
4868
4954
|
get inEdgeMap() {
|
|
4869
4955
|
return this._inEdgeMap;
|
|
4870
4956
|
}
|
|
@@ -4882,7 +4968,7 @@ var dataStructureTyped = (() => {
|
|
|
4882
4968
|
* @returns a new instance of a DirectedVertex object, casted as type VO.
|
|
4883
4969
|
*/
|
|
4884
4970
|
createVertex(key, value) {
|
|
4885
|
-
return new DirectedVertex(key, value
|
|
4971
|
+
return new DirectedVertex(key, value != null ? value : key);
|
|
4886
4972
|
}
|
|
4887
4973
|
/**
|
|
4888
4974
|
* 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 +4985,7 @@ var dataStructureTyped = (() => {
|
|
|
4899
4985
|
* @returns a new instance of a DirectedEdge object, casted as type EO.
|
|
4900
4986
|
*/
|
|
4901
4987
|
createEdge(src, dest, weight, value) {
|
|
4902
|
-
return new DirectedEdge(src, dest, weight
|
|
4988
|
+
return new DirectedEdge(src, dest, weight != null ? weight : 1, value);
|
|
4903
4989
|
}
|
|
4904
4990
|
/**
|
|
4905
4991
|
* Time Complexity: O(|V|) where |V| is the number of vertices
|
|
@@ -5187,7 +5273,7 @@ var dataStructureTyped = (() => {
|
|
|
5187
5273
|
* @returns an array of vertices or vertex IDs in topological order. If there is a cycle in the graph, it returns null.
|
|
5188
5274
|
*/
|
|
5189
5275
|
topologicalSort(propertyName) {
|
|
5190
|
-
propertyName = propertyName
|
|
5276
|
+
propertyName = propertyName != null ? propertyName : "key";
|
|
5191
5277
|
const statusMap = /* @__PURE__ */ new Map();
|
|
5192
5278
|
for (const entry of this.vertices) {
|
|
5193
5279
|
statusMap.set(entry[1], 0);
|
|
@@ -5344,7 +5430,6 @@ var dataStructureTyped = (() => {
|
|
|
5344
5430
|
}
|
|
5345
5431
|
};
|
|
5346
5432
|
var UndirectedEdge = class extends AbstractEdge {
|
|
5347
|
-
vertices;
|
|
5348
5433
|
/**
|
|
5349
5434
|
* The constructor function creates an instance of a class with two vertex IDs, an optional weight, and an optional
|
|
5350
5435
|
* value.
|
|
@@ -5357,6 +5442,7 @@ var dataStructureTyped = (() => {
|
|
|
5357
5442
|
*/
|
|
5358
5443
|
constructor(v1, v2, weight, value) {
|
|
5359
5444
|
super(weight, value);
|
|
5445
|
+
__publicField(this, "vertices");
|
|
5360
5446
|
this.vertices = [v1, v2];
|
|
5361
5447
|
}
|
|
5362
5448
|
};
|
|
@@ -5366,9 +5452,9 @@ var dataStructureTyped = (() => {
|
|
|
5366
5452
|
*/
|
|
5367
5453
|
constructor() {
|
|
5368
5454
|
super();
|
|
5455
|
+
__publicField(this, "_edges");
|
|
5369
5456
|
this._edges = /* @__PURE__ */ new Map();
|
|
5370
5457
|
}
|
|
5371
|
-
_edges;
|
|
5372
5458
|
get edges() {
|
|
5373
5459
|
return this._edges;
|
|
5374
5460
|
}
|
|
@@ -5382,7 +5468,7 @@ var dataStructureTyped = (() => {
|
|
|
5382
5468
|
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `VO`.
|
|
5383
5469
|
*/
|
|
5384
5470
|
createVertex(key, value) {
|
|
5385
|
-
return new UndirectedVertex(key, value
|
|
5471
|
+
return new UndirectedVertex(key, value != null ? value : key);
|
|
5386
5472
|
}
|
|
5387
5473
|
/**
|
|
5388
5474
|
* The function creates an undirected edge between two vertices with an optional weight and value.
|
|
@@ -5395,7 +5481,7 @@ var dataStructureTyped = (() => {
|
|
|
5395
5481
|
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `EO`.
|
|
5396
5482
|
*/
|
|
5397
5483
|
createEdge(v1, v2, weight, value) {
|
|
5398
|
-
return new UndirectedEdge(v1, v2, weight
|
|
5484
|
+
return new UndirectedEdge(v1, v2, weight != null ? weight : 1, value);
|
|
5399
5485
|
}
|
|
5400
5486
|
/**
|
|
5401
5487
|
* Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
|
|
@@ -5413,12 +5499,13 @@ var dataStructureTyped = (() => {
|
|
|
5413
5499
|
* @returns an edge (EO) or null.
|
|
5414
5500
|
*/
|
|
5415
5501
|
getEdge(v1, v2) {
|
|
5502
|
+
var _a;
|
|
5416
5503
|
let edges = [];
|
|
5417
5504
|
if (v1 !== null && v2 !== null) {
|
|
5418
5505
|
const vertex1 = this._getVertex(v1);
|
|
5419
5506
|
const vertex2 = this._getVertex(v2);
|
|
5420
5507
|
if (vertex1 && vertex2) {
|
|
5421
|
-
edges = this._edges.get(vertex1)
|
|
5508
|
+
edges = (_a = this._edges.get(vertex1)) == null ? void 0 : _a.filter((e) => e.vertices.includes(vertex2.key));
|
|
5422
5509
|
}
|
|
5423
5510
|
}
|
|
5424
5511
|
return edges ? edges[0] || null : null;
|
|
@@ -5484,9 +5571,10 @@ var dataStructureTyped = (() => {
|
|
|
5484
5571
|
* edges connected to that vertex.
|
|
5485
5572
|
*/
|
|
5486
5573
|
degreeOf(vertexOrKey) {
|
|
5574
|
+
var _a;
|
|
5487
5575
|
const vertex = this._getVertex(vertexOrKey);
|
|
5488
5576
|
if (vertex) {
|
|
5489
|
-
return this._edges.get(vertex)
|
|
5577
|
+
return ((_a = this._edges.get(vertex)) == null ? void 0 : _a.length) || 0;
|
|
5490
5578
|
} else {
|
|
5491
5579
|
return 0;
|
|
5492
5580
|
}
|
|
@@ -5617,8 +5705,6 @@ var dataStructureTyped = (() => {
|
|
|
5617
5705
|
|
|
5618
5706
|
// src/data-structures/graph/map-graph.ts
|
|
5619
5707
|
var MapVertex = class extends DirectedVertex {
|
|
5620
|
-
lat;
|
|
5621
|
-
long;
|
|
5622
5708
|
/**
|
|
5623
5709
|
* The constructor function initializes an object with an key, latitude, longitude, and an optional value.
|
|
5624
5710
|
* @param {VertexKey} key - The `key` parameter is of type `VertexKey` and represents the identifier of the vertex.
|
|
@@ -5633,6 +5719,8 @@ var dataStructureTyped = (() => {
|
|
|
5633
5719
|
*/
|
|
5634
5720
|
constructor(key, value, lat, long) {
|
|
5635
5721
|
super(key, value);
|
|
5722
|
+
__publicField(this, "lat");
|
|
5723
|
+
__publicField(this, "long");
|
|
5636
5724
|
this.lat = lat;
|
|
5637
5725
|
this.long = long;
|
|
5638
5726
|
}
|
|
@@ -5664,14 +5752,14 @@ var dataStructureTyped = (() => {
|
|
|
5664
5752
|
*/
|
|
5665
5753
|
constructor(origin, bottomRight) {
|
|
5666
5754
|
super();
|
|
5755
|
+
__publicField(this, "_origin", [0, 0]);
|
|
5756
|
+
__publicField(this, "_bottomRight");
|
|
5667
5757
|
this._origin = origin;
|
|
5668
5758
|
this._bottomRight = bottomRight;
|
|
5669
5759
|
}
|
|
5670
|
-
_origin = [0, 0];
|
|
5671
5760
|
get origin() {
|
|
5672
5761
|
return this._origin;
|
|
5673
5762
|
}
|
|
5674
|
-
_bottomRight;
|
|
5675
5763
|
get bottomRight() {
|
|
5676
5764
|
return this._bottomRight;
|
|
5677
5765
|
}
|
|
@@ -5748,28 +5836,29 @@ var dataStructureTyped = (() => {
|
|
|
5748
5836
|
|
|
5749
5837
|
// src/data-structures/binary-tree/binary-tree.ts
|
|
5750
5838
|
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
5839
|
/**
|
|
5764
5840
|
* Creates a new instance of BinaryTreeNode.
|
|
5765
5841
|
* @param {BTNKey} key - The key associated with the node.
|
|
5766
5842
|
* @param {V} value - The value stored in the node.
|
|
5767
5843
|
*/
|
|
5768
5844
|
constructor(key, value) {
|
|
5845
|
+
/**
|
|
5846
|
+
* The key associated with the node.
|
|
5847
|
+
*/
|
|
5848
|
+
__publicField(this, "key");
|
|
5849
|
+
/**
|
|
5850
|
+
* The value stored in the node.
|
|
5851
|
+
*/
|
|
5852
|
+
__publicField(this, "value");
|
|
5853
|
+
/**
|
|
5854
|
+
* The parent node of the current node.
|
|
5855
|
+
*/
|
|
5856
|
+
__publicField(this, "parent");
|
|
5857
|
+
__publicField(this, "_left");
|
|
5858
|
+
__publicField(this, "_right");
|
|
5769
5859
|
this.key = key;
|
|
5770
5860
|
this.value = value;
|
|
5771
5861
|
}
|
|
5772
|
-
_left;
|
|
5773
5862
|
/**
|
|
5774
5863
|
* Get the left child node.
|
|
5775
5864
|
*/
|
|
@@ -5786,7 +5875,6 @@ var dataStructureTyped = (() => {
|
|
|
5786
5875
|
}
|
|
5787
5876
|
this._left = v;
|
|
5788
5877
|
}
|
|
5789
|
-
_right;
|
|
5790
5878
|
/**
|
|
5791
5879
|
* Get the right child node.
|
|
5792
5880
|
*/
|
|
@@ -5821,26 +5909,27 @@ var dataStructureTyped = (() => {
|
|
|
5821
5909
|
}
|
|
5822
5910
|
};
|
|
5823
5911
|
var BinaryTree = class {
|
|
5824
|
-
iterationType = "ITERATIVE" /* ITERATIVE */;
|
|
5825
5912
|
/**
|
|
5826
5913
|
* Creates a new instance of BinaryTree.
|
|
5827
5914
|
* @param {BinaryTreeOptions} [options] - The options for the binary tree.
|
|
5828
5915
|
*/
|
|
5829
5916
|
constructor(options) {
|
|
5917
|
+
__publicField(this, "iterationType", "ITERATIVE" /* ITERATIVE */);
|
|
5918
|
+
__publicField(this, "_root");
|
|
5919
|
+
__publicField(this, "_size");
|
|
5920
|
+
__publicField(this, "_defaultOneParamCallback", (node) => node.key);
|
|
5830
5921
|
if (options) {
|
|
5831
5922
|
const { iterationType = "ITERATIVE" /* ITERATIVE */ } = options;
|
|
5832
5923
|
this.iterationType = iterationType;
|
|
5833
5924
|
}
|
|
5834
5925
|
this._size = 0;
|
|
5835
5926
|
}
|
|
5836
|
-
_root;
|
|
5837
5927
|
/**
|
|
5838
5928
|
* Get the root node of the binary tree.
|
|
5839
5929
|
*/
|
|
5840
5930
|
get root() {
|
|
5841
5931
|
return this._root;
|
|
5842
5932
|
}
|
|
5843
|
-
_size;
|
|
5844
5933
|
/**
|
|
5845
5934
|
* Get the number of nodes in the binary tree.
|
|
5846
5935
|
*/
|
|
@@ -5941,7 +6030,7 @@ var dataStructureTyped = (() => {
|
|
|
5941
6030
|
if (keyOrNode === null) {
|
|
5942
6031
|
return this.add(null);
|
|
5943
6032
|
}
|
|
5944
|
-
const value = values
|
|
6033
|
+
const value = values == null ? void 0 : values[i];
|
|
5945
6034
|
return this.add(keyOrNode, value);
|
|
5946
6035
|
});
|
|
5947
6036
|
}
|
|
@@ -5993,7 +6082,7 @@ var dataStructureTyped = (() => {
|
|
|
5993
6082
|
const curr = this.getNode(identifier, callback);
|
|
5994
6083
|
if (!curr)
|
|
5995
6084
|
return deletedResult;
|
|
5996
|
-
const parent = curr
|
|
6085
|
+
const parent = (curr == null ? void 0 : curr.parent) ? curr.parent : null;
|
|
5997
6086
|
let needBalanced = void 0;
|
|
5998
6087
|
let orgCurrent = curr;
|
|
5999
6088
|
if (!curr.left) {
|
|
@@ -6049,7 +6138,7 @@ var dataStructureTyped = (() => {
|
|
|
6049
6138
|
distNode = this.ensureNotKey(distNode);
|
|
6050
6139
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
6051
6140
|
let depth = 0;
|
|
6052
|
-
while (distNode
|
|
6141
|
+
while (distNode == null ? void 0 : distNode.parent) {
|
|
6053
6142
|
if (distNode === beginRoot) {
|
|
6054
6143
|
return depth;
|
|
6055
6144
|
}
|
|
@@ -6123,6 +6212,7 @@ var dataStructureTyped = (() => {
|
|
|
6123
6212
|
* @returns The function `getMinHeight` returns the minimum height of a binary tree.
|
|
6124
6213
|
*/
|
|
6125
6214
|
getMinHeight(beginRoot = this.root, iterationType = this.iterationType) {
|
|
6215
|
+
var _a, _b, _c;
|
|
6126
6216
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
6127
6217
|
if (!beginRoot)
|
|
6128
6218
|
return -1;
|
|
@@ -6150,8 +6240,8 @@ var dataStructureTyped = (() => {
|
|
|
6150
6240
|
if (!node.right || last === node.right) {
|
|
6151
6241
|
node = stack.pop();
|
|
6152
6242
|
if (node) {
|
|
6153
|
-
const leftMinHeight = node.left ? depths.get(node.left)
|
|
6154
|
-
const rightMinHeight = node.right ? depths.get(node.right)
|
|
6243
|
+
const leftMinHeight = node.left ? (_a = depths.get(node.left)) != null ? _a : -1 : -1;
|
|
6244
|
+
const rightMinHeight = node.right ? (_b = depths.get(node.right)) != null ? _b : -1 : -1;
|
|
6155
6245
|
depths.set(node, 1 + Math.min(leftMinHeight, rightMinHeight));
|
|
6156
6246
|
last = node;
|
|
6157
6247
|
node = null;
|
|
@@ -6160,7 +6250,7 @@ var dataStructureTyped = (() => {
|
|
|
6160
6250
|
node = node.right;
|
|
6161
6251
|
}
|
|
6162
6252
|
}
|
|
6163
|
-
return depths.get(beginRoot)
|
|
6253
|
+
return (_c = depths.get(beginRoot)) != null ? _c : -1;
|
|
6164
6254
|
}
|
|
6165
6255
|
}
|
|
6166
6256
|
/**
|
|
@@ -6302,9 +6392,10 @@ var dataStructureTyped = (() => {
|
|
|
6302
6392
|
* @returns a value of type `N | null | undefined`.
|
|
6303
6393
|
*/
|
|
6304
6394
|
getNode(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
6395
|
+
var _a;
|
|
6305
6396
|
if ((!callback || callback === this._defaultOneParamCallback) && identifier instanceof BinaryTreeNode)
|
|
6306
6397
|
callback = (node) => node;
|
|
6307
|
-
return this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]
|
|
6398
|
+
return (_a = this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]) != null ? _a : null;
|
|
6308
6399
|
}
|
|
6309
6400
|
/**
|
|
6310
6401
|
* Time Complexity: O(n)
|
|
@@ -6393,9 +6484,10 @@ var dataStructureTyped = (() => {
|
|
|
6393
6484
|
* found, `undefined` is returned.
|
|
6394
6485
|
*/
|
|
6395
6486
|
get(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
6487
|
+
var _a, _b;
|
|
6396
6488
|
if ((!callback || callback === this._defaultOneParamCallback) && identifier instanceof BinaryTreeNode)
|
|
6397
6489
|
callback = (node) => node;
|
|
6398
|
-
return this.getNode(identifier, callback, beginRoot, iterationType)
|
|
6490
|
+
return (_b = (_a = this.getNode(identifier, callback, beginRoot, iterationType)) == null ? void 0 : _a.value) != null ? _b : void 0;
|
|
6399
6491
|
}
|
|
6400
6492
|
/**
|
|
6401
6493
|
* Clear the binary tree, removing all nodes.
|
|
@@ -7126,11 +7218,11 @@ var dataStructureTyped = (() => {
|
|
|
7126
7218
|
}
|
|
7127
7219
|
} else {
|
|
7128
7220
|
if (node.left) {
|
|
7129
|
-
yield* this[Symbol.iterator](node.left);
|
|
7221
|
+
yield* __yieldStar(this[Symbol.iterator](node.left));
|
|
7130
7222
|
}
|
|
7131
7223
|
yield node.key;
|
|
7132
7224
|
if (node.right) {
|
|
7133
|
-
yield* this[Symbol.iterator](node.right);
|
|
7225
|
+
yield* __yieldStar(this[Symbol.iterator](node.right));
|
|
7134
7226
|
}
|
|
7135
7227
|
}
|
|
7136
7228
|
}
|
|
@@ -7195,7 +7287,6 @@ var dataStructureTyped = (() => {
|
|
|
7195
7287
|
};
|
|
7196
7288
|
display(beginRoot);
|
|
7197
7289
|
}
|
|
7198
|
-
_defaultOneParamCallback = (node) => node.key;
|
|
7199
7290
|
/**
|
|
7200
7291
|
* Swap the data of two nodes in the binary tree.
|
|
7201
7292
|
* @param {N} srcNode - The source node to swap.
|
|
@@ -7268,14 +7359,15 @@ var dataStructureTyped = (() => {
|
|
|
7268
7359
|
|
|
7269
7360
|
// src/data-structures/binary-tree/bst.ts
|
|
7270
7361
|
var BSTNode = class extends BinaryTreeNode {
|
|
7271
|
-
parent;
|
|
7272
7362
|
constructor(key, value) {
|
|
7273
7363
|
super(key, value);
|
|
7364
|
+
__publicField(this, "parent");
|
|
7365
|
+
__publicField(this, "_left");
|
|
7366
|
+
__publicField(this, "_right");
|
|
7274
7367
|
this.parent = void 0;
|
|
7275
7368
|
this._left = void 0;
|
|
7276
7369
|
this._right = void 0;
|
|
7277
7370
|
}
|
|
7278
|
-
_left;
|
|
7279
7371
|
/**
|
|
7280
7372
|
* Get the left child node.
|
|
7281
7373
|
*/
|
|
@@ -7292,7 +7384,6 @@ var dataStructureTyped = (() => {
|
|
|
7292
7384
|
}
|
|
7293
7385
|
this._left = v;
|
|
7294
7386
|
}
|
|
7295
|
-
_right;
|
|
7296
7387
|
/**
|
|
7297
7388
|
* Get the right child node.
|
|
7298
7389
|
*/
|
|
@@ -7318,6 +7409,8 @@ var dataStructureTyped = (() => {
|
|
|
7318
7409
|
*/
|
|
7319
7410
|
constructor(options) {
|
|
7320
7411
|
super(options);
|
|
7412
|
+
__publicField(this, "_root");
|
|
7413
|
+
__publicField(this, "_comparator", (a, b) => a - b);
|
|
7321
7414
|
this._root = void 0;
|
|
7322
7415
|
if (options !== void 0) {
|
|
7323
7416
|
const { comparator } = options;
|
|
@@ -7326,7 +7419,6 @@ var dataStructureTyped = (() => {
|
|
|
7326
7419
|
}
|
|
7327
7420
|
}
|
|
7328
7421
|
}
|
|
7329
|
-
_root;
|
|
7330
7422
|
/**
|
|
7331
7423
|
* Get the root node of the binary tree.
|
|
7332
7424
|
*/
|
|
@@ -7450,10 +7542,10 @@ var dataStructureTyped = (() => {
|
|
|
7450
7542
|
return arr.indexOf(void 0) === -1;
|
|
7451
7543
|
}
|
|
7452
7544
|
if (!isBalanceAdd || !hasNoUndefined(keysOrNodes)) {
|
|
7453
|
-
return super.addMany(keysOrNodes, data).map((n) => n
|
|
7545
|
+
return super.addMany(keysOrNodes, data).map((n) => n != null ? n : void 0);
|
|
7454
7546
|
}
|
|
7455
7547
|
const inserted = [];
|
|
7456
|
-
const combinedArr = keysOrNodes.map((value, index) => [value, data
|
|
7548
|
+
const combinedArr = keysOrNodes.map((value, index) => [value, data == null ? void 0 : data[index]]);
|
|
7457
7549
|
let sorted = [];
|
|
7458
7550
|
function _isNodeOrUndefinedTuple(arr) {
|
|
7459
7551
|
for (const [keyOrNode] of arr)
|
|
@@ -7481,10 +7573,10 @@ var dataStructureTyped = (() => {
|
|
|
7481
7573
|
if (arr.length === 0)
|
|
7482
7574
|
return;
|
|
7483
7575
|
const mid = Math.floor((arr.length - 1) / 2);
|
|
7484
|
-
const newNode = this.add(arr[mid], data2
|
|
7576
|
+
const newNode = this.add(arr[mid], data2 == null ? void 0 : data2[mid]);
|
|
7485
7577
|
inserted.push(newNode);
|
|
7486
|
-
_dfs(arr.slice(0, mid), data2
|
|
7487
|
-
_dfs(arr.slice(mid + 1), data2
|
|
7578
|
+
_dfs(arr.slice(0, mid), data2 == null ? void 0 : data2.slice(0, mid));
|
|
7579
|
+
_dfs(arr.slice(mid + 1), data2 == null ? void 0 : data2.slice(mid + 1));
|
|
7488
7580
|
};
|
|
7489
7581
|
const _iterate = () => {
|
|
7490
7582
|
const n = sorted.length;
|
|
@@ -7495,7 +7587,7 @@ var dataStructureTyped = (() => {
|
|
|
7495
7587
|
const [l, r] = popped;
|
|
7496
7588
|
if (l <= r) {
|
|
7497
7589
|
const m = l + Math.floor((r - l) / 2);
|
|
7498
|
-
const newNode = this.add(sortedKeysOrNodes[m], sortedData
|
|
7590
|
+
const newNode = this.add(sortedKeysOrNodes[m], sortedData == null ? void 0 : sortedData[m]);
|
|
7499
7591
|
inserted.push(newNode);
|
|
7500
7592
|
stack.push([m + 1, r]);
|
|
7501
7593
|
stack.push([l, m - 1]);
|
|
@@ -7530,12 +7622,13 @@ var dataStructureTyped = (() => {
|
|
|
7530
7622
|
* rightmost node otherwise. If no node is found, it returns 0.
|
|
7531
7623
|
*/
|
|
7532
7624
|
lastKey(beginRoot = this.root, iterationType = this.iterationType) {
|
|
7625
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7533
7626
|
if (this._compare(0, 1) === "lt" /* lt */)
|
|
7534
|
-
return this.getRightMost(beginRoot, iterationType)
|
|
7627
|
+
return (_b = (_a = this.getRightMost(beginRoot, iterationType)) == null ? void 0 : _a.key) != null ? _b : 0;
|
|
7535
7628
|
else if (this._compare(0, 1) === "gt" /* gt */)
|
|
7536
|
-
return this.getLeftMost(beginRoot, iterationType)
|
|
7629
|
+
return (_d = (_c = this.getLeftMost(beginRoot, iterationType)) == null ? void 0 : _c.key) != null ? _d : 0;
|
|
7537
7630
|
else
|
|
7538
|
-
return this.getRightMost(beginRoot, iterationType)
|
|
7631
|
+
return (_f = (_e = this.getRightMost(beginRoot, iterationType)) == null ? void 0 : _e.key) != null ? _f : 0;
|
|
7539
7632
|
}
|
|
7540
7633
|
/**
|
|
7541
7634
|
* Time Complexity: O(log n) - Average case for a balanced tree.
|
|
@@ -7813,6 +7906,7 @@ var dataStructureTyped = (() => {
|
|
|
7813
7906
|
* @returns a boolean value.
|
|
7814
7907
|
*/
|
|
7815
7908
|
isAVLBalanced(iterationType = this.iterationType) {
|
|
7909
|
+
var _a, _b;
|
|
7816
7910
|
if (!this.root)
|
|
7817
7911
|
return true;
|
|
7818
7912
|
let balanced = true;
|
|
@@ -7839,8 +7933,8 @@ var dataStructureTyped = (() => {
|
|
|
7839
7933
|
if (!node.right || last === node.right) {
|
|
7840
7934
|
node = stack.pop();
|
|
7841
7935
|
if (node) {
|
|
7842
|
-
const left = node.left ? depths.get(node.left)
|
|
7843
|
-
const right = node.right ? depths.get(node.right)
|
|
7936
|
+
const left = node.left ? (_a = depths.get(node.left)) != null ? _a : -1 : -1;
|
|
7937
|
+
const right = node.right ? (_b = depths.get(node.right)) != null ? _b : -1 : -1;
|
|
7844
7938
|
if (Math.abs(left - right) > 1)
|
|
7845
7939
|
return false;
|
|
7846
7940
|
depths.set(node, 1 + Math.max(left, right));
|
|
@@ -7854,7 +7948,6 @@ var dataStructureTyped = (() => {
|
|
|
7854
7948
|
}
|
|
7855
7949
|
return balanced;
|
|
7856
7950
|
}
|
|
7857
|
-
_comparator = (a, b) => a - b;
|
|
7858
7951
|
_setRoot(v) {
|
|
7859
7952
|
if (v) {
|
|
7860
7953
|
v.parent = void 0;
|
|
@@ -7882,8 +7975,6 @@ var dataStructureTyped = (() => {
|
|
|
7882
7975
|
|
|
7883
7976
|
// src/data-structures/binary-tree/binary-indexed-tree.ts
|
|
7884
7977
|
var BinaryIndexedTree = class {
|
|
7885
|
-
_freq;
|
|
7886
|
-
_max;
|
|
7887
7978
|
/**
|
|
7888
7979
|
* The constructor initializes the properties of an object, including default frequency, maximum
|
|
7889
7980
|
* value, a freqMap data structure, the most significant bit, and the count of negative frequencies.
|
|
@@ -7891,21 +7982,23 @@ var dataStructureTyped = (() => {
|
|
|
7891
7982
|
* value of 0.
|
|
7892
7983
|
*/
|
|
7893
7984
|
constructor({ frequency = 0, max }) {
|
|
7985
|
+
__publicField(this, "_freq");
|
|
7986
|
+
__publicField(this, "_max");
|
|
7987
|
+
__publicField(this, "_freqMap");
|
|
7988
|
+
__publicField(this, "_msb");
|
|
7989
|
+
__publicField(this, "_negativeCount");
|
|
7894
7990
|
this._freq = frequency;
|
|
7895
7991
|
this._max = max;
|
|
7896
7992
|
this._freqMap = { 0: 0 };
|
|
7897
7993
|
this._msb = getMSB(max);
|
|
7898
7994
|
this._negativeCount = frequency < 0 ? max : 0;
|
|
7899
7995
|
}
|
|
7900
|
-
_freqMap;
|
|
7901
7996
|
get freqMap() {
|
|
7902
7997
|
return this._freqMap;
|
|
7903
7998
|
}
|
|
7904
|
-
_msb;
|
|
7905
7999
|
get msb() {
|
|
7906
8000
|
return this._msb;
|
|
7907
8001
|
}
|
|
7908
|
-
_negativeCount;
|
|
7909
8002
|
get negativeCount() {
|
|
7910
8003
|
return this._negativeCount;
|
|
7911
8004
|
}
|
|
@@ -8144,13 +8237,13 @@ var dataStructureTyped = (() => {
|
|
|
8144
8237
|
|
|
8145
8238
|
// src/data-structures/binary-tree/segment-tree.ts
|
|
8146
8239
|
var SegmentTreeNode = class {
|
|
8147
|
-
start = 0;
|
|
8148
|
-
end = 0;
|
|
8149
|
-
value = null;
|
|
8150
|
-
sum = 0;
|
|
8151
|
-
left = null;
|
|
8152
|
-
right = null;
|
|
8153
8240
|
constructor(start, end, sum, value) {
|
|
8241
|
+
__publicField(this, "start", 0);
|
|
8242
|
+
__publicField(this, "end", 0);
|
|
8243
|
+
__publicField(this, "value", null);
|
|
8244
|
+
__publicField(this, "sum", 0);
|
|
8245
|
+
__publicField(this, "left", null);
|
|
8246
|
+
__publicField(this, "right", null);
|
|
8154
8247
|
this.start = start;
|
|
8155
8248
|
this.end = end;
|
|
8156
8249
|
this.sum = sum;
|
|
@@ -8168,6 +8261,10 @@ var dataStructureTyped = (() => {
|
|
|
8168
8261
|
* included in the range. If not provided, it defaults to the index of the last element in the "values" array.
|
|
8169
8262
|
*/
|
|
8170
8263
|
constructor(values, start, end) {
|
|
8264
|
+
__publicField(this, "_values", []);
|
|
8265
|
+
__publicField(this, "_start", 0);
|
|
8266
|
+
__publicField(this, "_end");
|
|
8267
|
+
__publicField(this, "_root");
|
|
8171
8268
|
start = start || 0;
|
|
8172
8269
|
end = end || values.length - 1;
|
|
8173
8270
|
this._values = values;
|
|
@@ -8180,19 +8277,15 @@ var dataStructureTyped = (() => {
|
|
|
8180
8277
|
this._values = [];
|
|
8181
8278
|
}
|
|
8182
8279
|
}
|
|
8183
|
-
_values = [];
|
|
8184
8280
|
get values() {
|
|
8185
8281
|
return this._values;
|
|
8186
8282
|
}
|
|
8187
|
-
_start = 0;
|
|
8188
8283
|
get start() {
|
|
8189
8284
|
return this._start;
|
|
8190
8285
|
}
|
|
8191
|
-
_end;
|
|
8192
8286
|
get end() {
|
|
8193
8287
|
return this._end;
|
|
8194
8288
|
}
|
|
8195
|
-
_root;
|
|
8196
8289
|
get root() {
|
|
8197
8290
|
return this._root;
|
|
8198
8291
|
}
|
|
@@ -8308,9 +8401,9 @@ var dataStructureTyped = (() => {
|
|
|
8308
8401
|
|
|
8309
8402
|
// src/data-structures/binary-tree/avl-tree.ts
|
|
8310
8403
|
var AVLTreeNode = class extends BSTNode {
|
|
8311
|
-
height;
|
|
8312
8404
|
constructor(key, value) {
|
|
8313
8405
|
super(key, value);
|
|
8406
|
+
__publicField(this, "height");
|
|
8314
8407
|
this.height = 0;
|
|
8315
8408
|
}
|
|
8316
8409
|
};
|
|
@@ -8526,7 +8619,7 @@ var dataStructureTyped = (() => {
|
|
|
8526
8619
|
if (B)
|
|
8527
8620
|
this._setRoot(B);
|
|
8528
8621
|
} else {
|
|
8529
|
-
if (parentOfA
|
|
8622
|
+
if ((parentOfA == null ? void 0 : parentOfA.left) === A) {
|
|
8530
8623
|
parentOfA.left = B;
|
|
8531
8624
|
} else {
|
|
8532
8625
|
if (parentOfA)
|
|
@@ -8693,14 +8786,13 @@ var dataStructureTyped = (() => {
|
|
|
8693
8786
|
|
|
8694
8787
|
// src/data-structures/binary-tree/rb-tree.ts
|
|
8695
8788
|
var RedBlackTreeNode = class extends BSTNode {
|
|
8696
|
-
color;
|
|
8697
8789
|
constructor(key, value, color = 0 /* BLACK */) {
|
|
8698
8790
|
super(key, value);
|
|
8791
|
+
__publicField(this, "color");
|
|
8699
8792
|
this.color = color;
|
|
8700
8793
|
}
|
|
8701
8794
|
};
|
|
8702
8795
|
var RedBlackTree = class extends BST {
|
|
8703
|
-
NIL = new RedBlackTreeNode(NaN);
|
|
8704
8796
|
/**
|
|
8705
8797
|
* The constructor function initializes a Red-Black Tree with an optional set of options.
|
|
8706
8798
|
* @param {RBTreeOptions} [options] - The `options` parameter is an optional object that can be
|
|
@@ -8708,13 +8800,14 @@ var dataStructureTyped = (() => {
|
|
|
8708
8800
|
*/
|
|
8709
8801
|
constructor(options) {
|
|
8710
8802
|
super(options);
|
|
8803
|
+
__publicField(this, "NIL", new RedBlackTreeNode(NaN));
|
|
8804
|
+
__publicField(this, "_root");
|
|
8805
|
+
__publicField(this, "_size", 0);
|
|
8711
8806
|
this._root = this.NIL;
|
|
8712
8807
|
}
|
|
8713
|
-
_root;
|
|
8714
8808
|
get root() {
|
|
8715
8809
|
return this._root;
|
|
8716
8810
|
}
|
|
8717
|
-
_size = 0;
|
|
8718
8811
|
get size() {
|
|
8719
8812
|
return this._size;
|
|
8720
8813
|
}
|
|
@@ -8755,7 +8848,7 @@ var dataStructureTyped = (() => {
|
|
|
8755
8848
|
if (x && node.key < x.key) {
|
|
8756
8849
|
x = x.left;
|
|
8757
8850
|
} else {
|
|
8758
|
-
x = x
|
|
8851
|
+
x = x == null ? void 0 : x.right;
|
|
8759
8852
|
}
|
|
8760
8853
|
}
|
|
8761
8854
|
node.parent = y;
|
|
@@ -8814,7 +8907,7 @@ var dataStructureTyped = (() => {
|
|
|
8814
8907
|
if (node && identifier && callback(node) <= identifier) {
|
|
8815
8908
|
node = node.right;
|
|
8816
8909
|
} else {
|
|
8817
|
-
node = node
|
|
8910
|
+
node = node == null ? void 0 : node.left;
|
|
8818
8911
|
}
|
|
8819
8912
|
}
|
|
8820
8913
|
if (z === this.NIL) {
|
|
@@ -8882,10 +8975,11 @@ var dataStructureTyped = (() => {
|
|
|
8882
8975
|
* @returns a value of type `N`, `null`, or `undefined`.
|
|
8883
8976
|
*/
|
|
8884
8977
|
getNode(identifier, callback = this._defaultOneParamCallback, beginRoot = this.root, iterationType = this.iterationType) {
|
|
8978
|
+
var _a;
|
|
8885
8979
|
if (identifier instanceof BinaryTreeNode)
|
|
8886
8980
|
callback = (node) => node;
|
|
8887
8981
|
beginRoot = this.ensureNotKey(beginRoot);
|
|
8888
|
-
return this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]
|
|
8982
|
+
return (_a = this.getNodes(identifier, callback, true, beginRoot, iterationType)[0]) != null ? _a : void 0;
|
|
8889
8983
|
}
|
|
8890
8984
|
/**
|
|
8891
8985
|
* Time Complexity: O(log n) on average (where n is the number of nodes in the tree)
|
|
@@ -8900,8 +8994,9 @@ var dataStructureTyped = (() => {
|
|
|
8900
8994
|
* @returns the successor of the given RedBlackTreeNode.
|
|
8901
8995
|
*/
|
|
8902
8996
|
getSuccessor(x) {
|
|
8997
|
+
var _a;
|
|
8903
8998
|
if (x.right !== this.NIL) {
|
|
8904
|
-
return this.getLeftMost(x.right)
|
|
8999
|
+
return (_a = this.getLeftMost(x.right)) != null ? _a : void 0;
|
|
8905
9000
|
}
|
|
8906
9001
|
let y = x.parent;
|
|
8907
9002
|
while (y !== this.NIL && y !== void 0 && x === y.right) {
|
|
@@ -9159,7 +9254,6 @@ var dataStructureTyped = (() => {
|
|
|
9159
9254
|
|
|
9160
9255
|
// src/data-structures/binary-tree/tree-multimap.ts
|
|
9161
9256
|
var TreeMultimapNode = class extends AVLTreeNode {
|
|
9162
|
-
count;
|
|
9163
9257
|
/**
|
|
9164
9258
|
* The constructor function initializes a BinaryTreeNode object with a key, value, and count.
|
|
9165
9259
|
* @param {BTNKey} key - The `key` parameter is of type `BTNKey` and represents the unique identifier
|
|
@@ -9172,6 +9266,7 @@ var dataStructureTyped = (() => {
|
|
|
9172
9266
|
*/
|
|
9173
9267
|
constructor(key, value, count = 1) {
|
|
9174
9268
|
super(key, value);
|
|
9269
|
+
__publicField(this, "count");
|
|
9175
9270
|
this.count = count;
|
|
9176
9271
|
}
|
|
9177
9272
|
};
|
|
@@ -9184,8 +9279,8 @@ var dataStructureTyped = (() => {
|
|
|
9184
9279
|
*/
|
|
9185
9280
|
constructor(options) {
|
|
9186
9281
|
super(options);
|
|
9282
|
+
__publicField(this, "_count", 0);
|
|
9187
9283
|
}
|
|
9188
|
-
_count = 0;
|
|
9189
9284
|
get count() {
|
|
9190
9285
|
return this._count;
|
|
9191
9286
|
}
|
|
@@ -9311,7 +9406,7 @@ var dataStructureTyped = (() => {
|
|
|
9311
9406
|
inserted.push(this.add(NaN, void 0, 0));
|
|
9312
9407
|
continue;
|
|
9313
9408
|
}
|
|
9314
|
-
inserted.push(this.add(keyOrNode, data
|
|
9409
|
+
inserted.push(this.add(keyOrNode, data == null ? void 0 : data[i], 1));
|
|
9315
9410
|
}
|
|
9316
9411
|
return inserted;
|
|
9317
9412
|
}
|
|
@@ -9389,13 +9484,14 @@ var dataStructureTyped = (() => {
|
|
|
9389
9484
|
* @returns an array of `BiTreeDeleteResult<N>`.
|
|
9390
9485
|
*/
|
|
9391
9486
|
delete(identifier, callback = this._defaultOneParamCallback, ignoreCount = false) {
|
|
9487
|
+
var _a;
|
|
9392
9488
|
const deletedResult = [];
|
|
9393
9489
|
if (!this.root)
|
|
9394
9490
|
return deletedResult;
|
|
9395
|
-
const curr = this.getNode(identifier, callback)
|
|
9491
|
+
const curr = (_a = this.getNode(identifier, callback)) != null ? _a : void 0;
|
|
9396
9492
|
if (!curr)
|
|
9397
9493
|
return deletedResult;
|
|
9398
|
-
const parent = curr
|
|
9494
|
+
const parent = (curr == null ? void 0 : curr.parent) ? curr.parent : void 0;
|
|
9399
9495
|
let needBalanced = void 0, orgCurrent = curr;
|
|
9400
9496
|
if (curr.count > 1 && !ignoreCount) {
|
|
9401
9497
|
curr.count--;
|
|
@@ -9523,10 +9619,10 @@ var dataStructureTyped = (() => {
|
|
|
9523
9619
|
|
|
9524
9620
|
// src/data-structures/tree/tree.ts
|
|
9525
9621
|
var TreeNode = class _TreeNode {
|
|
9526
|
-
key;
|
|
9527
|
-
value;
|
|
9528
|
-
children;
|
|
9529
9622
|
constructor(key, value, children) {
|
|
9623
|
+
__publicField(this, "key");
|
|
9624
|
+
__publicField(this, "value");
|
|
9625
|
+
__publicField(this, "children");
|
|
9530
9626
|
this.key = key;
|
|
9531
9627
|
this.value = value || void 0;
|
|
9532
9628
|
this.children = children || [];
|
|
@@ -9563,13 +9659,13 @@ var dataStructureTyped = (() => {
|
|
|
9563
9659
|
|
|
9564
9660
|
// src/data-structures/matrix/matrix.ts
|
|
9565
9661
|
var MatrixNTI2D = class {
|
|
9566
|
-
_matrix;
|
|
9567
9662
|
/**
|
|
9568
9663
|
* The constructor creates a matrix with the specified number of rows and columns, and initializes all elements to a
|
|
9569
9664
|
* given initial value or 0 if not provided.
|
|
9570
9665
|
* @param options - An object containing the following properties:
|
|
9571
9666
|
*/
|
|
9572
9667
|
constructor(options) {
|
|
9668
|
+
__publicField(this, "_matrix");
|
|
9573
9669
|
const { row, col, initialVal } = options;
|
|
9574
9670
|
this._matrix = new Array(row).fill(void 0).map(() => new Array(col).fill(initialVal || 0));
|
|
9575
9671
|
}
|
|
@@ -9861,7 +9957,6 @@ var dataStructureTyped = (() => {
|
|
|
9861
9957
|
|
|
9862
9958
|
// src/data-structures/matrix/matrix2d.ts
|
|
9863
9959
|
var Matrix2D = class _Matrix2D {
|
|
9864
|
-
_matrix;
|
|
9865
9960
|
/**
|
|
9866
9961
|
* The constructor function initializes a Matrix2D object with either a default identity matrix, or a provided matrix
|
|
9867
9962
|
* or Vector2D object.
|
|
@@ -9869,6 +9964,7 @@ var dataStructureTyped = (() => {
|
|
|
9869
9964
|
* an instance of the `Vector2D` class.
|
|
9870
9965
|
*/
|
|
9871
9966
|
constructor(value) {
|
|
9967
|
+
__publicField(this, "_matrix");
|
|
9872
9968
|
if (typeof value === "undefined") {
|
|
9873
9969
|
this._matrix = _Matrix2D.identity;
|
|
9874
9970
|
} else if (value instanceof Vector2D) {
|
|
@@ -10049,8 +10145,6 @@ var dataStructureTyped = (() => {
|
|
|
10049
10145
|
|
|
10050
10146
|
// src/data-structures/matrix/navigator.ts
|
|
10051
10147
|
var Character = class _Character {
|
|
10052
|
-
direction;
|
|
10053
|
-
turn;
|
|
10054
10148
|
/**
|
|
10055
10149
|
* The constructor function takes in a direction and turning object and sets the direction and turn properties of the
|
|
10056
10150
|
* Character class.
|
|
@@ -10060,22 +10154,24 @@ var dataStructureTyped = (() => {
|
|
|
10060
10154
|
* turning direction. It is used to determine the new direction when the character turns.
|
|
10061
10155
|
*/
|
|
10062
10156
|
constructor(direction, turning) {
|
|
10157
|
+
__publicField(this, "direction");
|
|
10158
|
+
__publicField(this, "turn");
|
|
10063
10159
|
this.direction = direction;
|
|
10064
10160
|
this.turn = () => new _Character(turning[direction], turning);
|
|
10065
10161
|
}
|
|
10066
10162
|
};
|
|
10067
10163
|
var Navigator = class {
|
|
10068
|
-
onMove;
|
|
10069
|
-
_matrix;
|
|
10070
|
-
_cur;
|
|
10071
|
-
_character;
|
|
10072
|
-
_VISITED;
|
|
10073
10164
|
/**
|
|
10074
10165
|
* The constructor initializes the Navigator object with the given parameters and sets the current position as visited
|
|
10075
10166
|
* in the matrix.
|
|
10076
10167
|
* @param - - `matrix`: a 2D array representing the grid or map
|
|
10077
10168
|
*/
|
|
10078
10169
|
constructor({ matrix, turning, onMove, init: { cur, charDir, VISITED } }) {
|
|
10170
|
+
__publicField(this, "onMove");
|
|
10171
|
+
__publicField(this, "_matrix");
|
|
10172
|
+
__publicField(this, "_cur");
|
|
10173
|
+
__publicField(this, "_character");
|
|
10174
|
+
__publicField(this, "_VISITED");
|
|
10079
10175
|
this._matrix = matrix;
|
|
10080
10176
|
this._cur = cur;
|
|
10081
10177
|
this._character = new Character(charDir, turning);
|
|
@@ -10158,10 +10254,10 @@ var dataStructureTyped = (() => {
|
|
|
10158
10254
|
|
|
10159
10255
|
// src/data-structures/trie/trie.ts
|
|
10160
10256
|
var TrieNode = class {
|
|
10161
|
-
key;
|
|
10162
|
-
children;
|
|
10163
|
-
isEnd;
|
|
10164
10257
|
constructor(key) {
|
|
10258
|
+
__publicField(this, "key");
|
|
10259
|
+
__publicField(this, "children");
|
|
10260
|
+
__publicField(this, "isEnd");
|
|
10165
10261
|
this.key = key;
|
|
10166
10262
|
this.isEnd = false;
|
|
10167
10263
|
this.children = /* @__PURE__ */ new Map();
|
|
@@ -10169,6 +10265,8 @@ var dataStructureTyped = (() => {
|
|
|
10169
10265
|
};
|
|
10170
10266
|
var Trie = class {
|
|
10171
10267
|
constructor(words, caseSensitive = true) {
|
|
10268
|
+
__publicField(this, "_caseSensitive");
|
|
10269
|
+
__publicField(this, "_root");
|
|
10172
10270
|
this._root = new TrieNode("");
|
|
10173
10271
|
this._caseSensitive = caseSensitive;
|
|
10174
10272
|
if (words) {
|
|
@@ -10177,11 +10275,9 @@ var dataStructureTyped = (() => {
|
|
|
10177
10275
|
}
|
|
10178
10276
|
}
|
|
10179
10277
|
}
|
|
10180
|
-
_caseSensitive;
|
|
10181
10278
|
get caseSensitive() {
|
|
10182
10279
|
return this._caseSensitive;
|
|
10183
10280
|
}
|
|
10184
|
-
_root;
|
|
10185
10281
|
get root() {
|
|
10186
10282
|
return this._root;
|
|
10187
10283
|
}
|