data-structure-typed 2.0.5 → 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 +27 -0
- package/README.md +5 -34
- package/benchmark/report.html +13 -77
- package/benchmark/report.json +152 -184
- 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/types/data-structures/base/iterable-element-base.d.ts +219 -0
- package/dist/types/data-structures/base/iterable-entry-base.d.ts +144 -0
- package/dist/types/data-structures/base/linear-base.d.ts +335 -0
- package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +182 -0
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +135 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +291 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +754 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +413 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +208 -0
- package/dist/types/data-structures/binary-tree/tree-counter.d.ts +190 -0
- package/dist/{esm → types}/data-structures/binary-tree/tree-multi-map.d.ts +72 -69
- package/dist/types/data-structures/graph/abstract-graph.d.ts +340 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +207 -0
- package/dist/types/data-structures/graph/map-graph.d.ts +78 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +188 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +345 -0
- package/dist/types/data-structures/heap/heap.d.ts +503 -0
- package/dist/types/data-structures/heap/max-heap.d.ts +32 -0
- package/dist/types/data-structures/heap/min-heap.d.ts +33 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +769 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +451 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +27 -0
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +27 -0
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +26 -0
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +15 -0
- package/dist/types/data-structures/queue/deque.d.ts +431 -0
- package/dist/types/data-structures/queue/queue.d.ts +308 -0
- package/dist/{cjs → types}/data-structures/stack/stack.d.ts +124 -102
- package/dist/types/data-structures/trie/trie.d.ts +350 -0
- package/dist/types/interfaces/binary-tree.d.ts +59 -0
- package/dist/types/interfaces/graph.d.ts +21 -0
- package/dist/{cjs → types}/types/data-structures/base/base.d.ts +1 -1
- package/dist/{esm → types}/types/data-structures/graph/abstract-graph.d.ts +4 -0
- package/dist/{cjs → types}/types/utils/utils.d.ts +1 -0
- package/dist/{esm → types}/utils/utils.d.ts +1 -1
- package/dist/umd/data-structure-typed.js +4693 -6484
- package/dist/umd/data-structure-typed.js.map +1 -0
- package/dist/umd/data-structure-typed.min.js +8 -6
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/jest.integration.config.js +3 -0
- package/package.json +13 -12
- package/src/data-structures/base/iterable-element-base.ts +238 -115
- package/src/data-structures/base/iterable-entry-base.ts +96 -120
- package/src/data-structures/base/linear-base.ts +271 -277
- package/src/data-structures/binary-tree/avl-tree-counter.ts +196 -217
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +188 -102
- package/src/data-structures/binary-tree/avl-tree.ts +237 -206
- package/src/data-structures/binary-tree/binary-tree.ts +665 -896
- package/src/data-structures/binary-tree/bst.ts +565 -572
- package/src/data-structures/binary-tree/red-black-tree.ts +157 -223
- package/src/data-structures/binary-tree/tree-counter.ts +195 -219
- package/src/data-structures/binary-tree/tree-multi-map.ts +127 -98
- package/src/data-structures/graph/abstract-graph.ts +339 -264
- package/src/data-structures/graph/directed-graph.ts +146 -236
- package/src/data-structures/graph/map-graph.ts +63 -60
- package/src/data-structures/graph/undirected-graph.ts +129 -152
- package/src/data-structures/hash/hash-map.ts +274 -496
- package/src/data-structures/heap/heap.ts +389 -402
- package/src/data-structures/heap/max-heap.ts +12 -76
- package/src/data-structures/heap/min-heap.ts +13 -76
- package/src/data-structures/linked-list/doubly-linked-list.ts +426 -530
- package/src/data-structures/linked-list/singly-linked-list.ts +495 -517
- package/src/data-structures/linked-list/skip-linked-list.ts +1 -108
- package/src/data-structures/priority-queue/max-priority-queue.ts +12 -87
- package/src/data-structures/priority-queue/min-priority-queue.ts +11 -88
- package/src/data-structures/priority-queue/priority-queue.ts +3 -92
- package/src/data-structures/queue/deque.ts +381 -357
- package/src/data-structures/queue/queue.ts +310 -264
- package/src/data-structures/stack/stack.ts +217 -131
- package/src/data-structures/trie/trie.ts +240 -175
- package/src/interfaces/binary-tree.ts +240 -6
- package/src/interfaces/graph.ts +37 -0
- package/src/types/data-structures/base/base.ts +5 -5
- package/src/types/data-structures/graph/abstract-graph.ts +5 -0
- package/src/types/utils/utils.ts +2 -0
- package/src/utils/utils.ts +9 -14
- package/test/integration/all-in-one.test.ts +1 -1
- package/test/integration/index.html +1 -1
- package/test/performance/benchmark-runner.ts +528 -0
- package/test/performance/data-structures/comparison/comparison.test.ts +27 -57
- package/test/performance/reportor.mjs +43 -43
- package/test/performance/runner-config.json +39 -0
- package/test/performance/single-suite-runner.ts +69 -0
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +350 -90
- package/test/unit/data-structures/binary-tree/bst.test.ts +12 -9
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +25 -24
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +112 -4
- package/test/unit/data-structures/graph/abstract-graph.test.ts +0 -4
- package/test/unit/data-structures/graph/directed-graph.test.ts +1 -1
- package/test/unit/data-structures/heap/heap.test.ts +14 -21
- package/test/unit/data-structures/heap/max-heap.test.ts +5 -9
- package/test/unit/data-structures/heap/min-heap.test.ts +1 -4
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +14 -14
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -7
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +8 -11
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -4
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +1 -4
- package/test/unit/data-structures/queue/queue.test.ts +4 -5
- package/test/unit/utils/utils.test.ts +0 -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.d.ts +0 -116
- package/dist/cjs/data-structures/base/iterable-element-base.js +0 -202
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +0 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.d.ts +0 -168
- package/dist/cjs/data-structures/base/iterable-entry-base.js +0 -241
- package/dist/cjs/data-structures/base/iterable-entry-base.js.map +0 -1
- package/dist/cjs/data-structures/base/linear-base.d.ts +0 -277
- package/dist/cjs/data-structures/base/linear-base.js +0 -553
- package/dist/cjs/data-structures/base/linear-base.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.d.ts +0 -214
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +0 -409
- 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 -104
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +0 -203
- 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 -302
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +0 -599
- 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 -910
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +0 -2197
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +0 -461
- package/dist/cjs/data-structures/binary-tree/bst.js +0 -880
- 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 -280
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +0 -642
- 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.d.ts +0 -212
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +0 -445
- package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +0 -267
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +0 -365
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +0 -335
- package/dist/cjs/data-structures/graph/abstract-graph.js +0 -867
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +0 -323
- package/dist/cjs/data-structures/graph/directed-graph.js +0 -613
- 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.d.ts +0 -84
- package/dist/cjs/data-structures/graph/map-graph.js +0 -111
- package/dist/cjs/data-structures/graph/map-graph.js.map +0 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +0 -231
- package/dist/cjs/data-structures/graph/undirected-graph.js +0 -445
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/cjs/data-structures/hash/hash-map.d.ts +0 -519
- package/dist/cjs/data-structures/hash/hash-map.js +0 -880
- 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 -578
- package/dist/cjs/data-structures/heap/heap.js +0 -911
- 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.d.ts +0 -68
- package/dist/cjs/data-structures/heap/max-heap.js +0 -96
- package/dist/cjs/data-structures/heap/max-heap.js.map +0 -1
- package/dist/cjs/data-structures/heap/min-heap.d.ts +0 -68
- package/dist/cjs/data-structures/heap/min-heap.js +0 -87
- 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.d.ts +0 -885
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +0 -1238
- 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 -500
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +0 -870
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +0 -134
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +0 -245
- 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.d.ts +0 -71
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +0 -102
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +0 -72
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +0 -94
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +0 -74
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +0 -96
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +0 -458
- package/dist/cjs/data-structures/queue/deque.js +0 -919
- 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.d.ts +0 -329
- package/dist/cjs/data-structures/queue/queue.js +0 -457
- 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 -346
- 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.d.ts +0 -351
- package/dist/cjs/data-structures/trie/trie.js +0 -594
- 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 -9
- 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.d.ts +0 -5
- 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.d.ts +0 -10
- 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.d.ts +0 -209
- package/dist/cjs/utils/utils.js +0 -353
- 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 -116
- package/dist/esm/data-structures/base/iterable-element-base.js +0 -199
- 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 -168
- package/dist/esm/data-structures/base/iterable-entry-base.js +0 -237
- package/dist/esm/data-structures/base/iterable-entry-base.js.map +0 -1
- package/dist/esm/data-structures/base/linear-base.d.ts +0 -277
- package/dist/esm/data-structures/base/linear-base.js +0 -549
- 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 -214
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js +0 -410
- 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.d.ts +0 -104
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +0 -205
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/avl-tree.d.ts +0 -302
- package/dist/esm/data-structures/binary-tree/avl-tree.js +0 -601
- 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.d.ts +0 -910
- package/dist/esm/data-structures/binary-tree/binary-tree.js +0 -2198
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/bst.d.ts +0 -461
- package/dist/esm/data-structures/binary-tree/bst.js +0 -881
- 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.d.ts +0 -280
- package/dist/esm/data-structures/binary-tree/red-black-tree.js +0 -641
- 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 -212
- package/dist/esm/data-structures/binary-tree/tree-counter.js +0 -446
- package/dist/esm/data-structures/binary-tree/tree-counter.js.map +0 -1
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +0 -367
- 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 -335
- package/dist/esm/data-structures/graph/abstract-graph.js +0 -862
- package/dist/esm/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/esm/data-structures/graph/directed-graph.d.ts +0 -323
- package/dist/esm/data-structures/graph/directed-graph.js +0 -609
- 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 -84
- package/dist/esm/data-structures/graph/map-graph.js +0 -108
- package/dist/esm/data-structures/graph/map-graph.js.map +0 -1
- package/dist/esm/data-structures/graph/undirected-graph.d.ts +0 -231
- package/dist/esm/data-structures/graph/undirected-graph.js +0 -439
- package/dist/esm/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/esm/data-structures/hash/hash-map.d.ts +0 -519
- package/dist/esm/data-structures/hash/hash-map.js +0 -878
- 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 -578
- package/dist/esm/data-structures/heap/heap.js +0 -914
- 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 -68
- package/dist/esm/data-structures/heap/max-heap.js +0 -95
- package/dist/esm/data-structures/heap/max-heap.js.map +0 -1
- package/dist/esm/data-structures/heap/min-heap.d.ts +0 -68
- package/dist/esm/data-structures/heap/min-heap.js +0 -83
- 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 -885
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js +0 -1236
- 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 -500
- package/dist/esm/data-structures/linked-list/singly-linked-list.js +0 -866
- 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 -134
- package/dist/esm/data-structures/linked-list/skip-linked-list.js +0 -243
- 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 -71
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js +0 -101
- 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 -72
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js +0 -90
- 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 -74
- package/dist/esm/data-structures/priority-queue/priority-queue.js +0 -92
- package/dist/esm/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/esm/data-structures/queue/deque.d.ts +0 -458
- package/dist/esm/data-structures/queue/deque.js +0 -915
- 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 -329
- package/dist/esm/data-structures/queue/queue.js +0 -452
- 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 -284
- package/dist/esm/data-structures/stack/stack.js +0 -342
- 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 -351
- package/dist/esm/data-structures/trie/trie.js +0 -592
- 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.d.ts +0 -9
- 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 -5
- 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.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 -21
- 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.js +0 -324
- package/dist/esm/utils/utils.js.map +0 -1
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +0 -71
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +0 -81
- 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/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/index.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/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/linked-list/index.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/queue/index.d.ts +0 -0
- /package/dist/{cjs → types}/data-structures/stack/index.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}/index.d.ts +0 -0
- /package/dist/{cjs → types}/interfaces/doubly-linked-list.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/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/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/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
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export declare class TreeNode<V = any> {
|
|
2
|
-
/**
|
|
3
|
-
* The constructor function initializes a TreeNode object with a key, optional value, and optional
|
|
4
|
-
* children.
|
|
5
|
-
* @param {string} key - A string representing the key of the tree node.
|
|
6
|
-
* @param {V} [value] - The `value` parameter is an optional parameter of type `V`. It represents the
|
|
7
|
-
* value associated with the node. If no value is provided, it defaults to `undefined`.
|
|
8
|
-
* @param {TreeNode<V>[]} [children] - The `children` parameter is an optional array of `TreeNode<V>`
|
|
9
|
-
* objects. It represents the child nodes of the current node. If no children are provided, the
|
|
10
|
-
* default value is an empty array.
|
|
11
|
-
*/
|
|
12
|
-
constructor(key: string, value?: V, children?: TreeNode<V>[]);
|
|
13
|
-
protected _key: string;
|
|
14
|
-
/**
|
|
15
|
-
* The function returns the value of the protected variable _key.
|
|
16
|
-
* @returns The value of the `_key` property, which is a string.
|
|
17
|
-
*/
|
|
18
|
-
get key(): string;
|
|
19
|
-
/**
|
|
20
|
-
* The above function sets the value of a protected variable called "key".
|
|
21
|
-
* @param {string} value - The value parameter is a string that represents the value to be assigned
|
|
22
|
-
* to the key.
|
|
23
|
-
*/
|
|
24
|
-
set key(value: string);
|
|
25
|
-
protected _value?: V | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* The function returns the value stored in a variable, or undefined if the variable is empty.
|
|
28
|
-
* @returns The value of the variable `_value` is being returned.
|
|
29
|
-
*/
|
|
30
|
-
get value(): V | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* The function sets the value of a variable.
|
|
33
|
-
* @param {V | undefined} value - The parameter "value" is of type "V | undefined", which means it
|
|
34
|
-
* can accept a value of type "V" or it can be undefined.
|
|
35
|
-
*/
|
|
36
|
-
set value(value: V | undefined);
|
|
37
|
-
protected _children?: TreeNode<V>[] | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The function returns an array of TreeNode objects or undefined.
|
|
40
|
-
* @returns The `children` property is being returned. It is of type `TreeNode<V>[] | undefined`,
|
|
41
|
-
* which means it can either be an array of `TreeNode<V>` objects or `undefined`.
|
|
42
|
-
*/
|
|
43
|
-
get children(): TreeNode<V>[] | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* The function sets the value of the children property of a TreeNode object.
|
|
46
|
-
* @param {TreeNode<V>[] | undefined} value - The value parameter is of type TreeNode<V>[] |
|
|
47
|
-
* undefined. This means that it can accept an array of TreeNode objects or undefined.
|
|
48
|
-
*/
|
|
49
|
-
set children(value: TreeNode<V>[] | undefined);
|
|
50
|
-
/**
|
|
51
|
-
* The function `addChildren` adds one or more child nodes to the current node.
|
|
52
|
-
* @param {TreeNode<V> | TreeNode<V>[]} children - The `children` parameter can be either a single
|
|
53
|
-
* `TreeNode<V>` object or an array of `TreeNode<V>` objects.
|
|
54
|
-
*/
|
|
55
|
-
addChildren(children: TreeNode<V> | TreeNode<V>[]): void;
|
|
56
|
-
/**
|
|
57
|
-
* The function `getHeight()` calculates the maximum depth of a tree structure by performing a
|
|
58
|
-
* breadth-first search.
|
|
59
|
-
* @returns the maximum depth or height of the tree.
|
|
60
|
-
*/
|
|
61
|
-
getHeight(): number;
|
|
62
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export class TreeNode {
|
|
2
|
-
/**
|
|
3
|
-
* The constructor function initializes a TreeNode object with a key, optional value, and optional
|
|
4
|
-
* children.
|
|
5
|
-
* @param {string} key - A string representing the key of the tree node.
|
|
6
|
-
* @param {V} [value] - The `value` parameter is an optional parameter of type `V`. It represents the
|
|
7
|
-
* value associated with the node. If no value is provided, it defaults to `undefined`.
|
|
8
|
-
* @param {TreeNode<V>[]} [children] - The `children` parameter is an optional array of `TreeNode<V>`
|
|
9
|
-
* objects. It represents the child nodes of the current node. If no children are provided, the
|
|
10
|
-
* default value is an empty array.
|
|
11
|
-
*/
|
|
12
|
-
constructor(key, value, children) {
|
|
13
|
-
this._key = key;
|
|
14
|
-
this._value = value || undefined;
|
|
15
|
-
if (children)
|
|
16
|
-
this._children = children;
|
|
17
|
-
}
|
|
18
|
-
_key;
|
|
19
|
-
/**
|
|
20
|
-
* The function returns the value of the protected variable _key.
|
|
21
|
-
* @returns The value of the `_key` property, which is a string.
|
|
22
|
-
*/
|
|
23
|
-
get key() {
|
|
24
|
-
return this._key;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The above function sets the value of a protected variable called "key".
|
|
28
|
-
* @param {string} value - The value parameter is a string that represents the value to be assigned
|
|
29
|
-
* to the key.
|
|
30
|
-
*/
|
|
31
|
-
set key(value) {
|
|
32
|
-
this._key = value;
|
|
33
|
-
}
|
|
34
|
-
_value;
|
|
35
|
-
/**
|
|
36
|
-
* The function returns the value stored in a variable, or undefined if the variable is empty.
|
|
37
|
-
* @returns The value of the variable `_value` is being returned.
|
|
38
|
-
*/
|
|
39
|
-
get value() {
|
|
40
|
-
return this._value;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The function sets the value of a variable.
|
|
44
|
-
* @param {V | undefined} value - The parameter "value" is of type "V | undefined", which means it
|
|
45
|
-
* can accept a value of type "V" or it can be undefined.
|
|
46
|
-
*/
|
|
47
|
-
set value(value) {
|
|
48
|
-
this._value = value;
|
|
49
|
-
}
|
|
50
|
-
_children;
|
|
51
|
-
/**
|
|
52
|
-
* The function returns an array of TreeNode objects or undefined.
|
|
53
|
-
* @returns The `children` property is being returned. It is of type `TreeNode<V>[] | undefined`,
|
|
54
|
-
* which means it can either be an array of `TreeNode<V>` objects or `undefined`.
|
|
55
|
-
*/
|
|
56
|
-
get children() {
|
|
57
|
-
return this._children;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* The function sets the value of the children property of a TreeNode object.
|
|
61
|
-
* @param {TreeNode<V>[] | undefined} value - The value parameter is of type TreeNode<V>[] |
|
|
62
|
-
* undefined. This means that it can accept an array of TreeNode objects or undefined.
|
|
63
|
-
*/
|
|
64
|
-
set children(value) {
|
|
65
|
-
this._children = value;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* The function `addChildren` adds one or more child nodes to the current node.
|
|
69
|
-
* @param {TreeNode<V> | TreeNode<V>[]} children - The `children` parameter can be either a single
|
|
70
|
-
* `TreeNode<V>` object or an array of `TreeNode<V>` objects.
|
|
71
|
-
*/
|
|
72
|
-
addChildren(children) {
|
|
73
|
-
if (!this._children) {
|
|
74
|
-
this._children = [];
|
|
75
|
-
}
|
|
76
|
-
if (children instanceof TreeNode) {
|
|
77
|
-
this._children.push(children);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this._children = this._children.concat(children);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* The function `getHeight()` calculates the maximum depth of a tree structure by performing a
|
|
85
|
-
* breadth-first search.
|
|
86
|
-
* @returns the maximum depth or height of the tree.
|
|
87
|
-
*/
|
|
88
|
-
getHeight() {
|
|
89
|
-
let maxDepth = 0;
|
|
90
|
-
if (this) {
|
|
91
|
-
const bfs = (node, level) => {
|
|
92
|
-
if (level > maxDepth) {
|
|
93
|
-
maxDepth = level;
|
|
94
|
-
}
|
|
95
|
-
const { _children } = node;
|
|
96
|
-
if (_children) {
|
|
97
|
-
for (let i = 0, len = _children.length; i < len; i++) {
|
|
98
|
-
bfs(_children[i], level + 1);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
bfs(this, 0);
|
|
103
|
-
}
|
|
104
|
-
return maxDepth;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../../src/data-structures/tree/tree.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;IACnB;;;;;;;;;OASG;IACH,YAAY,GAAW,EAAE,KAAS,EAAE,QAAwB;QAC1D,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,SAAS,CAAC;QACjC,IAAI,QAAQ;YAAE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAES,IAAI,CAAS;IAEvB;;;OAGG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,IAAI,GAAG,CAAC,KAAa;QACnB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAES,MAAM,CAAiB;IAEjC;;;OAGG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK,CAAC,KAAoB;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAES,SAAS,CAA6B;IAEhD;;;;OAIG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,IAAI,QAAQ,CAAC,KAAgC;QAC3C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,QAAqC;QAC/C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,SAAS;QACP,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,GAAG,GAAG,CAAC,IAAiB,EAAE,KAAa,EAAE,EAAE;gBAC/C,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;oBACrB,QAAQ,GAAG,KAAK,CAAC;gBACnB,CAAC;gBACD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;gBAC3B,IAAI,SAAS,EAAE,CAAC;oBACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;wBACrD,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;oBAC/B,CAAC;gBACH,CAAC;YACH,CAAC,CAAC;YACF,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACf,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './trie';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-structures/trie/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* data-structure-typed
|
|
3
|
-
*
|
|
4
|
-
* @author Pablo Zeng
|
|
5
|
-
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
|
-
* @license MIT License
|
|
7
|
-
*/
|
|
8
|
-
import type { ElementCallback, TrieOptions } from '../../types';
|
|
9
|
-
import { IterableElementBase } from '../base';
|
|
10
|
-
export declare class TrieNode {
|
|
11
|
-
constructor(key: string);
|
|
12
|
-
protected _key: string;
|
|
13
|
-
/**
|
|
14
|
-
* The function returns the value of the protected variable _key.
|
|
15
|
-
* @returns The value of the `_key` property, which is a string.
|
|
16
|
-
*/
|
|
17
|
-
get key(): string;
|
|
18
|
-
/**
|
|
19
|
-
* The above function sets the value of a protected variable called "key".
|
|
20
|
-
* @param {string} value - The value parameter is a string that represents the value to be assigned
|
|
21
|
-
* to the key.
|
|
22
|
-
*/
|
|
23
|
-
set key(value: string);
|
|
24
|
-
protected _children: Map<string, TrieNode>;
|
|
25
|
-
/**
|
|
26
|
-
* The function returns the children of a TrieNode as a Map.
|
|
27
|
-
* @returns The `children` property of the TrieNode object, which is a Map containing string keys and
|
|
28
|
-
* TrieNode values.
|
|
29
|
-
*/
|
|
30
|
-
get children(): Map<string, TrieNode>;
|
|
31
|
-
/**
|
|
32
|
-
* The function sets the value of the `_children` property of a TrieNode object.
|
|
33
|
-
* @param value - The value parameter is a Map object that represents the children of a TrieNode. The
|
|
34
|
-
* keys of the map are strings, which represent the characters that are associated with each child
|
|
35
|
-
* TrieNode. The values of the map are TrieNode objects, which represent the child nodes of the
|
|
36
|
-
* current TrieNode.
|
|
37
|
-
*/
|
|
38
|
-
set children(value: Map<string, TrieNode>);
|
|
39
|
-
protected _isEnd: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* The function returns a boolean value indicating whether a certain condition is met.
|
|
42
|
-
* @returns The method is returning a boolean value, specifically the value of the variable `_isEnd`.
|
|
43
|
-
*/
|
|
44
|
-
get isEnd(): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The function sets the value of the "_isEnd" property.
|
|
47
|
-
* @param {boolean} value - The value parameter is a boolean value that indicates whether the current
|
|
48
|
-
* state is the end state or not.
|
|
49
|
-
*/
|
|
50
|
-
set isEnd(value: boolean);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* 1. Node Structure: Each node in a Trie represents a string (or a part of a string). The root node typically represents an empty string.
|
|
54
|
-
* 2. Child Node Relationship: Each node's children represent the strings that can be formed by adding one character to the string at the current node. For example, if a node represents the string 'ca', one of its children might represent 'cat'.
|
|
55
|
-
* 3. Fast Retrieval: Trie allows retrieval in O(m) time complexity, where m is the length of the string to be searched.
|
|
56
|
-
* 4. Space Efficiency: Trie can store a large number of strings very space-efficiently, especially when these strings share common prefixes.
|
|
57
|
-
* 5. Autocomplete and Prediction: Trie can be used for implementing autocomplete and word prediction features, as it can quickly find all strings with a common prefix.
|
|
58
|
-
* 6. Sorting: Trie can be used to sort a set of strings in alphabetical order.
|
|
59
|
-
* 7. String Retrieval: For example, searching for a specific string in a large set of strings.
|
|
60
|
-
* 8. Autocomplete: Providing recommended words or phrases as a user types.
|
|
61
|
-
* 9. Spell Check: Checking the spelling of words.
|
|
62
|
-
* 10. IP Routing: Used in certain types of IP routing algorithms.
|
|
63
|
-
* 11. Text Word Frequency Count: Counting and storing the frequency of words in a large amount of text data.
|
|
64
|
-
* @example
|
|
65
|
-
* // Autocomplete: Prefix validation and checking
|
|
66
|
-
* const autocomplete = new Trie<string>(['gmail.com', 'gmail.co.nz', 'gmail.co.jp', 'yahoo.com', 'outlook.com']);
|
|
67
|
-
*
|
|
68
|
-
* // Get all completions for a prefix
|
|
69
|
-
* const gmailCompletions = autocomplete.getWords('gmail');
|
|
70
|
-
* console.log(gmailCompletions); // ['gmail.com', 'gmail.co.nz', 'gmail.co.jp']
|
|
71
|
-
* @example
|
|
72
|
-
* // File System Path Operations
|
|
73
|
-
* const fileSystem = new Trie<string>([
|
|
74
|
-
* '/home/user/documents/file1.txt',
|
|
75
|
-
* '/home/user/documents/file2.txt',
|
|
76
|
-
* '/home/user/pictures/photo.jpg',
|
|
77
|
-
* '/home/user/pictures/vacation/',
|
|
78
|
-
* '/home/user/downloads'
|
|
79
|
-
* ]);
|
|
80
|
-
*
|
|
81
|
-
* // Find common directory prefix
|
|
82
|
-
* console.log(fileSystem.getLongestCommonPrefix()); // '/home/user/'
|
|
83
|
-
*
|
|
84
|
-
* // List all files in a directory
|
|
85
|
-
* const documentsFiles = fileSystem.getWords('/home/user/documents/');
|
|
86
|
-
* console.log(documentsFiles); // ['/home/user/documents/file1.txt', '/home/user/documents/file2.txt']
|
|
87
|
-
* @example
|
|
88
|
-
* // Autocomplete: Basic word suggestions
|
|
89
|
-
* // Create a trie for autocomplete
|
|
90
|
-
* const autocomplete = new Trie<string>([
|
|
91
|
-
* 'function',
|
|
92
|
-
* 'functional',
|
|
93
|
-
* 'functions',
|
|
94
|
-
* 'class',
|
|
95
|
-
* 'classes',
|
|
96
|
-
* 'classical',
|
|
97
|
-
* 'closure',
|
|
98
|
-
* 'const',
|
|
99
|
-
* 'constructor'
|
|
100
|
-
* ]);
|
|
101
|
-
*
|
|
102
|
-
* // Test autocomplete with different prefixes
|
|
103
|
-
* console.log(autocomplete.getWords('fun')); // ['functional', 'functions', 'function']
|
|
104
|
-
* console.log(autocomplete.getWords('cla')); // ['classes', 'classical', 'class']
|
|
105
|
-
* console.log(autocomplete.getWords('con')); // ['constructor', 'const']
|
|
106
|
-
*
|
|
107
|
-
* // Test with non-matching prefix
|
|
108
|
-
* console.log(autocomplete.getWords('xyz')); // []
|
|
109
|
-
* @example
|
|
110
|
-
* // Dictionary: Case-insensitive word lookup
|
|
111
|
-
* // Create a case-insensitive dictionary
|
|
112
|
-
* const dictionary = new Trie<string>([], { caseSensitive: false });
|
|
113
|
-
*
|
|
114
|
-
* // Add words with mixed casing
|
|
115
|
-
* dictionary.add('Hello');
|
|
116
|
-
* dictionary.add('WORLD');
|
|
117
|
-
* dictionary.add('JavaScript');
|
|
118
|
-
*
|
|
119
|
-
* // Test lookups with different casings
|
|
120
|
-
* console.log(dictionary.has('hello')); // true
|
|
121
|
-
* console.log(dictionary.has('HELLO')); // true
|
|
122
|
-
* console.log(dictionary.has('Hello')); // true
|
|
123
|
-
* console.log(dictionary.has('javascript')); // true
|
|
124
|
-
* console.log(dictionary.has('JAVASCRIPT')); // true
|
|
125
|
-
* @example
|
|
126
|
-
* // IP Address Routing Table
|
|
127
|
-
* // Add IP address prefixes and their corresponding routes
|
|
128
|
-
* const routes = {
|
|
129
|
-
* '192.168.1': 'LAN_SUBNET_1',
|
|
130
|
-
* '192.168.2': 'LAN_SUBNET_2',
|
|
131
|
-
* '10.0.0': 'PRIVATE_NETWORK_1',
|
|
132
|
-
* '10.0.1': 'PRIVATE_NETWORK_2'
|
|
133
|
-
* };
|
|
134
|
-
*
|
|
135
|
-
* const ipRoutingTable = new Trie<string>(Object.keys(routes));
|
|
136
|
-
*
|
|
137
|
-
* // Check IP address prefix matching
|
|
138
|
-
* console.log(ipRoutingTable.hasPrefix('192.168.1')); // true
|
|
139
|
-
* console.log(ipRoutingTable.hasPrefix('192.168.2')); // true
|
|
140
|
-
*
|
|
141
|
-
* // Validate IP address belongs to subnet
|
|
142
|
-
* const ip = '192.168.1.100';
|
|
143
|
-
* const subnet = ip.split('.').slice(0, 3).join('.');
|
|
144
|
-
* console.log(ipRoutingTable.hasPrefix(subnet)); // true
|
|
145
|
-
*/
|
|
146
|
-
export declare class Trie<R = any> extends IterableElementBase<string, R> {
|
|
147
|
-
/**
|
|
148
|
-
* The constructor initializes a Trie data structure with optional options and words provided as
|
|
149
|
-
* input.
|
|
150
|
-
* @param {Iterable<string> | Iterable<R>} words - The `words` parameter in the constructor is an
|
|
151
|
-
* iterable containing either strings or elements of type `R`. It is used to initialize the Trie with
|
|
152
|
-
* a list of words or elements. If no `words` are provided, an empty iterable is used as the default
|
|
153
|
-
* value.
|
|
154
|
-
* @param [options] - The `options` parameter in the constructor is an optional object that can
|
|
155
|
-
* contain configuration options for the Trie data structure. One of the options it can have is
|
|
156
|
-
* `caseSensitive`, which is a boolean value indicating whether the Trie should be case-sensitive or
|
|
157
|
-
* not. If `caseSensitive` is set to `
|
|
158
|
-
*/
|
|
159
|
-
constructor(words?: Iterable<string> | Iterable<R>, options?: TrieOptions<R>);
|
|
160
|
-
protected _size: number;
|
|
161
|
-
/**
|
|
162
|
-
* The size function returns the size of the stack.
|
|
163
|
-
* @return The number of elements in the list
|
|
164
|
-
*/
|
|
165
|
-
get size(): number;
|
|
166
|
-
protected _caseSensitive: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* The caseSensitive function is a getter that returns the value of the protected _caseSensitive property.
|
|
169
|
-
* @return The value of the _caseSensitive protected variable
|
|
170
|
-
*/
|
|
171
|
-
get caseSensitive(): boolean;
|
|
172
|
-
protected _root: TrieNode;
|
|
173
|
-
/**
|
|
174
|
-
* The root function returns the root node of the tree.
|
|
175
|
-
* @return The root node
|
|
176
|
-
*/
|
|
177
|
-
get root(): TrieNode;
|
|
178
|
-
/**
|
|
179
|
-
* Time Complexity: O(l), where l is the length of the word being added.
|
|
180
|
-
* Space Complexity: O(l) - Each character in the word adds a TrieNode.
|
|
181
|
-
*
|
|
182
|
-
* Add a word to the Trie structure.
|
|
183
|
-
* @param {string} word - The word to add.
|
|
184
|
-
* @returns {boolean} True if the word was successfully added.
|
|
185
|
-
*/
|
|
186
|
-
add(word: string): boolean;
|
|
187
|
-
/**
|
|
188
|
-
* Time Complexity: O(n * l)
|
|
189
|
-
* Space Complexity: O(1)
|
|
190
|
-
*
|
|
191
|
-
* The `addMany` function in TypeScript takes an iterable of strings or elements of type R, converts
|
|
192
|
-
* them using a provided function if available, and adds them to a data structure while returning an
|
|
193
|
-
* array of boolean values indicating success.
|
|
194
|
-
* @param {Iterable<string> | Iterable<R>} words - The `words` parameter in the `addMany` function is
|
|
195
|
-
* an iterable that contains either strings or elements of type `R`.
|
|
196
|
-
* @returns The `addMany` method returns an array of boolean values indicating whether each word in
|
|
197
|
-
* the input iterable was successfully added to the data structure.
|
|
198
|
-
*/
|
|
199
|
-
addMany(words: Iterable<string> | Iterable<R>): boolean[];
|
|
200
|
-
/**
|
|
201
|
-
* Time Complexity: O(l), where l is the length of the input word.
|
|
202
|
-
* Space Complexity: O(1) - Constant space.
|
|
203
|
-
*
|
|
204
|
-
* Check if the Trie contains a given word.
|
|
205
|
-
* @param {string} word - The word to check for.
|
|
206
|
-
* @returns {boolean} True if the word is present in the Trie.
|
|
207
|
-
*/
|
|
208
|
-
has(word: string): boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Time Complexity: O(1)
|
|
211
|
-
* Space Complexity: O(1)
|
|
212
|
-
*
|
|
213
|
-
* The isEmpty function checks if the size of the queue is 0.
|
|
214
|
-
* @return True if the size of the queue is 0
|
|
215
|
-
*/
|
|
216
|
-
isEmpty(): boolean;
|
|
217
|
-
/**
|
|
218
|
-
* Time Complexity: O(1)
|
|
219
|
-
* Space Complexity: O(1)
|
|
220
|
-
*
|
|
221
|
-
* The clear function resets the size of the Trie to 0 and creates a new root TrieNode.
|
|
222
|
-
*/
|
|
223
|
-
clear(): void;
|
|
224
|
-
/**
|
|
225
|
-
* Time Complexity: O(l), where l is the length of the word being deleted.
|
|
226
|
-
* Space Complexity: O(n) - Due to the recursive DFS approach.
|
|
227
|
-
*
|
|
228
|
-
* Remove a word from the Trie structure.
|
|
229
|
-
* @param{string} word - The word to delete.
|
|
230
|
-
* @returns {boolean} True if the word was successfully removed.
|
|
231
|
-
*/
|
|
232
|
-
delete(word: string): boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Time Complexity: O(n)
|
|
235
|
-
* Space Complexity: O(1)
|
|
236
|
-
*
|
|
237
|
-
* The function `getHeight` calculates the height of a trie data structure starting from the root
|
|
238
|
-
* node.
|
|
239
|
-
* @returns The `getHeight` method returns the maximum depth or height of the trie tree starting from
|
|
240
|
-
* the root node. It calculates the depth using a breadth-first search (BFS) traversal of the trie
|
|
241
|
-
* tree and returns the maximum depth found.
|
|
242
|
-
*/
|
|
243
|
-
getHeight(): number;
|
|
244
|
-
/**
|
|
245
|
-
* Time Complexity: O(l), where l is the length of the input prefix.
|
|
246
|
-
* Space Complexity: O(1) - Constant space.
|
|
247
|
-
*
|
|
248
|
-
* Check if a given input string has an absolute prefix in the Trie, meaning it's not a complete word.
|
|
249
|
-
* @param {string} input - The input string to check.
|
|
250
|
-
* @returns {boolean} True if it's an absolute prefix in the Trie.
|
|
251
|
-
*/
|
|
252
|
-
hasPurePrefix(input: string): boolean;
|
|
253
|
-
/**
|
|
254
|
-
* Time Complexity: O(l), where l is the length of the input prefix.
|
|
255
|
-
* Space Complexity: O(1) - Constant space.
|
|
256
|
-
*
|
|
257
|
-
* Check if a given input string is a prefix of any existing word in the Trie, whether as an absolute prefix or a complete word.
|
|
258
|
-
* @param {string} input - The input string representing the prefix to check.
|
|
259
|
-
* @returns {boolean} True if it's a prefix in the Trie.
|
|
260
|
-
*/
|
|
261
|
-
hasPrefix(input: string): boolean;
|
|
262
|
-
/**
|
|
263
|
-
* Time Complexity: O(n), where n is the total number of nodes in the trie.
|
|
264
|
-
* Space Complexity: O(l), where l is the length of the input prefix.
|
|
265
|
-
*
|
|
266
|
-
* Check if the input string is a common prefix in the Trie, meaning it's a prefix shared by all words in the Trie.
|
|
267
|
-
* @param {string} input - The input string representing the common prefix to check for.
|
|
268
|
-
* @returns {boolean} True if it's a common prefix in the Trie.
|
|
269
|
-
*/
|
|
270
|
-
hasCommonPrefix(input: string): boolean;
|
|
271
|
-
/**
|
|
272
|
-
* Time Complexity: O(n), where n is the total number of nodes in the trie.
|
|
273
|
-
* Space Complexity: O(l), where l is the length of the longest common prefix.
|
|
274
|
-
*
|
|
275
|
-
* Get the longest common prefix among all the words stored in the Trie.
|
|
276
|
-
* @returns {string} The longest common prefix found in the Trie.
|
|
277
|
-
*/
|
|
278
|
-
getLongestCommonPrefix(): string;
|
|
279
|
-
/**
|
|
280
|
-
* Time Complexity: O(w * l), where w is the number of words retrieved, and l is the average length of the words.
|
|
281
|
-
* Space Complexity: O(w * l) - The space required for the output array.
|
|
282
|
-
*
|
|
283
|
-
* The `getAll` function returns an array of all words in a Trie data structure that start with a given prefix.
|
|
284
|
-
* @param {string} prefix - The `prefix` parameter is a string that represents the prefix that we want to search for in the
|
|
285
|
-
* trie. It is an optional parameter, so if no prefix is provided, it will default to an empty string.
|
|
286
|
-
* @param {number} max - The max count of words will be found
|
|
287
|
-
* @param isAllWhenEmptyPrefix - If true, when the prefix provided as '', returns all the words in the trie.
|
|
288
|
-
* @returns {string[]} an array of strings.
|
|
289
|
-
*/
|
|
290
|
-
getWords(prefix?: string, max?: number, isAllWhenEmptyPrefix?: boolean): string[];
|
|
291
|
-
/**
|
|
292
|
-
* Time Complexity: O(n)
|
|
293
|
-
* Space Complexity: O(n)
|
|
294
|
-
*
|
|
295
|
-
* The `clone` function returns a new instance of the Trie class with the same values and case
|
|
296
|
-
* sensitivity as the original Trie.
|
|
297
|
-
* @returns A new instance of the Trie class is being returned.
|
|
298
|
-
*/
|
|
299
|
-
clone(): Trie<R>;
|
|
300
|
-
/**
|
|
301
|
-
* Time Complexity: O(n)
|
|
302
|
-
* Space Complexity: O(n)
|
|
303
|
-
*
|
|
304
|
-
* The `filter` function takes a predicate function and returns a new array containing all the
|
|
305
|
-
* elements for which the predicate function returns true.
|
|
306
|
-
* @param predicate - The `predicate` parameter is a callback function that takes three arguments:
|
|
307
|
-
* `word`, `index`, and `this`. It should return a boolean value indicating whether the current
|
|
308
|
-
* element should be included in the filtered results or not.
|
|
309
|
-
* @param {any} [thisArg] - The `thisArg` parameter is an optional argument that allows you to
|
|
310
|
-
* specify the value of `this` within the `predicate` function. It is used when you want to bind a
|
|
311
|
-
* specific object as the context for the `predicate` function. If `thisArg` is provided, it will be
|
|
312
|
-
* @returns The `filter` method is returning an array of strings (`string[]`).
|
|
313
|
-
*/
|
|
314
|
-
filter(predicate: ElementCallback<string, R, boolean>, thisArg?: any): Trie<R>;
|
|
315
|
-
/**
|
|
316
|
-
* Time Complexity: O(n)
|
|
317
|
-
* Space Complexity: O(n)
|
|
318
|
-
*
|
|
319
|
-
* The `map` function creates a new Trie by applying a callback function to each element in the
|
|
320
|
-
* current Trie.
|
|
321
|
-
* @param callback - The callback parameter is a function that will be called for each element in the
|
|
322
|
-
* Trie. It takes four arguments:
|
|
323
|
-
* @param [toElementFn] - The `toElementFn` parameter is an optional function that can be used to
|
|
324
|
-
* convert the raw element (`RM`) into a string representation. This can be useful if the raw element
|
|
325
|
-
* is not already a string or if you want to customize how the element is converted into a string. If
|
|
326
|
-
* this parameter is
|
|
327
|
-
* @param {any} [thisArg] - The `thisArg` parameter is an optional argument that allows you to
|
|
328
|
-
* specify the value of `this` within the callback function. It is used to set the context or scope
|
|
329
|
-
* in which the callback function will be executed. If `thisArg` is provided, it will be used as the
|
|
330
|
-
* value of
|
|
331
|
-
* @returns a new Trie object.
|
|
332
|
-
*/
|
|
333
|
-
map<RM>(callback: ElementCallback<string, R, string>, toElementFn?: (rawElement: RM) => string, thisArg?: any): Trie<RM>;
|
|
334
|
-
/**
|
|
335
|
-
* Time Complexity: O(n)
|
|
336
|
-
* Space Complexity: O(n)
|
|
337
|
-
*
|
|
338
|
-
* The function `_getIterator` returns an iterable iterator that performs a depth-first search on a
|
|
339
|
-
* trie data structure and yields all the paths to the end nodes.
|
|
340
|
-
*/
|
|
341
|
-
protected _getIterator(): IterableIterator<string>;
|
|
342
|
-
protected get _total(): number;
|
|
343
|
-
/**
|
|
344
|
-
* Time Complexity: O(l), where l is the length of the input string.
|
|
345
|
-
* Space Complexity: O(1) - Constant space.
|
|
346
|
-
*
|
|
347
|
-
* @param str
|
|
348
|
-
* @protected
|
|
349
|
-
*/
|
|
350
|
-
protected _caseProcess(str: string): string;
|
|
351
|
-
}
|