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
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import * as Benchmark from 'benchmark';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as fastGlob from 'fast-glob';
|
|
5
|
+
import { fork } from 'child_process';
|
|
6
|
+
import { ConsoleColor, numberFix } from '../utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Optimized benchmark runner
|
|
10
|
+
* Features:
|
|
11
|
+
* - Optional per-suite isolation via child_process (--isolate)
|
|
12
|
+
* - GC + cooldown between suites (--gc, --cooldown-ms=50)
|
|
13
|
+
* - Shuffle or custom order (--shuffle, --order=heap,avl-tree,...)
|
|
14
|
+
* - Arg tokens still filter test files like before
|
|
15
|
+
* - Maintains JSON/HTML report + README injection
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
* ts-node benchmark-runner.optimized.ts --isolate --gc --cooldown-ms=80 heap set get
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// ---- CLI parsing (lightweight) ----
|
|
22
|
+
type Flags = {
|
|
23
|
+
isolate: boolean;
|
|
24
|
+
gc: boolean;
|
|
25
|
+
cooldownMs: number;
|
|
26
|
+
shuffle: boolean;
|
|
27
|
+
order?: string[];
|
|
28
|
+
orderFile?: string;
|
|
29
|
+
include?: string[];
|
|
30
|
+
exclude?: string[];
|
|
31
|
+
label?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function parseArgs(argv: string[]) {
|
|
35
|
+
const flags: Flags = {
|
|
36
|
+
isolate: false,
|
|
37
|
+
gc: false,
|
|
38
|
+
cooldownMs: 50,
|
|
39
|
+
shuffle: false,
|
|
40
|
+
order: undefined,
|
|
41
|
+
orderFile: undefined,
|
|
42
|
+
include: undefined,
|
|
43
|
+
exclude: undefined,
|
|
44
|
+
label: undefined
|
|
45
|
+
};
|
|
46
|
+
const filters: string[] = [];
|
|
47
|
+
argv.forEach(raw => {
|
|
48
|
+
if (!raw.startsWith('--')) {
|
|
49
|
+
filters.push(raw);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const [k, v] = raw.replace(/^--/, '').split('=');
|
|
53
|
+
switch (k) {
|
|
54
|
+
case 'isolate':
|
|
55
|
+
flags.isolate = true;
|
|
56
|
+
break;
|
|
57
|
+
case 'gc':
|
|
58
|
+
flags.gc = true;
|
|
59
|
+
break;
|
|
60
|
+
case 'shuffle':
|
|
61
|
+
flags.shuffle = true;
|
|
62
|
+
break;
|
|
63
|
+
case 'cooldown-ms':
|
|
64
|
+
flags.cooldownMs = v ? Number(v) : flags.cooldownMs;
|
|
65
|
+
break;
|
|
66
|
+
case 'order':
|
|
67
|
+
flags.order = (v ?? '')
|
|
68
|
+
.split(',')
|
|
69
|
+
.map(s => s.trim())
|
|
70
|
+
.filter(Boolean);
|
|
71
|
+
break;
|
|
72
|
+
case 'order-file':
|
|
73
|
+
flags.orderFile = v || '';
|
|
74
|
+
break;
|
|
75
|
+
case 'include':
|
|
76
|
+
flags.include = (v ?? '')
|
|
77
|
+
.split(',')
|
|
78
|
+
.map(s => s.trim())
|
|
79
|
+
.filter(Boolean);
|
|
80
|
+
break;
|
|
81
|
+
case 'exclude':
|
|
82
|
+
flags.exclude = (v ?? '')
|
|
83
|
+
.split(',')
|
|
84
|
+
.map(s => s.trim())
|
|
85
|
+
.filter(Boolean);
|
|
86
|
+
break;
|
|
87
|
+
case 'label':
|
|
88
|
+
flags.label = v || '';
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return { flags, filters };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const argv = process.argv.slice(2);
|
|
98
|
+
const { flags, filters } = parseArgs(argv);
|
|
99
|
+
|
|
100
|
+
const { GREEN, BOLD, END, YELLOW, GRAY, CYAN, BG_YELLOW } = ConsoleColor;
|
|
101
|
+
|
|
102
|
+
// ---- Optional runOrder config support (order/include/exclude/label) ----
|
|
103
|
+
type RunConfig = { order?: string[]; include?: string[]; exclude?: string[]; label?: string };
|
|
104
|
+
|
|
105
|
+
function loadRunConfigFromFile(filePath?: string): RunConfig | null {
|
|
106
|
+
const p1 = filePath ? path.resolve(process.cwd(), filePath) : path.resolve(__dirname, 'runner-config.json');
|
|
107
|
+
const p2 = filePath ? undefined : path.resolve(__dirname, 'run-order.json');
|
|
108
|
+
const candidates = [p1, p2].filter(Boolean) as string[];
|
|
109
|
+
for (const p of candidates) {
|
|
110
|
+
try {
|
|
111
|
+
if (fs.existsSync(p)) {
|
|
112
|
+
const data = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
113
|
+
if (Array.isArray(data)) {
|
|
114
|
+
console.log(`${YELLOW}Using run config from file:${END} ${p}`);
|
|
115
|
+
return { order: data as string[] };
|
|
116
|
+
} else if (data && typeof data === 'object') {
|
|
117
|
+
const cfg: RunConfig = {};
|
|
118
|
+
if (Array.isArray((data as any).order))
|
|
119
|
+
cfg.order = (data as any).order.filter((x: any) => typeof x === 'string');
|
|
120
|
+
if (Array.isArray((data as any).include))
|
|
121
|
+
cfg.include = (data as any).include.filter((x: any) => typeof x === 'string');
|
|
122
|
+
if (Array.isArray((data as any).exclude))
|
|
123
|
+
cfg.exclude = (data as any).exclude.filter((x: any) => typeof x === 'string');
|
|
124
|
+
if (typeof (data as any).label === 'string') cfg.label = (data as any).label;
|
|
125
|
+
console.log(`${YELLOW}Using run config from file:${END} ${p}`);
|
|
126
|
+
return cfg;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.warn(`Failed to load run config from ${p}:`, e);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function loadRunOrderFromFile(filePath?: string): string[] | null {
|
|
137
|
+
const p1 = filePath ? path.resolve(process.cwd(), filePath) : path.resolve(__dirname, 'runner-config.json');
|
|
138
|
+
const p2 = filePath ? undefined : path.resolve(__dirname, 'run-order.json');
|
|
139
|
+
const candidates = [p1, p2].filter(Boolean) as string[];
|
|
140
|
+
for (const p of candidates) {
|
|
141
|
+
try {
|
|
142
|
+
if (fs.existsSync(p)) {
|
|
143
|
+
const arr = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
144
|
+
if (Array.isArray(arr) && arr.every((x: any) => typeof x === 'string')) {
|
|
145
|
+
console.log(`${YELLOW}Using runOrder from file:${END} ${p}`);
|
|
146
|
+
return arr;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
} catch (e) {
|
|
150
|
+
console.warn(`Failed to load order from ${p}:`, e);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const defaultRunOrder = [
|
|
157
|
+
'heap',
|
|
158
|
+
'avl-tree',
|
|
159
|
+
'red-black-tree',
|
|
160
|
+
'doubly-linked-list',
|
|
161
|
+
'linked-hash-map',
|
|
162
|
+
'hash-map',
|
|
163
|
+
'map-graph',
|
|
164
|
+
'graph',
|
|
165
|
+
'directed-graph',
|
|
166
|
+
'undirected-graph',
|
|
167
|
+
'queue',
|
|
168
|
+
'deque',
|
|
169
|
+
'priority-queue',
|
|
170
|
+
'singly-linked-list',
|
|
171
|
+
'binary-tree-overall',
|
|
172
|
+
'bst',
|
|
173
|
+
'trie',
|
|
174
|
+
'stack'
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
const cfg = loadRunConfigFromFile(flags.orderFile);
|
|
178
|
+
const fileOrder = cfg?.order || loadRunOrderFromFile(flags.orderFile);
|
|
179
|
+
const runOrder = flags.order && flags.order.length ? flags.order : fileOrder || defaultRunOrder;
|
|
180
|
+
|
|
181
|
+
const getRelativePath = (file: string) => path.relative(__dirname, file);
|
|
182
|
+
|
|
183
|
+
// ---- Selection helpers (include/exclude) ----
|
|
184
|
+
function fileRel(file: string) {
|
|
185
|
+
return path.relative(testDir, file).replace(/\\/g, '/');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function makeMatcher(rule: string): (s: string) => boolean {
|
|
189
|
+
// If there is no wildcard, the substring matches and is compatible with your original behavior
|
|
190
|
+
if (!/[?*]/.test(rule)) {
|
|
191
|
+
return (s: string) => s.includes(rule);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Use POSIX delimiters uniformly
|
|
195
|
+
const norm = rule.replace(/\\/g, '/');
|
|
196
|
+
|
|
197
|
+
// Escape regular special characters first, but keep * and ?
|
|
198
|
+
const esc = norm.replace(/[.+^${}()|[\]\\]/g, '\\$&');
|
|
199
|
+
|
|
200
|
+
// To process ** (across multi-level directories), use sentinel placeholders first to avoid conflicts with the subsequent replacement of *
|
|
201
|
+
const GLOBSTAR = '<<GLOBSTAR>>';
|
|
202
|
+
const withSentinel = esc.replace(/\*\*/g, GLOBSTAR);
|
|
203
|
+
|
|
204
|
+
// * => Multiple characters that do not cross directories, ? => Single characters that do not cross directories
|
|
205
|
+
const seg = withSentinel.replace(/\*/g, '[^/]*').replace(/\?/g, '[^/]');
|
|
206
|
+
|
|
207
|
+
// Restore ** => any character (can cross directories)
|
|
208
|
+
const regexSource = '^' + seg.split(GLOBSTAR).join('.*') + '$';
|
|
209
|
+
const re = new RegExp(regexSource);
|
|
210
|
+
|
|
211
|
+
return (s: string) => re.test(s.replace(/\\/g, '/'));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function applyIncludeExclude(files: string[], include?: string[], exclude?: string[]) {
|
|
215
|
+
let res = [...files];
|
|
216
|
+
if (include && include.length) {
|
|
217
|
+
const matchers = include.map(makeMatcher);
|
|
218
|
+
res = res.filter(f => matchers.some(m => m(fileRel(f))));
|
|
219
|
+
}
|
|
220
|
+
if (exclude && exclude.length) {
|
|
221
|
+
const matchers = exclude.map(makeMatcher);
|
|
222
|
+
res = res.filter(f => !matchers.some(m => m(fileRel(f))));
|
|
223
|
+
}
|
|
224
|
+
return res;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const coloredLabeled = (label: string, file: string) => {
|
|
228
|
+
const relativeFilePath = getRelativePath(file);
|
|
229
|
+
const directory = path.dirname(relativeFilePath);
|
|
230
|
+
const fileName = path.basename(relativeFilePath);
|
|
231
|
+
return `${BG_YELLOW} ${label} ${END} ${GRAY}${directory}/${END}${CYAN}${fileName}${END}`;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const parentDirectory = path.resolve(__dirname, '../..');
|
|
235
|
+
const reportDistPath = path.join(parentDirectory, 'benchmark');
|
|
236
|
+
|
|
237
|
+
const testDir = path.join(__dirname, 'data-structures');
|
|
238
|
+
const allFiles = fastGlob.sync([path.join(testDir, '**', '*.test.ts'), path.join(testDir, '**', '*.test.mjs')]);
|
|
239
|
+
let testFiles: string[] = [];
|
|
240
|
+
|
|
241
|
+
// Filters: same semantics as your original runner (non -- args are match substrings)
|
|
242
|
+
if (filters.length > 0) {
|
|
243
|
+
console.log(`arguments: ${filters.join(' ')}`);
|
|
244
|
+
testFiles = allFiles.filter(file => filters.every(word => file.includes(word)));
|
|
245
|
+
} else {
|
|
246
|
+
testFiles = [...allFiles];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Apply include/exclude from config and CLI
|
|
250
|
+
const includeRules = [...(cfg?.include || []), ...(flags.include || [])];
|
|
251
|
+
const excludeRules = [...(cfg?.exclude || []), ...(flags.exclude || [])];
|
|
252
|
+
if (includeRules.length || excludeRules.length) {
|
|
253
|
+
testFiles = applyIncludeExclude(testFiles, includeRules, excludeRules);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// sort by runOrder, optionally shuffle
|
|
257
|
+
function sortByOrder(files: string[]): string[] {
|
|
258
|
+
type Item = { file: string; name: string; idx: number };
|
|
259
|
+
const items: Item[] = files.map(file => {
|
|
260
|
+
const name = path.basename(file, '.test.ts');
|
|
261
|
+
const idx = runOrder.indexOf(name);
|
|
262
|
+
return { file, name, idx: idx === -1 ? Number.MAX_SAFE_INTEGER : idx };
|
|
263
|
+
});
|
|
264
|
+
items.sort((a, b) => a.idx - b.idx || a.name.localeCompare(b.name));
|
|
265
|
+
return items.map(i => i.file);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function shuffle<T>(arr: T[]): T[] {
|
|
269
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
|
270
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
271
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
272
|
+
}
|
|
273
|
+
return arr;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const discoveredTotal = allFiles.length;
|
|
277
|
+
|
|
278
|
+
testFiles = sortByOrder(testFiles);
|
|
279
|
+
if (flags.shuffle) shuffle(testFiles);
|
|
280
|
+
|
|
281
|
+
const plannedCount = testFiles.length;
|
|
282
|
+
const isIndividual = filters.length > 0;
|
|
283
|
+
|
|
284
|
+
// ---------------- report utils (kept from original) ----------------
|
|
285
|
+
const report: { [key: string]: any } = {};
|
|
286
|
+
let completedCount = 0;
|
|
287
|
+
|
|
288
|
+
function ensureDist() {
|
|
289
|
+
if (!fs.existsSync(reportDistPath)) fs.mkdirSync(reportDistPath, { recursive: true });
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function writeReportHTMLAndJSON(htmlTables: string) {
|
|
293
|
+
ensureDist();
|
|
294
|
+
const filePath = path.join(reportDistPath, 'report.json');
|
|
295
|
+
const htmlFilePath = path.join(reportDistPath, 'report.html');
|
|
296
|
+
fs.writeFileSync(filePath, JSON.stringify(report, null, 2));
|
|
297
|
+
const html = `<!DOCTYPE html>
|
|
298
|
+
<html lang="en"><head><meta charset="UTF-8"/><title>Benchmark Report</title>
|
|
299
|
+
<style>
|
|
300
|
+
body { margin:0; padding:0; font-family: ui-sans-serif, system-ui, -apple-system; }
|
|
301
|
+
.json-to-html-title { font-size: 3rem; font-weight: bold; }
|
|
302
|
+
.content { padding: 2rem; }
|
|
303
|
+
.content table { width:100%; table-layout:fixed; border-collapse:collapse; margin-top:10px; font-size:16px; }
|
|
304
|
+
.content table th, .content table td { padding: 8px 12px; text-align:left; border:1px solid #ddd; }
|
|
305
|
+
.content table th { background:#f2f2f2; font-weight:bold; }
|
|
306
|
+
.content table tr:nth-child(odd) { background:#fff; }
|
|
307
|
+
</style></head><body><div class="content">
|
|
308
|
+
<div class="json-to-html-title">Benchmark Report</div>
|
|
309
|
+
${htmlTables}
|
|
310
|
+
</div></body></html>`;
|
|
311
|
+
|
|
312
|
+
if (!isIndividual) {
|
|
313
|
+
replaceMarkdownContent(
|
|
314
|
+
'[//]: # (No deletion!!! Start of Replace Section)',
|
|
315
|
+
'[//]: # (No deletion!!! End of Replace Section)',
|
|
316
|
+
htmlTables
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
fs.writeFileSync(htmlFilePath, html);
|
|
320
|
+
console.log(`Performance ${BOLD}${GREEN}report${END} file generated in file://${BOLD}${GREEN}${htmlFilePath}${END}`);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function replaceMarkdownContent(startMarker: string, endMarker: string, newText: string) {
|
|
324
|
+
const filePath = path.join(parentDirectory, 'README.md');
|
|
325
|
+
fs.readFile(filePath, 'utf8', (err, data) => {
|
|
326
|
+
if (err) {
|
|
327
|
+
console.error(`Unable to read ${filePath}:`, err);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
const startIndex = data.indexOf(startMarker);
|
|
331
|
+
const endIndex = data.indexOf(endMarker);
|
|
332
|
+
if (startIndex === -1 || endIndex === -1 || startIndex >= endIndex) {
|
|
333
|
+
console.warn('Markers not found or invalid range; skip README injection.');
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const updatedMarkdown = data.slice(0, startIndex + startMarker.length) + '\n' + newText + data.slice(endIndex);
|
|
337
|
+
fs.writeFile(filePath, updatedMarkdown, 'utf8', err2 => {
|
|
338
|
+
if (err2) console.error(`Unable to write to ${filePath}:`, err2);
|
|
339
|
+
else console.log(`The content has been successfully replaced in file://${BOLD}${GREEN}${filePath}${END}`);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function toHtmlTables() {
|
|
345
|
+
let htmlTables = '';
|
|
346
|
+
for (const key of Object.keys(report)) {
|
|
347
|
+
const block = report[key];
|
|
348
|
+
const rows = block.benchmarks as Array<Record<string, any>>;
|
|
349
|
+
if (!rows || !rows.length) continue;
|
|
350
|
+
const headers = Object.keys(rows[0]);
|
|
351
|
+
const table = [
|
|
352
|
+
'<table>',
|
|
353
|
+
'<thead>',
|
|
354
|
+
'<tr>' + headers.map(h => `<th>${h}</th>`).join('') + '</tr>',
|
|
355
|
+
'</thead>',
|
|
356
|
+
'<tbody>',
|
|
357
|
+
...rows.map(r => '<tr>' + headers.map(h => `<td>${r[h]}</td>`).join('') + '</tr>'),
|
|
358
|
+
'</tbody>',
|
|
359
|
+
'</table>'
|
|
360
|
+
].join('');
|
|
361
|
+
htmlTables += `<h2>${key}</h2>` + table;
|
|
362
|
+
}
|
|
363
|
+
return htmlTables;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// ---------------- in-process mode (improved hygiene) ----------------
|
|
367
|
+
|
|
368
|
+
async function runInProcess(files: string[]) {
|
|
369
|
+
const durations: number[] = [];
|
|
370
|
+
let index = 0;
|
|
371
|
+
for (const file of files) {
|
|
372
|
+
index++;
|
|
373
|
+
const base = path.basename(file);
|
|
374
|
+
const testName = base.replace(/\.test\.[^.]+$/, '');
|
|
375
|
+
console.log(`${BOLD}${GREEN}[${index}/${plannedCount}]${END} ${coloredLabeled('Run', file)}`);
|
|
376
|
+
|
|
377
|
+
const mod = require(file);
|
|
378
|
+
const suite: Benchmark.Suite | undefined = mod?.suite ?? mod?.default?.suite;
|
|
379
|
+
if (!suite) {
|
|
380
|
+
report[testName] = { benchmarks: [] };
|
|
381
|
+
completedCount++;
|
|
382
|
+
console.log(
|
|
383
|
+
`Progress: ${BOLD}${GREEN}${completedCount}${END}/${BOLD}${GREEN}${plannedCount}${END} Last ${testName}: ${YELLOW}SKIP${END}`
|
|
384
|
+
);
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
try {
|
|
389
|
+
suite.forEach((b: any) => {
|
|
390
|
+
if (typeof b.fn === 'function') b.fn.call(b);
|
|
391
|
+
});
|
|
392
|
+
} catch {}
|
|
393
|
+
|
|
394
|
+
if (flags.gc && global.gc) global.gc();
|
|
395
|
+
await new Promise(r => setTimeout(r, flags.cooldownMs));
|
|
396
|
+
|
|
397
|
+
const t0 = Date.now();
|
|
398
|
+
await new Promise<void>(resolve => {
|
|
399
|
+
suite
|
|
400
|
+
.on('complete', function (this: Benchmark.Suite) {
|
|
401
|
+
const rows = this.map((benchmark: any) => ({
|
|
402
|
+
'test name': benchmark.name,
|
|
403
|
+
'time taken (ms)': numberFix(benchmark.times.period * 1000, 2),
|
|
404
|
+
'sample mean (secs)': numberFix(benchmark.stats.mean, 2),
|
|
405
|
+
'sample deviation': numberFix(benchmark.stats.deviation, 2)
|
|
406
|
+
}));
|
|
407
|
+
report[testName] = { benchmarks: rows };
|
|
408
|
+
resolve();
|
|
409
|
+
})
|
|
410
|
+
.run({ async: false });
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
const dt = (Date.now() - t0) / 1000;
|
|
414
|
+
durations.push(dt);
|
|
415
|
+
const avg = durations.reduce((a, b) => a + b, 0) / durations.length;
|
|
416
|
+
const remaining = plannedCount - ++completedCount;
|
|
417
|
+
const etaSec = Math.max(0, Math.round(remaining * avg));
|
|
418
|
+
const mins = Math.floor(etaSec / 60)
|
|
419
|
+
.toString()
|
|
420
|
+
.padStart(2, '0');
|
|
421
|
+
const secs = (etaSec % 60).toString().padStart(2, '0');
|
|
422
|
+
console.log(
|
|
423
|
+
`Progress: ${BOLD}${GREEN}${completedCount}${END}/${BOLD}${GREEN}${plannedCount}${END} Last ${testName}: ${GREEN}OK${END} in ${numberFix(dt, 2)}s | ETA ~ ${mins}:${secs}`
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// ---------------- isolated-per-suite mode
|
|
429
|
+
type ChildMessage = {
|
|
430
|
+
testName: string;
|
|
431
|
+
benchmarks: Array<Record<string, any>>;
|
|
432
|
+
runTime: number;
|
|
433
|
+
file: string;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
async function runIsolated(files: string[]) {
|
|
437
|
+
const durations: number[] = [];
|
|
438
|
+
let index = 0;
|
|
439
|
+
|
|
440
|
+
for (const file of files) {
|
|
441
|
+
index++;
|
|
442
|
+
const testName = path.basename(file).replace(/\.test\.[^.]+$/, '');
|
|
443
|
+
console.log(`${BOLD}${GREEN}[${index}/${plannedCount}]${END} ${coloredLabeled('Fork', file)}`);
|
|
444
|
+
|
|
445
|
+
await new Promise<void>((resolve, reject) => {
|
|
446
|
+
const childEntry = path.resolve(__dirname, './single-suite-runner.ts'); // ensure .ts
|
|
447
|
+
|
|
448
|
+
// Always run with Node + ts-node/register in child.
|
|
449
|
+
const execArgv = ['-r', 'ts-node/register/transpile-only'];
|
|
450
|
+
|
|
451
|
+
// If user wants GC, put it into NODE_OPTIONS (so Node consumes it, not ts-node).
|
|
452
|
+
const env = {
|
|
453
|
+
...process.env,
|
|
454
|
+
NODE_OPTIONS: ((process.env.NODE_OPTIONS || '') + (flags.gc ? ' --expose-gc' : '')).trim()
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const t0 = Date.now();
|
|
458
|
+
const cp = fork(childEntry, [file], {
|
|
459
|
+
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
|
|
460
|
+
execArgv,
|
|
461
|
+
execPath: process.execPath,
|
|
462
|
+
env
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
let got = false;
|
|
466
|
+
cp.on('message', (m: ChildMessage) => {
|
|
467
|
+
got = true;
|
|
468
|
+
report[m.testName] = { benchmarks: m.benchmarks };
|
|
469
|
+
});
|
|
470
|
+
cp.on('exit', code => {
|
|
471
|
+
completedCount++;
|
|
472
|
+
const dt = (Date.now() - t0) / 1000;
|
|
473
|
+
durations.push(dt);
|
|
474
|
+
|
|
475
|
+
const avg = durations.reduce((a, b) => a + b, 0) / durations.length;
|
|
476
|
+
const remaining = files.length - completedCount;
|
|
477
|
+
const etaSec = Math.max(0, Math.round(remaining * avg));
|
|
478
|
+
const mins = Math.floor(etaSec / 60)
|
|
479
|
+
.toString()
|
|
480
|
+
.padStart(2, '0');
|
|
481
|
+
const secs = (etaSec % 60).toString().padStart(2, '0');
|
|
482
|
+
const label =
|
|
483
|
+
code === 0 && got ? `${GREEN}OK${END}` : code === 0 && !got ? `${YELLOW}SKIP${END}` : `${YELLOW}ERR${END}`;
|
|
484
|
+
|
|
485
|
+
console.log(
|
|
486
|
+
`Progress: ${BOLD}${GREEN}${completedCount}${END}/${BOLD}${GREEN}${plannedCount}${END}`,
|
|
487
|
+
`Last ${testName}: ${label} in ${numberFix(dt, 2)}s | ETA ~ ${mins}:${secs}`
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
if (code !== 0) reject(new Error(`Child failed: ${code}`));
|
|
491
|
+
else resolve();
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
await new Promise(r => setTimeout(r, flags.cooldownMs));
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// ---------------- entry ----------------
|
|
500
|
+
(async function main() {
|
|
501
|
+
if (!testFiles.length) {
|
|
502
|
+
console.log(`${YELLOW}No test files matched.${END}`);
|
|
503
|
+
process.exit(0);
|
|
504
|
+
}
|
|
505
|
+
console.log(
|
|
506
|
+
`${BOLD}${GREEN}Running ${plannedCount} planned suite(s)${END} out of ${discoveredTotal} discovered ${flags.isolate ? '(isolated)' : '(in-process)'} ${flags.shuffle ? '[shuffled]' : ''} ${flags.label ? '[' + flags.label + ']' : ''}`
|
|
507
|
+
);
|
|
508
|
+
|
|
509
|
+
if (flags.isolate) await runIsolated(testFiles);
|
|
510
|
+
else await runInProcess(testFiles);
|
|
511
|
+
|
|
512
|
+
// Render report (same as original)
|
|
513
|
+
const htmlTables = toHtmlTables();
|
|
514
|
+
writeReportHTMLAndJSON(htmlTables);
|
|
515
|
+
|
|
516
|
+
// Summary
|
|
517
|
+
const counts = { ok: 0, skip: 0, err: 0 };
|
|
518
|
+
for (const key of Object.keys(report)) {
|
|
519
|
+
const arr = report[key]?.benchmarks || [];
|
|
520
|
+
if (!Array.isArray(arr)) continue;
|
|
521
|
+
if (arr.length === 0) counts.skip++;
|
|
522
|
+
else counts.ok++;
|
|
523
|
+
}
|
|
524
|
+
// We don't track 'err' explicitly here because child errors stop the run; when needed, you can extend message payload.
|
|
525
|
+
console.log(
|
|
526
|
+
`${BOLD}${GREEN}Summary:${END} planned=${plannedCount}, discovered=${discoveredTotal}, ok=${counts.ok}, skipped=${counts.skip}`
|
|
527
|
+
);
|
|
528
|
+
})();
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PriorityQueue as SRCPriorityQueue } from '../../../../src';
|
|
3
|
-
import { PriorityQueue as CJSPriorityQueue } from '../../../../dist/cjs';
|
|
1
|
+
import { Heap as SRCPriorityQueue } from '../../../../src';
|
|
4
2
|
import {
|
|
5
3
|
Deque as CDeque,
|
|
6
4
|
HashMap as CHashMap,
|
|
@@ -16,93 +14,65 @@ import { getRandomIntArray, magnitude } from '../../../utils';
|
|
|
16
14
|
import { isCompetitor } from '../../../config';
|
|
17
15
|
|
|
18
16
|
const suite = new Benchmark.Suite();
|
|
19
|
-
const {
|
|
17
|
+
const { HUNDRED_THOUSAND, MILLION } = magnitude;
|
|
20
18
|
const cOrderedMap = new OrderedMap<number, number>();
|
|
21
19
|
const arrHundredThousand = getRandomIntArray(HUNDRED_THOUSAND, 0, HUNDRED_THOUSAND, true);
|
|
22
20
|
|
|
23
|
-
suite
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
.add(`CJS PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
|
|
29
|
-
const pq = new CJSPriorityQueue<number>();
|
|
30
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
|
|
31
|
-
})
|
|
32
|
-
.add(`MJS PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
|
|
33
|
-
const pq = new MJSPriorityQueue<number>([], {
|
|
34
|
-
comparator: (a, b) => b - a
|
|
35
|
-
});
|
|
36
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
|
|
37
|
-
});
|
|
21
|
+
suite.add(`SRC PQ ${MILLION.toLocaleString()} add`, () => {
|
|
22
|
+
const pq = new SRCPriorityQueue<number>();
|
|
23
|
+
for (let i = 0; i < MILLION; i++) pq.add(i);
|
|
24
|
+
});
|
|
38
25
|
|
|
39
26
|
if (isCompetitor) {
|
|
40
|
-
suite.add(`CPT PQ ${
|
|
27
|
+
suite.add(`CPT PQ ${HUNDRED_THOUSAND.toLocaleString()} add`, () => {
|
|
41
28
|
const pq = new CPriorityQueue<number>();
|
|
42
|
-
for (let i = 0; i <
|
|
29
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) pq.push(i);
|
|
43
30
|
});
|
|
44
31
|
}
|
|
45
32
|
|
|
46
|
-
suite
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
comparator: (a, b) => b - a
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
|
|
53
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.poll();
|
|
54
|
-
})
|
|
55
|
-
.add(`CJS PQ ${TEN_THOUSAND.toLocaleString()} add & poll`, () => {
|
|
56
|
-
const pq = new CJSPriorityQueue<number>([], {
|
|
57
|
-
comparator: (a, b) => b - a
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
|
|
61
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.poll();
|
|
62
|
-
})
|
|
63
|
-
.add(`MJS PQ ${TEN_THOUSAND.toLocaleString()} add & poll`, () => {
|
|
64
|
-
const pq = new MJSPriorityQueue<number>([], {
|
|
65
|
-
comparator: (a, b) => b - a
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
|
|
69
|
-
for (let i = 0; i < TEN_THOUSAND; i++) pq.poll();
|
|
33
|
+
suite.add(`SRC PQ ${HUNDRED_THOUSAND.toLocaleString()} add & poll`, () => {
|
|
34
|
+
const pq = new SRCPriorityQueue<number>([], {
|
|
35
|
+
comparator: (a, b) => b - a
|
|
70
36
|
});
|
|
71
37
|
|
|
38
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) pq.add(i);
|
|
39
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) pq.poll();
|
|
40
|
+
});
|
|
41
|
+
|
|
72
42
|
if (isCompetitor) {
|
|
73
43
|
suite
|
|
74
|
-
.add(`CPT PQ ${
|
|
44
|
+
.add(`CPT PQ ${MILLION.toLocaleString()} add & pop`, () => {
|
|
75
45
|
const pq = new CPriorityQueue<number>();
|
|
76
46
|
|
|
77
|
-
for (let i = 0; i <
|
|
78
|
-
for (let i = 0; i <
|
|
47
|
+
for (let i = 0; i < MILLION; i++) pq.push(i);
|
|
48
|
+
for (let i = 0; i < MILLION; i++) pq.pop();
|
|
79
49
|
})
|
|
80
50
|
.add(`CPT OM ${HUNDRED_THOUSAND.toLocaleString()} add`, () => {
|
|
81
51
|
for (let i = 0; i < arrHundredThousand.length; i++)
|
|
82
52
|
cOrderedMap.setElement(arrHundredThousand[i], arrHundredThousand[i]);
|
|
83
53
|
})
|
|
84
|
-
.add(`CPT HM ${
|
|
54
|
+
.add(`CPT HM ${HUNDRED_THOUSAND.toLocaleString()} set`, () => {
|
|
85
55
|
const hm = new CHashMap<number, number>();
|
|
86
56
|
|
|
87
|
-
for (let i = 0; i <
|
|
57
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) hm.setElement(i, i);
|
|
88
58
|
})
|
|
89
|
-
.add(`CPT HM ${
|
|
59
|
+
.add(`CPT HM ${HUNDRED_THOUSAND.toLocaleString()} set & get`, () => {
|
|
90
60
|
const hm = new CHashMap<number, number>();
|
|
91
61
|
|
|
92
|
-
for (let i = 0; i <
|
|
93
|
-
for (let i = 0; i <
|
|
62
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) hm.setElement(i, i);
|
|
63
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) hm.getElementByKey(i);
|
|
94
64
|
})
|
|
95
65
|
.add(`CPT LL ${MILLION.toLocaleString()} unshift`, () => {
|
|
96
66
|
const list = new CLinkedList<number>();
|
|
97
67
|
|
|
98
68
|
for (let i = 0; i < MILLION; i++) list.pushFront(i);
|
|
99
69
|
})
|
|
100
|
-
.add(`CPT PQ ${
|
|
70
|
+
.add(`CPT PQ ${HUNDRED_THOUSAND.toLocaleString()} add & pop`, () => {
|
|
101
71
|
const pq = new CPriorityQueue<number>();
|
|
102
72
|
|
|
103
|
-
for (let i = 0; i <
|
|
73
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) pq.push(i);
|
|
104
74
|
|
|
105
|
-
for (let i = 0; i <
|
|
75
|
+
for (let i = 0; i < HUNDRED_THOUSAND; i++) pq.pop();
|
|
106
76
|
})
|
|
107
77
|
.add(`CPT DQ ${MILLION.toLocaleString()} push`, () => {
|
|
108
78
|
const deque = new CDeque<number>();
|
|
@@ -126,4 +96,4 @@ if (isCompetitor) {
|
|
|
126
96
|
});
|
|
127
97
|
}
|
|
128
98
|
|
|
129
|
-
|
|
99
|
+
export { suite };
|