data-structure-typed 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/COMMANDS.md +13 -3
- package/README.md +5 -34
- package/benchmark/report.html +1 -1
- package/benchmark/report.json +101 -101
- package/dist/cjs/index.cjs +13062 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/index.mjs +12984 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/index.cjs +13091 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +13013 -0
- package/dist/index.js.map +1 -0
- package/dist/{cjs → types}/data-structures/binary-tree/avl-tree-counter.d.ts +4 -4
- package/dist/{esm → types}/data-structures/binary-tree/avl-tree-multi-map.d.ts +5 -5
- package/dist/{esm → types}/data-structures/binary-tree/avl-tree.d.ts +4 -4
- package/dist/{esm → types}/data-structures/binary-tree/binary-tree.d.ts +5 -5
- package/dist/{esm → types}/data-structures/binary-tree/bst.d.ts +5 -5
- package/dist/{esm → types}/data-structures/binary-tree/red-black-tree.d.ts +5 -5
- package/dist/{cjs → types}/data-structures/binary-tree/tree-counter.d.ts +4 -4
- package/dist/{cjs → types}/data-structures/binary-tree/tree-multi-map.d.ts +5 -5
- package/dist/{esm → types}/interfaces/binary-tree.d.ts +2 -2
- package/dist/umd/data-structure-typed.js +12 -11
- package/dist/umd/data-structure-typed.js.map +1 -0
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/jest.integration.config.js +3 -0
- package/package.json +13 -11
- package/src/data-structures/binary-tree/avl-tree-counter.ts +4 -7
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +5 -10
- package/src/data-structures/binary-tree/avl-tree.ts +4 -6
- package/src/data-structures/binary-tree/binary-tree.ts +14 -16
- package/src/data-structures/binary-tree/bst.ts +5 -10
- package/src/data-structures/binary-tree/red-black-tree.ts +5 -10
- package/src/data-structures/binary-tree/tree-counter.ts +4 -9
- package/src/data-structures/binary-tree/tree-multi-map.ts +5 -10
- package/src/interfaces/binary-tree.ts +2 -2
- package/test/integration/all-in-one.test.ts +1 -1
- package/test/performance/data-structures/comparison/comparison.test.ts +27 -57
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +109 -1
- package/tsconfig-base.json +20 -20
- package/tsconfig-types.json +17 -0
- package/tsconfig.test.json +8 -0
- package/tsup.config.js +11 -22
- package/tsup.node.config.ts +37 -0
- package/dist/cjs/common/index.js +0 -29
- package/dist/cjs/common/index.js.map +0 -1
- package/dist/cjs/data-structures/base/index.js +0 -19
- package/dist/cjs/data-structures/base/index.js.map +0 -1
- package/dist/cjs/data-structures/base/iterable-element-base.js +0 -244
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +0 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.js +0 -184
- package/dist/cjs/data-structures/base/iterable-entry-base.js.map +0 -1
- package/dist/cjs/data-structures/base/linear-base.js +0 -416
- package/dist/cjs/data-structures/base/linear-base.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +0 -375
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -135
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +0 -251
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +0 -291
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +0 -612
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +0 -295
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +0 -754
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +0 -1926
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +0 -413
- package/dist/cjs/data-structures/binary-tree/bst.js +0 -904
- package/dist/cjs/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/index.js +0 -27
- package/dist/cjs/data-structures/binary-tree/index.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +0 -208
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +0 -547
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/segment-tree.js +0 -298
- package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +0 -414
- package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +0 -385
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/cjs/data-structures/graph/abstract-graph.js +0 -897
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/cjs/data-structures/graph/directed-graph.js +0 -526
- package/dist/cjs/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/cjs/data-structures/graph/index.js +0 -21
- package/dist/cjs/data-structures/graph/index.js.map +0 -1
- package/dist/cjs/data-structures/graph/map-graph.js +0 -108
- package/dist/cjs/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/data-structures/graph/undirected-graph.js +0 -425
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/data-structures/hash/hash-map.js +0 -693
- package/dist/cjs/data-structures/hash/hash-map.js.map +0 -1
- package/dist/cjs/data-structures/hash/index.js +0 -18
- package/dist/cjs/data-structures/hash/index.js.map +0 -1
- package/dist/cjs/data-structures/heap/heap.js +0 -902
- package/dist/cjs/data-structures/heap/heap.js.map +0 -1
- package/dist/cjs/data-structures/heap/index.js +0 -20
- package/dist/cjs/data-structures/heap/index.js.map +0 -1
- package/dist/cjs/data-structures/heap/max-heap.js +0 -41
- package/dist/cjs/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/data-structures/heap/min-heap.js +0 -32
- package/dist/cjs/data-structures/heap/min-heap.js.map +0 -1
- package/dist/cjs/data-structures/index.js +0 -29
- package/dist/cjs/data-structures/index.js.map +0 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +0 -1112
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/cjs/data-structures/linked-list/index.js +0 -20
- package/dist/cjs/data-structures/linked-list/index.js.map +0 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +0 -851
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +0 -145
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/cjs/data-structures/matrix/index.js +0 -19
- package/dist/cjs/data-structures/matrix/index.js.map +0 -1
- package/dist/cjs/data-structures/matrix/matrix.js +0 -449
- package/dist/cjs/data-structures/matrix/matrix.js.map +0 -1
- package/dist/cjs/data-structures/matrix/navigator.js +0 -112
- package/dist/cjs/data-structures/matrix/navigator.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/index.js +0 -20
- package/dist/cjs/data-structures/priority-queue/index.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +0 -35
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +0 -25
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +0 -21
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/queue/deque.js +0 -880
- package/dist/cjs/data-structures/queue/deque.js.map +0 -1
- package/dist/cjs/data-structures/queue/index.js +0 -19
- package/dist/cjs/data-structures/queue/index.js.map +0 -1
- package/dist/cjs/data-structures/queue/queue.js +0 -474
- package/dist/cjs/data-structures/queue/queue.js.map +0 -1
- package/dist/cjs/data-structures/stack/index.js +0 -18
- package/dist/cjs/data-structures/stack/index.js.map +0 -1
- package/dist/cjs/data-structures/stack/stack.js +0 -402
- package/dist/cjs/data-structures/stack/stack.js.map +0 -1
- package/dist/cjs/data-structures/tree/index.js +0 -18
- package/dist/cjs/data-structures/tree/index.js.map +0 -1
- package/dist/cjs/data-structures/tree/tree.js +0 -108
- package/dist/cjs/data-structures/tree/tree.js.map +0 -1
- package/dist/cjs/data-structures/trie/index.js +0 -18
- package/dist/cjs/data-structures/trie/index.js.map +0 -1
- package/dist/cjs/data-structures/trie/trie.js +0 -611
- package/dist/cjs/data-structures/trie/trie.js.map +0 -1
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +0 -59
- package/dist/cjs/interfaces/binary-tree.js +0 -3
- package/dist/cjs/interfaces/binary-tree.js.map +0 -1
- package/dist/cjs/interfaces/doubly-linked-list.js +0 -3
- package/dist/cjs/interfaces/doubly-linked-list.js.map +0 -1
- package/dist/cjs/interfaces/graph.js +0 -3
- package/dist/cjs/interfaces/graph.js.map +0 -1
- package/dist/cjs/interfaces/heap.js +0 -3
- package/dist/cjs/interfaces/heap.js.map +0 -1
- package/dist/cjs/interfaces/index.js +0 -25
- package/dist/cjs/interfaces/index.js.map +0 -1
- package/dist/cjs/interfaces/navigator.js +0 -3
- package/dist/cjs/interfaces/navigator.js.map +0 -1
- package/dist/cjs/interfaces/priority-queue.js +0 -3
- package/dist/cjs/interfaces/priority-queue.js.map +0 -1
- package/dist/cjs/interfaces/segment-tree.js +0 -3
- package/dist/cjs/interfaces/segment-tree.js.map +0 -1
- package/dist/cjs/interfaces/singly-linked-list.js +0 -3
- package/dist/cjs/interfaces/singly-linked-list.js.map +0 -1
- package/dist/cjs/types/common.js +0 -3
- package/dist/cjs/types/common.js.map +0 -1
- package/dist/cjs/types/data-structures/base/base.js +0 -3
- package/dist/cjs/types/data-structures/base/base.js.map +0 -1
- package/dist/cjs/types/data-structures/base/index.js +0 -18
- package/dist/cjs/types/data-structures/base/index.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/bst.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/index.js +0 -26
- package/dist/cjs/types/data-structures/binary-tree/index.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/red-black-tree.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/red-black-tree.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/segment-tree.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/tree-counter.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.js +0 -3
- package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/cjs/types/data-structures/graph/abstract-graph.js +0 -3
- package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/cjs/types/data-structures/graph/directed-graph.js +0 -3
- package/dist/cjs/types/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/cjs/types/data-structures/graph/index.js +0 -20
- package/dist/cjs/types/data-structures/graph/index.js.map +0 -1
- package/dist/cjs/types/data-structures/graph/map-graph.js +0 -3
- package/dist/cjs/types/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/types/data-structures/graph/undirected-graph.js +0 -3
- package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/types/data-structures/hash/hash-map.js +0 -3
- package/dist/cjs/types/data-structures/hash/hash-map.js.map +0 -1
- package/dist/cjs/types/data-structures/hash/index.js +0 -18
- package/dist/cjs/types/data-structures/hash/index.js.map +0 -1
- package/dist/cjs/types/data-structures/heap/heap.js +0 -3
- package/dist/cjs/types/data-structures/heap/heap.js.map +0 -1
- package/dist/cjs/types/data-structures/heap/index.js +0 -18
- package/dist/cjs/types/data-structures/heap/index.js.map +0 -1
- package/dist/cjs/types/data-structures/heap/max-heap.js +0 -3
- package/dist/cjs/types/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/types/data-structures/heap/min-heap.js +0 -3
- package/dist/cjs/types/data-structures/heap/min-heap.js.map +0 -1
- package/dist/cjs/types/data-structures/index.js +0 -29
- package/dist/cjs/types/data-structures/index.js.map +0 -1
- package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js +0 -3
- package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/cjs/types/data-structures/linked-list/index.js +0 -20
- package/dist/cjs/types/data-structures/linked-list/index.js.map +0 -1
- package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js +0 -3
- package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js +0 -3
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/cjs/types/data-structures/matrix/index.js +0 -19
- package/dist/cjs/types/data-structures/matrix/index.js.map +0 -1
- package/dist/cjs/types/data-structures/matrix/matrix.js +0 -3
- package/dist/cjs/types/data-structures/matrix/matrix.js.map +0 -1
- package/dist/cjs/types/data-structures/matrix/navigator.js +0 -3
- package/dist/cjs/types/data-structures/matrix/navigator.js.map +0 -1
- package/dist/cjs/types/data-structures/priority-queue/index.js +0 -20
- package/dist/cjs/types/data-structures/priority-queue/index.js.map +0 -1
- package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js +0 -3
- package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js +0 -3
- package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/types/data-structures/priority-queue/priority-queue.js +0 -3
- package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/types/data-structures/queue/deque.js +0 -3
- package/dist/cjs/types/data-structures/queue/deque.js.map +0 -1
- package/dist/cjs/types/data-structures/queue/index.js +0 -19
- package/dist/cjs/types/data-structures/queue/index.js.map +0 -1
- package/dist/cjs/types/data-structures/queue/queue.js +0 -3
- package/dist/cjs/types/data-structures/queue/queue.js.map +0 -1
- package/dist/cjs/types/data-structures/stack/index.js +0 -18
- package/dist/cjs/types/data-structures/stack/index.js.map +0 -1
- package/dist/cjs/types/data-structures/stack/stack.js +0 -3
- package/dist/cjs/types/data-structures/stack/stack.js.map +0 -1
- package/dist/cjs/types/data-structures/tree/index.js +0 -18
- package/dist/cjs/types/data-structures/tree/index.js.map +0 -1
- package/dist/cjs/types/data-structures/tree/tree.js +0 -3
- package/dist/cjs/types/data-structures/tree/tree.js.map +0 -1
- package/dist/cjs/types/data-structures/trie/index.js +0 -18
- package/dist/cjs/types/data-structures/trie/index.js.map +0 -1
- package/dist/cjs/types/data-structures/trie/trie.js +0 -3
- package/dist/cjs/types/data-structures/trie/trie.js.map +0 -1
- package/dist/cjs/types/index.js +0 -20
- package/dist/cjs/types/index.js.map +0 -1
- package/dist/cjs/types/utils/index.js +0 -19
- package/dist/cjs/types/utils/index.js.map +0 -1
- package/dist/cjs/types/utils/utils.js +0 -3
- package/dist/cjs/types/utils/utils.js.map +0 -1
- package/dist/cjs/types/utils/validate-type.js +0 -3
- package/dist/cjs/types/utils/validate-type.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -19
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/number.js +0 -24
- package/dist/cjs/utils/number.js.map +0 -1
- package/dist/cjs/utils/utils.js +0 -354
- package/dist/cjs/utils/utils.js.map +0 -1
- package/dist/esm/common/index.d.ts +0 -12
- package/dist/esm/common/index.js +0 -29
- package/dist/esm/common/index.js.map +0 -1
- package/dist/esm/data-structures/base/index.d.ts +0 -2
- package/dist/esm/data-structures/base/index.js +0 -3
- package/dist/esm/data-structures/base/index.js.map +0 -1
- package/dist/esm/data-structures/base/iterable-element-base.d.ts +0 -219
- package/dist/esm/data-structures/base/iterable-element-base.js +0 -247
- package/dist/esm/data-structures/base/iterable-element-base.js.map +0 -1
- package/dist/esm/data-structures/base/iterable-entry-base.d.ts +0 -144
- package/dist/esm/data-structures/base/iterable-entry-base.js +0 -180
- package/dist/esm/data-structures/base/iterable-entry-base.js.map +0 -1
- package/dist/esm/data-structures/base/linear-base.d.ts +0 -335
- package/dist/esm/data-structures/base/linear-base.js +0 -412
- package/dist/esm/data-structures/base/linear-base.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +0 -182
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js +0 -369
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +0 -244
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/avl-tree.js +0 -607
- package/dist/esm/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -174
- package/dist/esm/data-structures/binary-tree/binary-indexed-tree.js +0 -296
- package/dist/esm/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/binary-tree.js +0 -1922
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/bst.js +0 -901
- package/dist/esm/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/index.d.ts +0 -10
- package/dist/esm/data-structures/binary-tree/index.js +0 -11
- package/dist/esm/data-structures/binary-tree/index.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/red-black-tree.js +0 -540
- package/dist/esm/data-structures/binary-tree/red-black-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/segment-tree.d.ts +0 -160
- package/dist/esm/data-structures/binary-tree/segment-tree.js +0 -295
- package/dist/esm/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/tree-counter.d.ts +0 -190
- package/dist/esm/data-structures/binary-tree/tree-counter.js +0 -412
- package/dist/esm/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/tree-multi-map.d.ts +0 -270
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +0 -378
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/esm/data-structures/graph/abstract-graph.d.ts +0 -340
- package/dist/esm/data-structures/graph/abstract-graph.js +0 -892
- package/dist/esm/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/esm/data-structures/graph/directed-graph.d.ts +0 -207
- package/dist/esm/data-structures/graph/directed-graph.js +0 -521
- package/dist/esm/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/esm/data-structures/graph/index.d.ts +0 -4
- package/dist/esm/data-structures/graph/index.js +0 -5
- package/dist/esm/data-structures/graph/index.js.map +0 -1
- package/dist/esm/data-structures/graph/map-graph.d.ts +0 -78
- package/dist/esm/data-structures/graph/map-graph.js +0 -105
- package/dist/esm/data-structures/graph/map-graph.js.map +0 -1
- package/dist/esm/data-structures/graph/undirected-graph.d.ts +0 -188
- package/dist/esm/data-structures/graph/undirected-graph.js +0 -418
- package/dist/esm/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/esm/data-structures/hash/hash-map.d.ts +0 -345
- package/dist/esm/data-structures/hash/hash-map.js +0 -691
- package/dist/esm/data-structures/hash/hash-map.js.map +0 -1
- package/dist/esm/data-structures/hash/index.d.ts +0 -1
- package/dist/esm/data-structures/hash/index.js +0 -2
- package/dist/esm/data-structures/hash/index.js.map +0 -1
- package/dist/esm/data-structures/heap/heap.d.ts +0 -503
- package/dist/esm/data-structures/heap/heap.js +0 -894
- package/dist/esm/data-structures/heap/heap.js.map +0 -1
- package/dist/esm/data-structures/heap/index.d.ts +0 -3
- package/dist/esm/data-structures/heap/index.js +0 -4
- package/dist/esm/data-structures/heap/index.js.map +0 -1
- package/dist/esm/data-structures/heap/max-heap.d.ts +0 -32
- package/dist/esm/data-structures/heap/max-heap.js +0 -40
- package/dist/esm/data-structures/heap/max-heap.js.map +0 -1
- package/dist/esm/data-structures/heap/min-heap.d.ts +0 -33
- package/dist/esm/data-structures/heap/min-heap.js +0 -28
- package/dist/esm/data-structures/heap/min-heap.js.map +0 -1
- package/dist/esm/data-structures/index.d.ts +0 -12
- package/dist/esm/data-structures/index.js +0 -13
- package/dist/esm/data-structures/index.js.map +0 -1
- package/dist/esm/data-structures/linked-list/doubly-linked-list.d.ts +0 -769
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js +0 -1109
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/esm/data-structures/linked-list/index.d.ts +0 -3
- package/dist/esm/data-structures/linked-list/index.js +0 -4
- package/dist/esm/data-structures/linked-list/index.js.map +0 -1
- package/dist/esm/data-structures/linked-list/singly-linked-list.d.ts +0 -451
- package/dist/esm/data-structures/linked-list/singly-linked-list.js +0 -847
- package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/esm/data-structures/linked-list/skip-linked-list.d.ts +0 -27
- package/dist/esm/data-structures/linked-list/skip-linked-list.js +0 -143
- package/dist/esm/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/esm/data-structures/matrix/index.d.ts +0 -2
- package/dist/esm/data-structures/matrix/index.js +0 -3
- package/dist/esm/data-structures/matrix/index.js.map +0 -1
- package/dist/esm/data-structures/matrix/matrix.d.ts +0 -168
- package/dist/esm/data-structures/matrix/matrix.js +0 -444
- package/dist/esm/data-structures/matrix/matrix.js.map +0 -1
- package/dist/esm/data-structures/matrix/navigator.d.ts +0 -55
- package/dist/esm/data-structures/matrix/navigator.js +0 -114
- package/dist/esm/data-structures/matrix/navigator.js.map +0 -1
- package/dist/esm/data-structures/priority-queue/index.d.ts +0 -3
- package/dist/esm/data-structures/priority-queue/index.js +0 -4
- package/dist/esm/data-structures/priority-queue/index.js.map +0 -1
- package/dist/esm/data-structures/priority-queue/max-priority-queue.d.ts +0 -27
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js +0 -34
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/esm/data-structures/priority-queue/min-priority-queue.d.ts +0 -26
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js +0 -21
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/esm/data-structures/priority-queue/priority-queue.d.ts +0 -15
- package/dist/esm/data-structures/priority-queue/priority-queue.js +0 -17
- package/dist/esm/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/esm/data-structures/queue/deque.d.ts +0 -431
- package/dist/esm/data-structures/queue/deque.js +0 -880
- package/dist/esm/data-structures/queue/deque.js.map +0 -1
- package/dist/esm/data-structures/queue/index.d.ts +0 -2
- package/dist/esm/data-structures/queue/index.js +0 -3
- package/dist/esm/data-structures/queue/index.js.map +0 -1
- package/dist/esm/data-structures/queue/queue.d.ts +0 -308
- package/dist/esm/data-structures/queue/queue.js +0 -467
- package/dist/esm/data-structures/queue/queue.js.map +0 -1
- package/dist/esm/data-structures/stack/index.d.ts +0 -1
- package/dist/esm/data-structures/stack/index.js +0 -2
- package/dist/esm/data-structures/stack/index.js.map +0 -1
- package/dist/esm/data-structures/stack/stack.d.ts +0 -306
- package/dist/esm/data-structures/stack/stack.js +0 -398
- package/dist/esm/data-structures/stack/stack.js.map +0 -1
- package/dist/esm/data-structures/tree/index.d.ts +0 -1
- package/dist/esm/data-structures/tree/index.js +0 -2
- package/dist/esm/data-structures/tree/index.js.map +0 -1
- package/dist/esm/data-structures/tree/tree.d.ts +0 -62
- package/dist/esm/data-structures/tree/tree.js +0 -107
- package/dist/esm/data-structures/tree/tree.js.map +0 -1
- package/dist/esm/data-structures/trie/index.d.ts +0 -1
- package/dist/esm/data-structures/trie/index.js +0 -2
- package/dist/esm/data-structures/trie/index.js.map +0 -1
- package/dist/esm/data-structures/trie/trie.d.ts +0 -350
- package/dist/esm/data-structures/trie/trie.js +0 -613
- package/dist/esm/data-structures/trie/trie.js.map +0 -1
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/interfaces/binary-tree.js +0 -2
- package/dist/esm/interfaces/binary-tree.js.map +0 -1
- package/dist/esm/interfaces/doubly-linked-list.d.ts +0 -1
- package/dist/esm/interfaces/doubly-linked-list.js +0 -2
- package/dist/esm/interfaces/doubly-linked-list.js.map +0 -1
- package/dist/esm/interfaces/graph.d.ts +0 -21
- package/dist/esm/interfaces/graph.js +0 -2
- package/dist/esm/interfaces/graph.js.map +0 -1
- package/dist/esm/interfaces/heap.d.ts +0 -1
- package/dist/esm/interfaces/heap.js +0 -2
- package/dist/esm/interfaces/heap.js.map +0 -1
- package/dist/esm/interfaces/index.d.ts +0 -8
- package/dist/esm/interfaces/index.js +0 -9
- package/dist/esm/interfaces/index.js.map +0 -1
- package/dist/esm/interfaces/navigator.d.ts +0 -1
- package/dist/esm/interfaces/navigator.js +0 -2
- package/dist/esm/interfaces/navigator.js.map +0 -1
- package/dist/esm/interfaces/priority-queue.d.ts +0 -1
- package/dist/esm/interfaces/priority-queue.js +0 -2
- package/dist/esm/interfaces/priority-queue.js.map +0 -1
- package/dist/esm/interfaces/segment-tree.d.ts +0 -1
- package/dist/esm/interfaces/segment-tree.js +0 -2
- package/dist/esm/interfaces/segment-tree.js.map +0 -1
- package/dist/esm/interfaces/singly-linked-list.d.ts +0 -1
- package/dist/esm/interfaces/singly-linked-list.js +0 -2
- package/dist/esm/interfaces/singly-linked-list.js.map +0 -1
- package/dist/esm/types/common.d.ts +0 -15
- package/dist/esm/types/common.js +0 -2
- package/dist/esm/types/common.js.map +0 -1
- package/dist/esm/types/data-structures/base/base.d.ts +0 -13
- package/dist/esm/types/data-structures/base/base.js +0 -2
- package/dist/esm/types/data-structures/base/base.js.map +0 -1
- package/dist/esm/types/data-structures/base/index.d.ts +0 -1
- package/dist/esm/types/data-structures/base/index.js +0 -2
- package/dist/esm/types/data-structures/base/index.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/avl-tree.d.ts +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -1
- package/dist/esm/types/data-structures/binary-tree/binary-indexed-tree.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/binary-tree.d.ts +0 -29
- package/dist/esm/types/data-structures/binary-tree/binary-tree.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/bst.d.ts +0 -12
- package/dist/esm/types/data-structures/binary-tree/bst.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/index.d.ts +0 -9
- package/dist/esm/types/data-structures/binary-tree/index.js +0 -10
- package/dist/esm/types/data-structures/binary-tree/index.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/red-black-tree.d.ts +0 -3
- package/dist/esm/types/data-structures/binary-tree/red-black-tree.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/red-black-tree.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/segment-tree.d.ts +0 -1
- package/dist/esm/types/data-structures/binary-tree/segment-tree.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/tree-counter.d.ts +0 -2
- package/dist/esm/types/data-structures/binary-tree/tree-counter.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/esm/types/data-structures/binary-tree/tree-multi-map.d.ts +0 -2
- package/dist/esm/types/data-structures/binary-tree/tree-multi-map.js +0 -2
- package/dist/esm/types/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/esm/types/data-structures/graph/abstract-graph.d.ts +0 -14
- package/dist/esm/types/data-structures/graph/abstract-graph.js +0 -2
- package/dist/esm/types/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/esm/types/data-structures/graph/directed-graph.d.ts +0 -1
- package/dist/esm/types/data-structures/graph/directed-graph.js +0 -2
- package/dist/esm/types/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/esm/types/data-structures/graph/index.d.ts +0 -3
- package/dist/esm/types/data-structures/graph/index.js +0 -4
- package/dist/esm/types/data-structures/graph/index.js.map +0 -1
- package/dist/esm/types/data-structures/graph/map-graph.d.ts +0 -1
- package/dist/esm/types/data-structures/graph/map-graph.js +0 -2
- package/dist/esm/types/data-structures/graph/map-graph.js.map +0 -1
- package/dist/esm/types/data-structures/graph/undirected-graph.d.ts +0 -1
- package/dist/esm/types/data-structures/graph/undirected-graph.js +0 -2
- package/dist/esm/types/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/esm/types/data-structures/hash/hash-map.d.ts +0 -19
- package/dist/esm/types/data-structures/hash/hash-map.js +0 -2
- package/dist/esm/types/data-structures/hash/hash-map.js.map +0 -1
- package/dist/esm/types/data-structures/hash/index.d.ts +0 -2
- package/dist/esm/types/data-structures/hash/index.js +0 -2
- package/dist/esm/types/data-structures/hash/index.js.map +0 -1
- package/dist/esm/types/data-structures/heap/heap.d.ts +0 -5
- package/dist/esm/types/data-structures/heap/heap.js +0 -2
- package/dist/esm/types/data-structures/heap/heap.js.map +0 -1
- package/dist/esm/types/data-structures/heap/index.d.ts +0 -1
- package/dist/esm/types/data-structures/heap/index.js +0 -2
- package/dist/esm/types/data-structures/heap/index.js.map +0 -1
- package/dist/esm/types/data-structures/heap/max-heap.d.ts +0 -1
- package/dist/esm/types/data-structures/heap/max-heap.js +0 -2
- package/dist/esm/types/data-structures/heap/max-heap.js.map +0 -1
- package/dist/esm/types/data-structures/heap/min-heap.d.ts +0 -1
- package/dist/esm/types/data-structures/heap/min-heap.js +0 -2
- package/dist/esm/types/data-structures/heap/min-heap.js.map +0 -1
- package/dist/esm/types/data-structures/index.d.ts +0 -12
- package/dist/esm/types/data-structures/index.js +0 -13
- package/dist/esm/types/data-structures/index.js.map +0 -1
- package/dist/esm/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -2
- package/dist/esm/types/data-structures/linked-list/doubly-linked-list.js +0 -2
- package/dist/esm/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/esm/types/data-structures/linked-list/index.d.ts +0 -3
- package/dist/esm/types/data-structures/linked-list/index.js +0 -4
- package/dist/esm/types/data-structures/linked-list/index.js.map +0 -1
- package/dist/esm/types/data-structures/linked-list/singly-linked-list.d.ts +0 -2
- package/dist/esm/types/data-structures/linked-list/singly-linked-list.js +0 -2
- package/dist/esm/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/esm/types/data-structures/linked-list/skip-linked-list.d.ts +0 -4
- package/dist/esm/types/data-structures/linked-list/skip-linked-list.js +0 -2
- package/dist/esm/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/esm/types/data-structures/matrix/index.d.ts +0 -2
- package/dist/esm/types/data-structures/matrix/index.js +0 -3
- package/dist/esm/types/data-structures/matrix/index.js.map +0 -1
- package/dist/esm/types/data-structures/matrix/matrix.d.ts +0 -7
- package/dist/esm/types/data-structures/matrix/matrix.js +0 -2
- package/dist/esm/types/data-structures/matrix/matrix.js.map +0 -1
- package/dist/esm/types/data-structures/matrix/navigator.d.ts +0 -14
- package/dist/esm/types/data-structures/matrix/navigator.js +0 -2
- package/dist/esm/types/data-structures/matrix/navigator.js.map +0 -1
- package/dist/esm/types/data-structures/priority-queue/index.d.ts +0 -3
- package/dist/esm/types/data-structures/priority-queue/index.js +0 -4
- package/dist/esm/types/data-structures/priority-queue/index.js.map +0 -1
- package/dist/esm/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -1
- package/dist/esm/types/data-structures/priority-queue/max-priority-queue.js +0 -2
- package/dist/esm/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/esm/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -1
- package/dist/esm/types/data-structures/priority-queue/min-priority-queue.js +0 -2
- package/dist/esm/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/esm/types/data-structures/priority-queue/priority-queue.d.ts +0 -2
- package/dist/esm/types/data-structures/priority-queue/priority-queue.js +0 -2
- package/dist/esm/types/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/esm/types/data-structures/queue/deque.d.ts +0 -4
- package/dist/esm/types/data-structures/queue/deque.js +0 -2
- package/dist/esm/types/data-structures/queue/deque.js.map +0 -1
- package/dist/esm/types/data-structures/queue/index.d.ts +0 -2
- package/dist/esm/types/data-structures/queue/index.js +0 -3
- package/dist/esm/types/data-structures/queue/index.js.map +0 -1
- package/dist/esm/types/data-structures/queue/queue.d.ts +0 -4
- package/dist/esm/types/data-structures/queue/queue.js +0 -2
- package/dist/esm/types/data-structures/queue/queue.js.map +0 -1
- package/dist/esm/types/data-structures/stack/index.d.ts +0 -1
- package/dist/esm/types/data-structures/stack/index.js +0 -2
- package/dist/esm/types/data-structures/stack/index.js.map +0 -1
- package/dist/esm/types/data-structures/stack/stack.d.ts +0 -2
- package/dist/esm/types/data-structures/stack/stack.js +0 -2
- package/dist/esm/types/data-structures/stack/stack.js.map +0 -1
- package/dist/esm/types/data-structures/tree/index.d.ts +0 -1
- package/dist/esm/types/data-structures/tree/index.js +0 -2
- package/dist/esm/types/data-structures/tree/index.js.map +0 -1
- package/dist/esm/types/data-structures/tree/tree.d.ts +0 -1
- package/dist/esm/types/data-structures/tree/tree.js +0 -2
- package/dist/esm/types/data-structures/tree/tree.js.map +0 -1
- package/dist/esm/types/data-structures/trie/index.d.ts +0 -1
- package/dist/esm/types/data-structures/trie/index.js +0 -2
- package/dist/esm/types/data-structures/trie/index.js.map +0 -1
- package/dist/esm/types/data-structures/trie/trie.d.ts +0 -4
- package/dist/esm/types/data-structures/trie/trie.js +0 -2
- package/dist/esm/types/data-structures/trie/trie.js.map +0 -1
- package/dist/esm/types/index.d.ts +0 -3
- package/dist/esm/types/index.js +0 -4
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/utils/index.d.ts +0 -2
- package/dist/esm/types/utils/index.js +0 -3
- package/dist/esm/types/utils/index.js.map +0 -1
- package/dist/esm/types/utils/utils.d.ts +0 -22
- package/dist/esm/types/utils/utils.js +0 -2
- package/dist/esm/types/utils/utils.js.map +0 -1
- package/dist/esm/types/utils/validate-type.d.ts +0 -19
- package/dist/esm/types/utils/validate-type.js +0 -2
- package/dist/esm/types/utils/validate-type.js.map +0 -1
- package/dist/esm/utils/index.d.ts +0 -2
- package/dist/esm/utils/index.js +0 -3
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/number.d.ts +0 -14
- package/dist/esm/utils/number.js +0 -21
- package/dist/esm/utils/number.js.map +0 -1
- package/dist/esm/utils/utils.d.ts +0 -209
- package/dist/esm/utils/utils.js +0 -325
- package/dist/esm/utils/utils.js.map +0 -1
- package/tsconfig-cjs.json +0 -14
- package/tsconfig-esm.json +0 -14
- /package/dist/{cjs → types}/common/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/base/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/base/iterable-element-base.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/base/iterable-entry-base.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/base/linear-base.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/binary-tree/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/graph/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/hash/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/heap/heap.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/heap/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/matrix/matrix.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/queue/deque.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/queue/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/queue/queue.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/stack/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/stack/stack.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/tree/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/tree/tree.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/trie/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/trie/trie.d.ts +0 -0
- /package/dist/{cjs → types}/index.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/doubly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/graph.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/heap.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/index.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/navigator.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/segment-tree.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/singly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/types/common.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/base/base.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/base/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/binary-tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/bst.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/red-black-tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/tree-counter.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/binary-tree/tree-multi-map.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/graph/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/hash/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/heap/heap.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/heap/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/matrix/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/matrix/matrix.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/queue/deque.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/queue/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/queue/queue.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/stack/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/stack/stack.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/tree/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/tree/tree.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/trie/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/data-structures/trie/trie.d.ts +0 -0
- /package/dist/{cjs → types}/types/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/utils/index.d.ts +0 -0
- /package/dist/{cjs → types}/types/utils/utils.d.ts +0 -0
- /package/dist/{cjs → types}/types/utils/validate-type.d.ts +0 -0
- /package/dist/{cjs → types}/utils/index.d.ts +0 -0
- /package/dist/{cjs → types}/utils/number.d.ts +0 -0
- /package/dist/{cjs → types}/utils/utils.d.ts +0 -0
|
@@ -61,7 +61,7 @@ export declare class AVLTreeCounterNode<K = any, V = any> extends AVLTreeNode<K,
|
|
|
61
61
|
* @template V
|
|
62
62
|
* @template R
|
|
63
63
|
*/
|
|
64
|
-
export declare class AVLTreeCounter<K = any, V = any, R
|
|
64
|
+
export declare class AVLTreeCounter<K = any, V = any, R = any> extends AVLTree<K, V, R> implements IBinaryTree<K, V, R> {
|
|
65
65
|
/**
|
|
66
66
|
* Create a AVLTreeCounter instance
|
|
67
67
|
* @remarks Time O(n), Space O(n)
|
|
@@ -132,7 +132,7 @@ export declare class AVLTreeCounter<K = any, V = any, R extends object = object>
|
|
|
132
132
|
* @param [thisArg] - Value for `this` inside the callback.
|
|
133
133
|
* @returns A new AVLTreeCounter with mapped entries.
|
|
134
134
|
*/
|
|
135
|
-
map<MK = K, MV = V, MR
|
|
135
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): AVLTreeCounter<MK, MV, MR>;
|
|
136
136
|
/**
|
|
137
137
|
* (Protected) Create an empty instance of the same concrete class.
|
|
138
138
|
* @remarks Time O(1), Space O(1)
|
|
@@ -142,7 +142,7 @@ export declare class AVLTreeCounter<K = any, V = any, R extends object = object>
|
|
|
142
142
|
* @param [options] - Optional constructor options for the like-kind instance.
|
|
143
143
|
* @returns An empty like-kind instance.
|
|
144
144
|
*/
|
|
145
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
145
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<AVLTreeCounterOptions<TK, TV, TR>>): this;
|
|
146
146
|
/**
|
|
147
147
|
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
148
148
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -153,7 +153,7 @@ export declare class AVLTreeCounter<K = any, V = any, R extends object = object>
|
|
|
153
153
|
* @param [options] - Options merged with the current snapshot.
|
|
154
154
|
* @returns A like-kind AVLTreeCounter built from the iterable.
|
|
155
155
|
*/
|
|
156
|
-
protected _createLike<TK = K, TV = V, TR
|
|
156
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | AVLTreeCounterNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<AVLTreeCounterOptions<TK, TV, TR>>): AVLTreeCounter<TK, TV, TR>;
|
|
157
157
|
/**
|
|
158
158
|
* (Protected) Normalize input into a node plus its effective value and count.
|
|
159
159
|
* @remarks Time O(1), Space O(1)
|
|
@@ -60,7 +60,7 @@ export declare class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K
|
|
|
60
60
|
* @template V
|
|
61
61
|
* @template R
|
|
62
62
|
*/
|
|
63
|
-
export declare class AVLTreeMultiMap<K = any, V = any, R
|
|
63
|
+
export declare class AVLTreeMultiMap<K = any, V = any, R = any> extends AVLTree<K, V[], R> implements IBinaryTree<K, V[], R> {
|
|
64
64
|
/**
|
|
65
65
|
* Create an AVLTreeMultiMap and optionally bulk-insert items.
|
|
66
66
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -98,7 +98,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R extends object = object
|
|
|
98
98
|
* @param [thisArg] - Value for `this` inside the callback.
|
|
99
99
|
* @returns A new AVLTreeMultiMap when mapping to array values; see overloads.
|
|
100
100
|
*/
|
|
101
|
-
map<MK = K, MVArr extends unknown[] = V[], MR
|
|
101
|
+
map<MK = K, MVArr extends unknown[] = V[], MR = any>(callback: EntryCallback<K, V[] | undefined, [MK, MVArr]>, options?: Partial<AVLTreeOptions<MK, MVArr, MR>>, thisArg?: unknown): AVLTreeMultiMap<MK, ElemOf<MVArr>, MR>;
|
|
102
102
|
/**
|
|
103
103
|
* Create a new tree by mapping each [key, values] bucket.
|
|
104
104
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -110,7 +110,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R extends object = object
|
|
|
110
110
|
* @param [thisArg] - Value for `this` inside the callback.
|
|
111
111
|
* @returns A new AVLTree when mapping to non-array values; see overloads.
|
|
112
112
|
*/
|
|
113
|
-
map<MK = K, MV = V[], MR
|
|
113
|
+
map<MK = K, MV = V[], MR = any>(callback: EntryCallback<K, V[] | undefined, [MK, MV]>, options?: Partial<AVLTreeOptions<MK, MV, MR>>, thisArg?: unknown): AVLTree<MK, MV, MR>;
|
|
114
114
|
/**
|
|
115
115
|
* (Protected) Create an empty instance of the same concrete class.
|
|
116
116
|
* @remarks Time O(1), Space O(1)
|
|
@@ -120,7 +120,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R extends object = object
|
|
|
120
120
|
* @param [options] - Optional constructor options for the like-kind instance.
|
|
121
121
|
* @returns An empty like-kind instance.
|
|
122
122
|
*/
|
|
123
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
123
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<AVLTreeOptions<TK, TV, TR>>): this;
|
|
124
124
|
/**
|
|
125
125
|
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
126
126
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -131,5 +131,5 @@ export declare class AVLTreeMultiMap<K = any, V = any, R extends object = object
|
|
|
131
131
|
* @param [options] - Options merged with the current snapshot.
|
|
132
132
|
* @returns A like-kind AVLTree built from the iterable.
|
|
133
133
|
*/
|
|
134
|
-
protected _createLike<TK = K, TV = V, TR
|
|
134
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | AVLTreeNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<AVLTreeOptions<TK, TV, TR>>): AVLTree<TK, TV, TR>;
|
|
135
135
|
}
|
|
@@ -136,7 +136,7 @@ export declare class AVLTreeNode<K = any, V = any> extends BSTNode<K, V> {
|
|
|
136
136
|
* // { minute: 15, temperature: 58.6 }
|
|
137
137
|
* // ]
|
|
138
138
|
*/
|
|
139
|
-
export declare class AVLTree<K = any, V = any, R
|
|
139
|
+
export declare class AVLTree<K = any, V = any, R = any> extends BST<K, V, R> implements IBinaryTree<K, V, R> {
|
|
140
140
|
/**
|
|
141
141
|
* Creates an instance of AVLTree.
|
|
142
142
|
* @remarks Time O(N log N) (from `addMany` with balanced add). Space O(N).
|
|
@@ -200,7 +200,7 @@ export declare class AVLTree<K = any, V = any, R extends object = object> extend
|
|
|
200
200
|
* @param [thisArg] - `this` context for the callback.
|
|
201
201
|
* @returns A new, mapped AVLTree.
|
|
202
202
|
*/
|
|
203
|
-
map<MK = K, MV = V, MR
|
|
203
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): AVLTree<MK, MV, MR>;
|
|
204
204
|
/**
|
|
205
205
|
* (Protected) Creates a new, empty instance of the same AVLTree constructor.
|
|
206
206
|
* @remarks Time O(1)
|
|
@@ -209,7 +209,7 @@ export declare class AVLTree<K = any, V = any, R extends object = object> extend
|
|
|
209
209
|
* @param [options] - Options for the new tree.
|
|
210
210
|
* @returns A new, empty tree.
|
|
211
211
|
*/
|
|
212
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
212
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<BSTOptions<TK, TV, TR>>): this;
|
|
213
213
|
/**
|
|
214
214
|
* (Protected) Creates a new instance of the same AVLTree constructor, potentially with different generic types.
|
|
215
215
|
* @remarks Time O(N log N) (from constructor) due to processing the iterable.
|
|
@@ -219,7 +219,7 @@ export declare class AVLTree<K = any, V = any, R extends object = object> extend
|
|
|
219
219
|
* @param [options] - Options for the new tree.
|
|
220
220
|
* @returns A new AVLTree.
|
|
221
221
|
*/
|
|
222
|
-
protected _createLike<TK = K, TV = V, TR
|
|
222
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | BSTNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<BSTOptions<TK, TV, TR>>): AVLTree<TK, TV, TR>;
|
|
223
223
|
/**
|
|
224
224
|
* (Protected) Swaps properties of two nodes, including height.
|
|
225
225
|
* @remarks Time O(H) (due to `ensureNode`), but O(1) if nodes are passed directly.
|
|
@@ -186,7 +186,7 @@ export declare class BinaryTreeNode<K = any, V = any> {
|
|
|
186
186
|
*
|
|
187
187
|
* console.log(evaluate(expressionTree.root)); // -27
|
|
188
188
|
*/
|
|
189
|
-
export declare class BinaryTree<K = any, V = any, R
|
|
189
|
+
export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntryBase<K, V | undefined> implements IBinaryTree<K, V, R> {
|
|
190
190
|
iterationType: IterationType;
|
|
191
191
|
/**
|
|
192
192
|
* Creates an instance of BinaryTree.
|
|
@@ -596,7 +596,7 @@ export declare class BinaryTree<K = any, V = any, R extends object = object> ext
|
|
|
596
596
|
* @param [thisArg] - `this` context for the callback.
|
|
597
597
|
* @returns A new, mapped tree.
|
|
598
598
|
*/
|
|
599
|
-
map<MK = K, MV = V, MR
|
|
599
|
+
map<MK = K, MV = V, MR = any>(cb: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): BinaryTree<MK, MV, MR>;
|
|
600
600
|
/**
|
|
601
601
|
* Generates a string representation of the tree for visualization.
|
|
602
602
|
* @remarks Time O(N), visits every node. Space O(N*H) or O(N^2) in the worst case, as the string width can grow significantly.
|
|
@@ -638,7 +638,7 @@ export declare class BinaryTree<K = any, V = any, R extends object = object> ext
|
|
|
638
638
|
* @template TK, TV, TR - Generic types for the options.
|
|
639
639
|
* @returns The options object.
|
|
640
640
|
*/
|
|
641
|
-
protected _snapshotOptions<TK = K, TV = V, TR
|
|
641
|
+
protected _snapshotOptions<TK = K, TV = V, TR = R>(): BinaryTreeOptions<TK, TV, TR>;
|
|
642
642
|
/**
|
|
643
643
|
* (Protected) Creates a new, empty instance of the same tree constructor.
|
|
644
644
|
* @remarks Time O(1)
|
|
@@ -647,7 +647,7 @@ export declare class BinaryTree<K = any, V = any, R extends object = object> ext
|
|
|
647
647
|
* @param [options] - Options for the new tree.
|
|
648
648
|
* @returns A new, empty tree.
|
|
649
649
|
*/
|
|
650
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
650
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<BinaryTreeOptions<TK, TV, TR>>): this;
|
|
651
651
|
/**
|
|
652
652
|
* (Protected) Creates a new instance of the same tree constructor, potentially with different generic types.
|
|
653
653
|
* @remarks Time O(N) (or as per constructor) due to processing the iterable.
|
|
@@ -657,7 +657,7 @@ export declare class BinaryTree<K = any, V = any, R extends object = object> ext
|
|
|
657
657
|
* @param [options] - Options for the new tree.
|
|
658
658
|
* @returns A new tree.
|
|
659
659
|
*/
|
|
660
|
-
protected _createLike<TK = K, TV = V, TR
|
|
660
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | BinaryTreeNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<BinaryTreeOptions<TK, TV, TR>>): BinaryTree<TK, TV, TR>;
|
|
661
661
|
/**
|
|
662
662
|
* (Protected) Converts a key, node, or entry into a standardized [node, value] tuple.
|
|
663
663
|
* @remarks Time O(1)
|
|
@@ -127,7 +127,7 @@ export declare class BSTNode<K = any, V = any> extends BinaryTreeNode<K, V> {
|
|
|
127
127
|
* console.log(findLCA(5, 35)); // 15
|
|
128
128
|
* console.log(findLCA(20, 30)); // 25
|
|
129
129
|
*/
|
|
130
|
-
export declare class BST<K = any, V = any, R
|
|
130
|
+
export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implements IBinaryTree<K, V, R> {
|
|
131
131
|
/**
|
|
132
132
|
* Creates an instance of BST.
|
|
133
133
|
* @remarks Time O(N log N) or O(N^2) depending on `isBalanceAdd` in `addMany` and input order. Space O(N).
|
|
@@ -341,7 +341,7 @@ export declare class BST<K = any, V = any, R extends object = object> extends Bi
|
|
|
341
341
|
* @param [thisArg] - `this` context for the callback.
|
|
342
342
|
* @returns A new, mapped BST.
|
|
343
343
|
*/
|
|
344
|
-
map<MK = K, MV = V, MR
|
|
344
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): BST<MK, MV, MR>;
|
|
345
345
|
/**
|
|
346
346
|
* Deletes the first node found that satisfies the predicate.
|
|
347
347
|
* @remarks Performs an in-order traversal. Time O(N) worst-case (O(log N) to find + O(log N) to delete). Space O(log N) for stack.
|
|
@@ -358,7 +358,7 @@ export declare class BST<K = any, V = any, R extends object = object> extends Bi
|
|
|
358
358
|
* @param [options] - Options for the new BST.
|
|
359
359
|
* @returns A new, empty BST.
|
|
360
360
|
*/
|
|
361
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
361
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<BSTOptions<TK, TV, TR>>): this;
|
|
362
362
|
/**
|
|
363
363
|
* (Protected) Creates a new instance of the same BST constructor, potentially with different generic types.
|
|
364
364
|
* @remarks Time O(N log N) or O(N^2) (from constructor) due to processing the iterable.
|
|
@@ -368,7 +368,7 @@ export declare class BST<K = any, V = any, R extends object = object> extends Bi
|
|
|
368
368
|
* @param [options] - Options for the new BST.
|
|
369
369
|
* @returns A new BST.
|
|
370
370
|
*/
|
|
371
|
-
protected _createLike<TK = K, TV = V, TR
|
|
371
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | BSTNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<BSTOptions<TK, TV, TR>>): BST<TK, TV, TR>;
|
|
372
372
|
/**
|
|
373
373
|
* (Protected) Snapshots the current BST's configuration options.
|
|
374
374
|
* @remarks Time O(1)
|
|
@@ -376,7 +376,7 @@ export declare class BST<K = any, V = any, R extends object = object> extends Bi
|
|
|
376
376
|
* @template TK, TV, TR - Generic types for the options.
|
|
377
377
|
* @returns The options object.
|
|
378
378
|
*/
|
|
379
|
-
protected _snapshotOptions<TK = K, TV = V, TR
|
|
379
|
+
protected _snapshotOptions<TK = K, TV = V, TR = R>(): BSTOptions<TK, TV, TR>;
|
|
380
380
|
/**
|
|
381
381
|
* (Protected) Converts a key, node, or entry into a standardized [node, value] tuple.
|
|
382
382
|
* @remarks Time O(1)
|
|
@@ -49,7 +49,7 @@ export declare class RedBlackTreeNode<K = any, V = any> extends BSTNode<K, V> {
|
|
|
49
49
|
set right(v: RedBlackTreeNode<K, V> | null | undefined);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* RRRRRRRRRRRRRRRRRRed-Black Tree (self-balancing BST) supporting map-like mode and stable O(log n) updates.
|
|
53
53
|
* @remarks Time O(1), Space O(1)
|
|
54
54
|
* @template K
|
|
55
55
|
* @template V
|
|
@@ -100,7 +100,7 @@ export declare class RedBlackTreeNode<K = any, V = any> extends BSTNode<K, V> {
|
|
|
100
100
|
* );
|
|
101
101
|
* console.log(stocksInRange); // ['GOOGL', 'META', 'MSFT']
|
|
102
102
|
*/
|
|
103
|
-
export declare class RedBlackTree<K = any, V = any, R
|
|
103
|
+
export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implements IBinaryTree<K, V, R> {
|
|
104
104
|
constructor(keysNodesEntriesOrRaws?: Iterable<K | RedBlackTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, options?: RedBlackTreeOptions<K, V, R>);
|
|
105
105
|
protected _root: RedBlackTreeNode<K, V> | undefined;
|
|
106
106
|
/**
|
|
@@ -157,9 +157,9 @@ export declare class RedBlackTree<K = any, V = any, R extends object = object> e
|
|
|
157
157
|
* @param [thisArg] - See parameter type for details.
|
|
158
158
|
* @returns A new RedBlackTree with mapped entries.
|
|
159
159
|
*/
|
|
160
|
-
map<MK = K, MV = V, MR
|
|
161
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
162
|
-
protected _createLike<TK = K, TV = V, TR
|
|
160
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): RedBlackTree<MK, MV, MR>;
|
|
161
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): this;
|
|
162
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | RedBlackTreeNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): RedBlackTree<TK, TV, TR>;
|
|
163
163
|
protected _setRoot(v: RedBlackTreeNode<K, V> | undefined): void;
|
|
164
164
|
protected _replaceNode(oldNode: RedBlackTreeNode<K, V>, newNode: RedBlackTreeNode<K, V>): RedBlackTreeNode<K, V>;
|
|
165
165
|
/**
|
|
@@ -64,7 +64,7 @@ export declare class TreeCounterNode<K = any, V = any> extends RedBlackTreeNode<
|
|
|
64
64
|
* @template V
|
|
65
65
|
* @template R
|
|
66
66
|
*/
|
|
67
|
-
export declare class TreeCounter<K = any, V = any, R
|
|
67
|
+
export declare class TreeCounter<K = any, V = any, R = any> extends RedBlackTree<K, V, R> implements IBinaryTree<K, V, R> {
|
|
68
68
|
/**
|
|
69
69
|
* Create a TreeCounter and optionally bulk-insert items.
|
|
70
70
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -134,7 +134,7 @@ export declare class TreeCounter<K = any, V = any, R extends object = object> ex
|
|
|
134
134
|
* @param [thisArg] - Value for `this` inside the callback.
|
|
135
135
|
* @returns A new TreeCounter with mapped entries.
|
|
136
136
|
*/
|
|
137
|
-
map<MK = K, MV = V, MR
|
|
137
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): TreeCounter<MK, MV, MR>;
|
|
138
138
|
/**
|
|
139
139
|
* Deep copy this tree, preserving map mode and aggregate counts.
|
|
140
140
|
* @remarks Time O(N), Space O(N)
|
|
@@ -150,7 +150,7 @@ export declare class TreeCounter<K = any, V = any, R extends object = object> ex
|
|
|
150
150
|
* @param [options] - Optional constructor options for the like-kind instance.
|
|
151
151
|
* @returns An empty like-kind instance.
|
|
152
152
|
*/
|
|
153
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
153
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<BSTOptions<TK, TV, TR>>): this;
|
|
154
154
|
/**
|
|
155
155
|
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
156
156
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -161,7 +161,7 @@ export declare class TreeCounter<K = any, V = any, R extends object = object> ex
|
|
|
161
161
|
* @param [options] - Options merged with the current snapshot.
|
|
162
162
|
* @returns A like-kind TreeCounter built from the iterable.
|
|
163
163
|
*/
|
|
164
|
-
protected _createLike<TK = K, TV = V, TR
|
|
164
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | BSTNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<BSTOptions<TK, TV, TR>>): TreeCounter<TK, TV, TR>;
|
|
165
165
|
/**
|
|
166
166
|
* (Protected) Normalize input into a node plus its effective value and count.
|
|
167
167
|
* @remarks Time O(1), Space O(1)
|
|
@@ -224,7 +224,7 @@ export declare class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode
|
|
|
224
224
|
* // ]
|
|
225
225
|
* // ]
|
|
226
226
|
*/
|
|
227
|
-
export declare class TreeMultiMap<K = any, V = any, R
|
|
227
|
+
export declare class TreeMultiMap<K = any, V = any, R = any> extends RedBlackTree<K, V[], R> implements IBinaryTree<K, V[], R> {
|
|
228
228
|
/**
|
|
229
229
|
* Create a TreeMultiMap and optionally bulk-insert items.
|
|
230
230
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -244,8 +244,8 @@ export declare class TreeMultiMap<K = any, V = any, R extends object = object> e
|
|
|
244
244
|
* @returns True if the value was removed; false if not found.
|
|
245
245
|
*/
|
|
246
246
|
deleteValue(keyNodeOrEntry: K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined, value: V): boolean;
|
|
247
|
-
map<MK = K, MVArr extends unknown[] = V[], MR
|
|
248
|
-
map<MK = K, MV = V[], MR
|
|
247
|
+
map<MK = K, MVArr extends unknown[] = V[], MR = any>(callback: EntryCallback<K, V[] | undefined, [MK, MVArr]>, options?: Partial<RedBlackTreeOptions<MK, MVArr, MR>>, thisArg?: unknown): TreeMultiMap<MK, ElemOf<MVArr>, MR>;
|
|
248
|
+
map<MK = K, MV = V[], MR = any>(callback: EntryCallback<K, V[] | undefined, [MK, MV]>, options?: Partial<RedBlackTreeOptions<MK, MV, MR>>, thisArg?: unknown): RedBlackTree<MK, MV, MR>;
|
|
249
249
|
/**
|
|
250
250
|
* (Protected) Create an empty instance of the same concrete class.
|
|
251
251
|
* @remarks Time O(1), Space O(1)
|
|
@@ -255,7 +255,7 @@ export declare class TreeMultiMap<K = any, V = any, R extends object = object> e
|
|
|
255
255
|
* @param [options] - Optional constructor options for the like-kind instance.
|
|
256
256
|
* @returns An empty like-kind instance.
|
|
257
257
|
*/
|
|
258
|
-
protected _createInstance<TK = K, TV = V, TR
|
|
258
|
+
protected _createInstance<TK = K, TV = V, TR = R>(options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): this;
|
|
259
259
|
/**
|
|
260
260
|
* (Protected) Create a like-kind instance and seed it from an iterable.
|
|
261
261
|
* @remarks Time O(N log N), Space O(N)
|
|
@@ -266,5 +266,5 @@ export declare class TreeMultiMap<K = any, V = any, R extends object = object> e
|
|
|
266
266
|
* @param [options] - Options merged with the current snapshot.
|
|
267
267
|
* @returns A like-kind RedBlackTree built from the iterable.
|
|
268
268
|
*/
|
|
269
|
-
protected _createLike<TK = K, TV = V, TR
|
|
269
|
+
protected _createLike<TK = K, TV = V, TR = R>(iter?: Iterable<TK | RedBlackTreeNode<TK, TV> | [TK | null | undefined, TV | undefined] | null | undefined | TR>, options?: Partial<RedBlackTreeOptions<TK, TV, TR>>): RedBlackTree<TK, TV, TR>;
|
|
270
270
|
}
|
|
@@ -5,7 +5,7 @@ import type { BinaryTreeDeleteResult, BinaryTreeOptions, BTNRep, DFSOrderPattern
|
|
|
5
5
|
* K = key, V = value, R = raw/record used with toEntryFn (optional).
|
|
6
6
|
* Transforming methods like `map` use method-level generics MK/MV/MR.
|
|
7
7
|
*/
|
|
8
|
-
export interface IBinaryTree<K = any, V = any, R
|
|
8
|
+
export interface IBinaryTree<K = any, V = any, R = any> {
|
|
9
9
|
readonly size: number;
|
|
10
10
|
readonly root: BinaryTreeNode<K, V> | null | undefined;
|
|
11
11
|
readonly isMapMode: boolean;
|
|
@@ -53,7 +53,7 @@ export interface IBinaryTree<K = any, V = any, R extends object = object> {
|
|
|
53
53
|
search<C extends NodeCallback<BinaryTreeNode<K, V> | null>>(keyNodeEntryOrPredicate: K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | NodePredicate<BinaryTreeNode<K, V> | null>, onlyOne?: boolean, callback?: C, startNode?: K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, iterationType?: IterationType): ReturnType<C>[];
|
|
54
54
|
clone(): this;
|
|
55
55
|
filter(predicate: EntryCallback<K, V | undefined, boolean>, thisArg?: unknown): this;
|
|
56
|
-
map<MK = K, MV = V, MR
|
|
56
|
+
map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): IBinaryTree<MK, MV, MR>;
|
|
57
57
|
merge(anotherTree: IBinaryTree<K, V, R>): void;
|
|
58
58
|
refill(keysNodesEntriesOrRaws: Iterable<K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, values?: Iterable<V | undefined>): void;
|
|
59
59
|
}
|
|
@@ -8,7 +8,7 @@ var dataStructureTyped = (() => {
|
|
|
8
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
11
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
12
12
|
var __typeError = (msg) => {
|
|
13
13
|
throw TypeError(msg);
|
|
14
14
|
};
|
|
@@ -677,7 +677,7 @@ var dataStructureTyped = (() => {
|
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
679
|
function makeAsyncTrampoline(fn) {
|
|
680
|
-
return (...args) => __async(
|
|
680
|
+
return (...args) => __async(null, null, function* () {
|
|
681
681
|
return asyncTrampoline(fn(...args));
|
|
682
682
|
});
|
|
683
683
|
}
|
|
@@ -7562,8 +7562,8 @@ var dataStructureTyped = (() => {
|
|
|
7562
7562
|
* @returns True if it's a valid BST, false otherwise.
|
|
7563
7563
|
*/
|
|
7564
7564
|
isBST(startNode = this._root, iterationType = this.iterationType) {
|
|
7565
|
-
|
|
7566
|
-
if (!
|
|
7565
|
+
const startNodeSired = this.ensureNode(startNode);
|
|
7566
|
+
if (!startNodeSired) return true;
|
|
7567
7567
|
if (iterationType === "RECURSIVE") {
|
|
7568
7568
|
const dfs = (cur, min, max) => {
|
|
7569
7569
|
if (!this.isRealNode(cur)) return true;
|
|
@@ -7571,14 +7571,14 @@ var dataStructureTyped = (() => {
|
|
|
7571
7571
|
if (numKey <= min || numKey >= max) return false;
|
|
7572
7572
|
return dfs(cur.left, min, numKey) && dfs(cur.right, numKey, max);
|
|
7573
7573
|
};
|
|
7574
|
-
const isStandardBST = dfs(
|
|
7575
|
-
const isInverseBST = dfs(
|
|
7574
|
+
const isStandardBST = dfs(startNodeSired, Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
7575
|
+
const isInverseBST = dfs(startNodeSired, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
|
7576
7576
|
return isStandardBST || isInverseBST;
|
|
7577
7577
|
} else {
|
|
7578
7578
|
const checkBST = (checkMax = false) => {
|
|
7579
7579
|
const stack = [];
|
|
7580
7580
|
let prev = checkMax ? Number.MAX_SAFE_INTEGER : Number.MIN_SAFE_INTEGER;
|
|
7581
|
-
let curr =
|
|
7581
|
+
let curr = startNodeSired;
|
|
7582
7582
|
while (this.isRealNode(curr) || stack.length > 0) {
|
|
7583
7583
|
while (this.isRealNode(curr)) {
|
|
7584
7584
|
stack.push(curr);
|
|
@@ -7727,22 +7727,22 @@ var dataStructureTyped = (() => {
|
|
|
7727
7727
|
*/
|
|
7728
7728
|
getLeftMost(callback = this._DEFAULT_NODE_CALLBACK, startNode = this._root, iterationType = this.iterationType) {
|
|
7729
7729
|
if (this.isNIL(startNode)) return callback(void 0);
|
|
7730
|
-
|
|
7731
|
-
if (!this.isRealNode(
|
|
7730
|
+
const ensuredStartNode = this.ensureNode(startNode);
|
|
7731
|
+
if (!this.isRealNode(ensuredStartNode)) return callback(void 0);
|
|
7732
7732
|
if (iterationType === "RECURSIVE") {
|
|
7733
7733
|
const dfs = (cur) => {
|
|
7734
7734
|
const { left } = cur;
|
|
7735
7735
|
if (!this.isRealNode(left)) return cur;
|
|
7736
7736
|
return dfs(left);
|
|
7737
7737
|
};
|
|
7738
|
-
return callback(dfs(
|
|
7738
|
+
return callback(dfs(ensuredStartNode));
|
|
7739
7739
|
} else {
|
|
7740
7740
|
const dfs = makeTrampoline((cur) => {
|
|
7741
7741
|
const { left } = cur;
|
|
7742
7742
|
if (!this.isRealNode(left)) return cur;
|
|
7743
7743
|
return makeTrampolineThunk(() => dfs(left));
|
|
7744
7744
|
});
|
|
7745
|
-
return callback(dfs(
|
|
7745
|
+
return callback(dfs(ensuredStartNode));
|
|
7746
7746
|
}
|
|
7747
7747
|
}
|
|
7748
7748
|
/**
|
|
@@ -13020,3 +13020,4 @@ var dataStructureTyped = (() => {
|
|
|
13020
13020
|
* @copyright Copyright (c) 2022 Kirk Qi <qilinaus@gmail.com>
|
|
13021
13021
|
* @license MIT License
|
|
13022
13022
|
*/
|
|
13023
|
+
//# sourceMappingURL=data-structure-typed.js.map
|