data-structure-typed 2.1.0 → 2.1.2
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 +21 -38
- 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/{cjs → types}/data-structures/binary-tree/avl-tree-counter.d.ts +5 -5
- package/dist/{esm → types}/data-structures/binary-tree/avl-tree-multi-map.d.ts +6 -6
- package/dist/{esm → types}/data-structures/binary-tree/avl-tree.d.ts +5 -5
- package/dist/{esm → types}/data-structures/binary-tree/binary-tree.d.ts +6 -6
- package/dist/{esm → types}/data-structures/binary-tree/bst.d.ts +6 -6
- package/dist/{esm → types}/data-structures/binary-tree/red-black-tree.d.ts +6 -6
- package/dist/{cjs → types}/data-structures/binary-tree/tree-counter.d.ts +5 -5
- package/dist/{cjs → types}/data-structures/binary-tree/tree-multi-map.d.ts +6 -6
- package/dist/{esm → types}/data-structures/heap/heap.d.ts +4 -4
- package/dist/{esm → types}/data-structures/linked-list/singly-linked-list.d.ts +1 -1
- package/dist/{esm → types}/interfaces/binary-tree.d.ts +3 -3
- package/dist/umd/data-structure-typed.js +97 -174
- 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 +8 -1
- package/package.json +20 -14
- package/src/data-structures/binary-tree/avl-tree-counter.ts +8 -11
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +6 -11
- package/src/data-structures/binary-tree/avl-tree.ts +6 -8
- package/src/data-structures/binary-tree/binary-tree.ts +18 -20
- package/src/data-structures/binary-tree/bst.ts +6 -11
- package/src/data-structures/binary-tree/red-black-tree.ts +6 -11
- package/src/data-structures/binary-tree/tree-counter.ts +8 -13
- package/src/data-structures/binary-tree/tree-multi-map.ts +6 -11
- package/src/data-structures/heap/heap.ts +5 -5
- package/src/data-structures/linked-list/singly-linked-list.ts +2 -2
- package/src/interfaces/binary-tree.ts +3 -3
- package/test/integration/all-in-one.test.ts +1 -1
- package/test/integration/compile.test.mjs +159 -0
- package/test/integration/compile.test.ts +176 -0
- package/test/integration/heap.test.js +1 -1
- package/test/integration/index.html +1 -1
- package/test/performance/data-structures/comparison/comparison.test.ts +27 -57
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +109 -1
- package/tsconfig.base.json +23 -0
- package/tsconfig.test.json +9 -0
- package/tsconfig.types.json +15 -0
- package/tsup.config.js +12 -24
- package/tsup.node.config.js +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.d.ts +0 -503
- 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.d.ts +0 -451
- 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.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.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/test/integration/compile.js +0 -144
- package/test/integration/compile.mjs +0 -135
- package/test/integration/compile.ts +0 -171
- package/tsconfig-base.json +0 -24
- 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/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/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)
|
|
@@ -78,7 +78,7 @@ export declare class AVLTreeCounter<K = any, V = any, R extends object = object>
|
|
|
78
78
|
* @returns Total count recomputed from nodes.
|
|
79
79
|
*/
|
|
80
80
|
getComputedCount(): number;
|
|
81
|
-
|
|
81
|
+
createNode(key: K, value?: V, count?: number): AVLTreeCounterNode<K, V>;
|
|
82
82
|
/**
|
|
83
83
|
* Type guard: check whether the input is an AVLTreeCounterNode.
|
|
84
84
|
* @remarks Time O(1), Space O(1)
|
|
@@ -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)
|
|
@@ -69,7 +69,7 @@ export declare class AVLTreeMultiMap<K = any, V = any, R extends object = object
|
|
|
69
69
|
* @returns New AVLTreeMultiMap instance.
|
|
70
70
|
*/
|
|
71
71
|
constructor(keysNodesEntriesOrRaws?: Iterable<K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | R>, options?: AVLTreeMultiMapOptions<K, V[], R>);
|
|
72
|
-
|
|
72
|
+
createNode(key: K, value?: V[]): AVLTreeMultiMapNode<K, V>;
|
|
73
73
|
add(keyNodeOrEntry: K | AVLTreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined): boolean;
|
|
74
74
|
add(key: K, value: V): boolean;
|
|
75
75
|
/**
|
|
@@ -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).
|
|
@@ -153,7 +153,7 @@ export declare class AVLTree<K = any, V = any, R extends object = object> extend
|
|
|
153
153
|
* @param [value] - The value for the new node.
|
|
154
154
|
* @returns The newly created AVLTreeNode.
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
createNode(key: K, value?: V): AVLTreeNode<K, V>;
|
|
157
157
|
/**
|
|
158
158
|
* Checks if the given item is an `AVLTreeNode` instance.
|
|
159
159
|
* @remarks Time O(1), Space O(1)
|
|
@@ -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.
|
|
@@ -260,7 +260,7 @@ export declare class BinaryTree<K = any, V = any, R extends object = object> ext
|
|
|
260
260
|
* @param [value] - The value for the new node (used if not in Map mode).
|
|
261
261
|
* @returns The newly created node.
|
|
262
262
|
*/
|
|
263
|
-
|
|
263
|
+
createNode(key: K, value?: V): BinaryTreeNode<K, V>;
|
|
264
264
|
/**
|
|
265
265
|
* Creates a new, empty tree of the same type and configuration.
|
|
266
266
|
* @remarks Time O(1) (excluding options cloning), Space O(1)
|
|
@@ -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).
|
|
@@ -180,7 +180,7 @@ export declare class BST<K = any, V = any, R extends object = object> extends Bi
|
|
|
180
180
|
* @param [value] - The value for the new node (used if not in Map mode).
|
|
181
181
|
* @returns The newly created BSTNode.
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
createNode(key: K, value?: V): BSTNode<K, V>;
|
|
184
184
|
/**
|
|
185
185
|
* Ensures the input is a node. If it's a key or entry, it searches for the node.
|
|
186
186
|
* @remarks Time O(log N) (height of the tree), O(N) worst-case.
|
|
@@ -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
|
+
* Represents a Red-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
|
/**
|
|
@@ -117,7 +117,7 @@ export declare class RedBlackTree<K = any, V = any, R extends object = object> e
|
|
|
117
117
|
* @param color - See parameter type for details.
|
|
118
118
|
* @returns A new RedBlackTreeNode instance.
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
createNode(key: K, value?: V, color?: RBTNColor): RedBlackTreeNode<K, V>;
|
|
121
121
|
/**
|
|
122
122
|
* Type guard: check whether the input is a RedBlackTreeNode.
|
|
123
123
|
* @remarks Time O(1), Space O(1)
|
|
@@ -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)
|
|
@@ -86,7 +86,7 @@ export declare class TreeCounter<K = any, V = any, R extends object = object> ex
|
|
|
86
86
|
* @returns Total count recomputed from nodes.
|
|
87
87
|
*/
|
|
88
88
|
getComputedCount(): number;
|
|
89
|
-
|
|
89
|
+
createNode(key: K, value?: V, color?: RBTNColor, count?: number): TreeCounterNode<K, V>;
|
|
90
90
|
/**
|
|
91
91
|
* Type guard: check whether the input is a TreeCounterNode.
|
|
92
92
|
* @remarks Time O(1), Space O(1)
|
|
@@ -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)
|
|
@@ -233,7 +233,7 @@ export declare class TreeMultiMap<K = any, V = any, R extends object = object> e
|
|
|
233
233
|
* @returns New TreeMultiMap instance.
|
|
234
234
|
*/
|
|
235
235
|
constructor(keysNodesEntriesOrRaws?: Iterable<K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined | R>, options?: TreeMultiMapOptions<K, V[], R>);
|
|
236
|
-
|
|
236
|
+
createNode(key: K, value?: V[]): TreeMultiMapNode<K, V>;
|
|
237
237
|
add(keyNodeOrEntry: K | TreeMultiMapNode<K, V> | [K | null | undefined, V[] | undefined] | null | undefined): boolean;
|
|
238
238
|
add(key: K, value: V): boolean;
|
|
239
239
|
/**
|
|
@@ -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
|
}
|
|
@@ -188,7 +188,7 @@ import { IterableElementBase } from '../base';
|
|
|
188
188
|
* ]);
|
|
189
189
|
* console.log(scheduleTasks(tasks, 2)); // expectedMap
|
|
190
190
|
*/
|
|
191
|
-
export declare class Heap<E =
|
|
191
|
+
export declare class Heap<E = any, R = any> extends IterableElementBase<E, R> {
|
|
192
192
|
protected _equals: (a: E, b: E) => boolean;
|
|
193
193
|
/**
|
|
194
194
|
* Create a Heap and optionally bulk-insert elements.
|
|
@@ -227,7 +227,7 @@ export declare class Heap<E = unknown, R = never> extends IterableElementBase<E,
|
|
|
227
227
|
* @param [options] - Heap options including comparator.
|
|
228
228
|
* @returns A new heap instance of this class.
|
|
229
229
|
*/
|
|
230
|
-
static from<T, R =
|
|
230
|
+
static from<T, R = any, S extends Heap<T, R> = Heap<T, R>>(this: new (elements?: Iterable<T | R>, options?: HeapOptions<T, R>) => S, elements?: Iterable<T | R>, options?: HeapOptions<T, R>): S;
|
|
231
231
|
/**
|
|
232
232
|
* Build a Heap from an iterable in linear time given a comparator.
|
|
233
233
|
* @remarks Time O(N), Space O(N)
|
|
@@ -237,7 +237,7 @@ export declare class Heap<E = unknown, R = never> extends IterableElementBase<E,
|
|
|
237
237
|
* @param options - Heap options including comparator.
|
|
238
238
|
* @returns A new Heap built from elements.
|
|
239
239
|
*/
|
|
240
|
-
static heapify<EE =
|
|
240
|
+
static heapify<EE = any, RR = any>(elements: Iterable<EE>, options: HeapOptions<EE, RR>): Heap<EE, RR>;
|
|
241
241
|
/**
|
|
242
242
|
* Insert an element.
|
|
243
243
|
* @remarks Time O(1) amortized, Space O(1)
|
|
@@ -493,7 +493,7 @@ export declare class FibonacciHeap<E> {
|
|
|
493
493
|
* @returns void
|
|
494
494
|
*/
|
|
495
495
|
merge(heapToMerge: FibonacciHeap<E>): void;
|
|
496
|
-
|
|
496
|
+
createNode(element: E): FibonacciHeapNode<E>;
|
|
497
497
|
isEmpty(): boolean;
|
|
498
498
|
protected _defaultComparator(a: E, b: E): number;
|
|
499
499
|
protected mergeWithRoot(node: FibonacciHeapNode<E>): void;
|
|
@@ -375,7 +375,7 @@ export declare class SinglyLinkedList<E = any, R = any> extends LinearLinkedBase
|
|
|
375
375
|
* @param value - Value to wrap in a node.
|
|
376
376
|
* @returns A new SinglyLinkedListNode instance.
|
|
377
377
|
*/
|
|
378
|
-
protected
|
|
378
|
+
protected createNode(value: E): SinglyLinkedListNode<E>;
|
|
379
379
|
/**
|
|
380
380
|
* (Protected) Check if input is a node predicate function.
|
|
381
381
|
* @remarks Time O(1), Space O(1)
|
|
@@ -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;
|
|
@@ -14,7 +14,7 @@ export interface IBinaryTree<K = any, V = any, R extends object = object> {
|
|
|
14
14
|
readonly store: Map<K, V | undefined>;
|
|
15
15
|
readonly toEntryFn?: ToEntryFn<K, V, R>;
|
|
16
16
|
readonly isDuplicate: boolean;
|
|
17
|
-
|
|
17
|
+
createNode(key: K, value?: BinaryTreeNode<K, V>['value']): BinaryTreeNode<K, V>;
|
|
18
18
|
createTree(options?: Partial<BinaryTreeOptions<K, V, R>>): IBinaryTree<K, V, R>;
|
|
19
19
|
add(keyOrNodeOrEntryOrRawElement: BTNRep<K, V, BinaryTreeNode<K, V>>, value?: V, count?: number): boolean;
|
|
20
20
|
addMany(keysNodesEntriesOrRaws: Iterable<K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, values?: Iterable<V | undefined>): 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
|
}
|