data-structure-typed 1.53.9 → 1.54.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 +1 -1
- package/README.md +1 -0
- package/benchmark/report.html +1 -28
- package/benchmark/report.json +17 -326
- package/dist/{mjs/data-structures/binary-tree/avl-tree-multi-map.d.ts → cjs/data-structures/binary-tree/avl-tree-counter.d.ts} +54 -59
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +408 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -189
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +133 -357
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +108 -78
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +126 -79
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js +3 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +243 -190
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +273 -229
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +141 -122
- package/dist/cjs/data-structures/binary-tree/bst.js +170 -134
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/cjs/data-structures/binary-tree/index.js +2 -0
- package/dist/cjs/data-structures/binary-tree/index.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +84 -80
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +101 -79
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js.map +1 -1
- package/dist/{mjs/data-structures/binary-tree/tree-multi-map.d.ts → cjs/data-structures/binary-tree/tree-counter.d.ts} +54 -56
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +445 -0
- package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +78 -186
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +140 -388
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +3 -0
- package/dist/cjs/data-structures/graph/directed-graph.js +3 -0
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/map-graph.d.ts +3 -0
- package/dist/cjs/data-structures/graph/map-graph.js +3 -0
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +3 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js +3 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +3 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +3 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +3 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +3 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/matrix/matrix.d.ts +3 -0
- package/dist/cjs/data-structures/matrix/matrix.js +3 -0
- package/dist/cjs/data-structures/matrix/matrix.js.map +1 -1
- package/dist/cjs/data-structures/matrix/navigator.d.ts +3 -0
- package/dist/cjs/data-structures/matrix/navigator.js +3 -0
- package/dist/cjs/data-structures/matrix/navigator.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +3 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +3 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +0 -4
- package/dist/cjs/data-structures/trie/trie.js +0 -4
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +7 -6
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js +3 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -3
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +0 -2
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +0 -2
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +3 -2
- package/dist/cjs/types/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js +2 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -1
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -3
- package/dist/cjs/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-counter.js +3 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-counter.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -3
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
- package/dist/{mjs/data-structures/binary-tree/avl-tree-multi-map.js → esm/data-structures/binary-tree/avl-tree-counter.js} +72 -78
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -0
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +191 -0
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -0
- package/dist/esm/data-structures/binary-tree/avl-tree.d.ts +234 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/avl-tree.js +126 -80
- package/dist/esm/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/binary-indexed-tree.js +3 -0
- package/dist/esm/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/binary-tree.d.ts +243 -190
- package/dist/{mjs → esm}/data-structures/binary-tree/binary-tree.js +276 -234
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/bst.d.ts +141 -122
- package/dist/{mjs → esm}/data-structures/binary-tree/bst.js +171 -140
- package/dist/esm/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/index.js +2 -0
- package/dist/{mjs → esm}/data-structures/binary-tree/index.js.map +1 -1
- package/dist/{mjs → esm}/data-structures/binary-tree/red-black-tree.d.ts +84 -80
- package/dist/{mjs → esm}/data-structures/binary-tree/red-black-tree.js +100 -79
- package/dist/esm/data-structures/binary-tree/red-black-tree.js.map +1 -0
- package/dist/esm/data-structures/binary-tree/tree-counter.d.ts +212 -0
- package/dist/{mjs/data-structures/binary-tree/tree-multi-map.js → esm/data-structures/binary-tree/tree-counter.js} +88 -86
- package/dist/esm/data-structures/binary-tree/tree-counter.js.map +1 -0
- package/dist/esm/data-structures/binary-tree/tree-multi-map.d.ts +106 -0
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +196 -0
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/graph/directed-graph.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/graph/directed-graph.js +3 -0
- package/dist/esm/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/graph/map-graph.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/graph/map-graph.js +3 -0
- package/dist/esm/data-structures/graph/map-graph.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/graph/undirected-graph.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/graph/undirected-graph.js +3 -0
- package/dist/esm/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/linked-list/singly-linked-list.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/linked-list/singly-linked-list.js +3 -0
- package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/linked-list/skip-linked-list.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/linked-list/skip-linked-list.js +3 -0
- package/dist/esm/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/matrix/matrix.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/matrix/matrix.js +3 -0
- package/dist/esm/data-structures/matrix/matrix.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/matrix/navigator.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/matrix/navigator.js +3 -0
- package/dist/esm/data-structures/matrix/navigator.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/priority-queue/max-priority-queue.js +3 -0
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
- package/dist/{mjs → esm}/data-structures/priority-queue/min-priority-queue.js +3 -0
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/{mjs → esm}/data-structures/trie/trie.d.ts +0 -4
- package/dist/{mjs → esm}/data-structures/trie/trie.js +0 -4
- package/dist/esm/data-structures/trie/trie.js.map +1 -0
- package/dist/esm/interfaces/binary-tree.d.ts +9 -0
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js +2 -0
- package/dist/esm/types/data-structures/binary-tree/avl-tree-counter.js.map +1 -0
- package/dist/esm/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -0
- package/dist/esm/types/data-structures/binary-tree/avl-tree.d.ts +2 -0
- package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.d.ts +0 -2
- package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.d.ts +3 -2
- package/dist/{mjs → esm}/types/data-structures/binary-tree/index.d.ts +2 -0
- package/dist/{mjs → esm}/types/data-structures/binary-tree/index.js +2 -0
- package/dist/{mjs → esm}/types/data-structures/binary-tree/index.js.map +1 -1
- package/dist/esm/types/data-structures/binary-tree/rb-tree.d.ts +3 -0
- package/dist/esm/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
- package/dist/esm/types/data-structures/binary-tree/tree-counter.js +2 -0
- package/dist/esm/types/data-structures/binary-tree/tree-counter.js.map +1 -0
- package/dist/esm/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -0
- package/dist/umd/data-structure-typed.js +1407 -913
- package/dist/umd/data-structure-typed.min.js +5 -5
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +14 -14
- package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +148 -394
- package/src/data-structures/binary-tree/avl-tree.ts +152 -112
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
- package/src/data-structures/binary-tree/binary-tree.ts +446 -379
- package/src/data-structures/binary-tree/bst.ts +224 -201
- package/src/data-structures/binary-tree/index.ts +2 -0
- package/src/data-structures/binary-tree/red-black-tree.ts +138 -114
- package/src/data-structures/binary-tree/tree-counter.ts +504 -0
- package/src/data-structures/binary-tree/tree-multi-map.ts +156 -428
- package/src/data-structures/graph/directed-graph.ts +3 -0
- package/src/data-structures/graph/map-graph.ts +3 -0
- package/src/data-structures/graph/undirected-graph.ts +3 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +3 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
- package/src/data-structures/matrix/matrix.ts +3 -0
- package/src/data-structures/matrix/navigator.ts +3 -0
- package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
- package/src/data-structures/trie/trie.ts +0 -4
- package/src/interfaces/binary-tree.ts +10 -11
- package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -4
- package/src/types/data-structures/binary-tree/avl-tree.ts +0 -3
- package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
- package/src/types/data-structures/binary-tree/bst.ts +5 -3
- package/src/types/data-structures/binary-tree/index.ts +2 -0
- package/src/types/data-structures/binary-tree/rb-tree.ts +1 -4
- package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
- package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -4
- package/test/integration/all-in-one.test.ts +1 -1
- package/test/integration/avl-tree.test.ts +1 -1
- package/test/integration/bst.test.ts +2 -2
- package/test/integration/compile.js +144 -0
- package/test/integration/compile.ts +171 -0
- package/test/integration/index.html +48 -48
- package/test/performance/data-structures/binary-tree/avl-tree.test.ts +4 -4
- package/test/performance/data-structures/binary-tree/rb-tree.test.ts +5 -4
- package/test/performance/data-structures/comparison/comparison.test.ts +2 -2
- package/test/performance/reportor.ts +5 -3
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +877 -0
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +459 -761
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +223 -223
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +474 -492
- package/test/unit/data-structures/binary-tree/bst.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/overall.test.ts +0 -3
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +87 -90
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +975 -0
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +729 -857
- package/test/unit/data-structures/hash/hash-map.test.ts +1 -1
- package/{tsconfig-mjs.json → tsconfig-esm.json} +1 -1
- package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +0 -204
- package/dist/mjs/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/red-black-tree.js.map +0 -1
- package/dist/mjs/data-structures/binary-tree/tree-multi-map.js.map +0 -1
- package/dist/mjs/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/mjs/data-structures/graph/map-graph.js.map +0 -1
- package/dist/mjs/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/mjs/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/mjs/data-structures/matrix/matrix.js.map +0 -1
- package/dist/mjs/data-structures/matrix/navigator.js.map +0 -1
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/mjs/data-structures/trie/trie.js.map +0 -1
- package/dist/mjs/interfaces/binary-tree.d.ts +0 -8
- package/dist/mjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -4
- package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +0 -4
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +0 -5
- package/dist/mjs/types/data-structures/binary-tree/tree-multi-map.d.ts +0 -4
- /package/dist/{mjs → esm}/common/index.d.ts +0 -0
- /package/dist/{mjs → esm}/common/index.js +0 -0
- /package/dist/{mjs → esm}/common/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/base/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/base/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/base/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.js +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-element-base.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.js +0 -0
- /package/dist/{mjs → esm}/data-structures/base/iterable-entry-base.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.js +0 -0
- /package/dist/{mjs → esm}/data-structures/binary-tree/segment-tree.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.js +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/abstract-graph.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/graph/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/hash-map.js +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/hash-map.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/hash/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/heap.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/heap.js +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/heap.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/max-heap.js +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/max-heap.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/min-heap.js +0 -0
- /package/dist/{mjs → esm}/data-structures/heap/min-heap.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.js +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/doubly-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/linked-list/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/matrix/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/matrix/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.js +0 -0
- /package/dist/{mjs → esm}/data-structures/priority-queue/priority-queue.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/deque.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/deque.js +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/deque.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/queue.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/queue.js +0 -0
- /package/dist/{mjs → esm}/data-structures/queue/queue.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/stack.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/stack.js +0 -0
- /package/dist/{mjs → esm}/data-structures/stack/stack.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/index.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/tree.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/tree.js +0 -0
- /package/dist/{mjs → esm}/data-structures/tree/tree.js.map +0 -0
- /package/dist/{mjs → esm}/data-structures/trie/index.d.ts +0 -0
- /package/dist/{mjs → esm}/data-structures/trie/index.js +0 -0
- /package/dist/{mjs → esm}/data-structures/trie/index.js.map +0 -0
- /package/dist/{mjs → esm}/index.d.ts +0 -0
- /package/dist/{mjs → esm}/index.js +0 -0
- /package/dist/{mjs → esm}/index.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/binary-tree.js +0 -0
- /package/dist/{mjs → esm}/interfaces/binary-tree.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/doubly-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/doubly-linked-list.js +0 -0
- /package/dist/{mjs → esm}/interfaces/doubly-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/graph.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/graph.js +0 -0
- /package/dist/{mjs → esm}/interfaces/graph.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/heap.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/heap.js +0 -0
- /package/dist/{mjs → esm}/interfaces/heap.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/index.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/index.js +0 -0
- /package/dist/{mjs → esm}/interfaces/index.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/navigator.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/navigator.js +0 -0
- /package/dist/{mjs → esm}/interfaces/navigator.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/priority-queue.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/priority-queue.js +0 -0
- /package/dist/{mjs → esm}/interfaces/priority-queue.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/segment-tree.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/segment-tree.js +0 -0
- /package/dist/{mjs → esm}/interfaces/segment-tree.js.map +0 -0
- /package/dist/{mjs → esm}/interfaces/singly-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/interfaces/singly-linked-list.js +0 -0
- /package/dist/{mjs → esm}/interfaces/singly-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/types/common.d.ts +0 -0
- /package/dist/{mjs → esm}/types/common.js +0 -0
- /package/dist/{mjs → esm}/types/common.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/base.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/base.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/base.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/base/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree-multi-map.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree-multi-map.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/avl-tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/binary-tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/bst.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/rb-tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/rb-tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/segment-tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/tree-multi-map.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/binary-tree/tree-multi-map.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/abstract-graph.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/directed-graph.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/map-graph.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/graph/undirected-graph.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/hash-map.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/hash/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/heap.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/heap.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/heap.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/max-heap.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/heap/min-heap.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/doubly-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/singly-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/linked-list/skip-linked-list.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/matrix.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/matrix/navigator.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/max-priority-queue.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/min-priority-queue.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/priority-queue/priority-queue.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/deque.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/deque.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/deque.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/queue.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/queue.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/queue/queue.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/stack.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/stack.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/stack/stack.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/tree.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/tree.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/tree/tree.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/index.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/trie.d.ts +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/trie.js +0 -0
- /package/dist/{mjs → esm}/types/data-structures/trie/trie.js.map +0 -0
- /package/dist/{mjs → esm}/types/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/index.js +0 -0
- /package/dist/{mjs → esm}/types/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/utils/index.d.ts +0 -0
- /package/dist/{mjs → esm}/types/utils/index.js +0 -0
- /package/dist/{mjs → esm}/types/utils/index.js.map +0 -0
- /package/dist/{mjs → esm}/types/utils/utils.d.ts +0 -0
- /package/dist/{mjs → esm}/types/utils/utils.js +0 -0
- /package/dist/{mjs → esm}/types/utils/utils.js.map +0 -0
- /package/dist/{mjs → esm}/types/utils/validate-type.d.ts +0 -0
- /package/dist/{mjs → esm}/types/utils/validate-type.js +0 -0
- /package/dist/{mjs → esm}/types/utils/validate-type.js.map +0 -0
- /package/dist/{mjs → esm}/utils/index.d.ts +0 -0
- /package/dist/{mjs → esm}/utils/index.js +0 -0
- /package/dist/{mjs → esm}/utils/index.js.map +0 -0
- /package/dist/{mjs → esm}/utils/number.d.ts +0 -0
- /package/dist/{mjs → esm}/utils/number.js +0 -0
- /package/dist/{mjs → esm}/utils/number.js.map +0 -0
- /package/dist/{mjs → esm}/utils/utils.d.ts +0 -0
- /package/dist/{mjs → esm}/utils/utils.js +0 -0
- /package/dist/{mjs → esm}/utils/utils.js.map +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { BinaryTreeNode } from '../../../data-structures';
|
|
2
1
|
import { IterationType, OptValue } from '../../common';
|
|
3
2
|
import { DFSOperation } from '../../../common';
|
|
4
|
-
export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>>>>>>>>;
|
|
5
3
|
export type ToEntryFn<K, V, R> = (rawElement: R) => BTNEntry<K, V>;
|
|
6
4
|
export type BinaryTreeOptions<K, V, R> = {
|
|
7
5
|
iterationType?: IterationType;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { BSTNode } from '../../../data-structures';
|
|
2
1
|
import type { BinaryTreeOptions } from './binary-tree';
|
|
3
2
|
import { Comparable } from '../../utils';
|
|
4
|
-
|
|
3
|
+
import { OptValue } from '../../common';
|
|
5
4
|
export type BSTOptions<K, V, R> = BinaryTreeOptions<K, V, R> & {
|
|
6
5
|
specifyComparable?: (key: K) => Comparable;
|
|
7
6
|
isReverse?: boolean;
|
|
8
7
|
};
|
|
9
8
|
export type BSTNOptKey<K> = K | undefined;
|
|
10
9
|
export type OptNode<NODE> = NODE | undefined;
|
|
10
|
+
export type BSTNEntry<K, V> = [BSTNOptKey<K>, OptValue<V>];
|
|
11
11
|
export type BSTNOptKeyOrNode<K, NODE> = BSTNOptKey<K> | NODE;
|
|
12
|
+
export type BSTNRep<K, V, NODE> = BSTNEntry<K, V> | BSTNOptKeyOrNode<K, NODE>;
|
|
@@ -21,4 +21,6 @@ __exportStar(require("./segment-tree"), exports);
|
|
|
21
21
|
__exportStar(require("./avl-tree-multi-map"), exports);
|
|
22
22
|
__exportStar(require("./rb-tree"), exports);
|
|
23
23
|
__exportStar(require("./tree-multi-map"), exports);
|
|
24
|
+
__exportStar(require("./tree-counter"), exports);
|
|
25
|
+
__exportStar(require("./avl-tree-counter"), exports);
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/data-structures/binary-tree/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wCAAsB;AACtB,6CAA2B;AAC3B,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/data-structures/binary-tree/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wCAAsB;AACtB,6CAA2B;AAC3B,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,mDAAiC;AACjC,iDAA+B;AAC/B,qDAAmC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { RedBlackTreeNode } from '../../../data-structures';
|
|
2
1
|
import type { BSTOptions } from './bst';
|
|
3
2
|
export type RBTNColor = 'RED' | 'BLACK';
|
|
4
|
-
export type
|
|
5
|
-
export type RedBlackTreeOptions<K, V, R> = Omit<BSTOptions<K, V, R>, 'isReverse'> & {};
|
|
3
|
+
export type RedBlackTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-counter.js","sourceRoot":"","sources":["../../../../../src/types/data-structures/binary-tree/tree-counter.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { TreeMultiMapNode } from '../../../data-structures';
|
|
2
1
|
import type { RedBlackTreeOptions } from './rb-tree';
|
|
3
|
-
export type
|
|
4
|
-
export type TreeMultiMapOptions<K, V, R> = RedBlackTreeOptions<K, V, R> & {};
|
|
2
|
+
export type TreeMultiMapOptions<K, V, R> = Omit<RedBlackTreeOptions<K, V, R>, 'isMapMode'> & {};
|
|
@@ -0,0 +1,213 @@
|
|
|
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 { AVLTreeCounterOptions, BinaryTreeDeleteResult, BSTNOptKeyOrNode, BTNRep, EntryCallback, IterationType, OptNodeOrNull } from '../../types';
|
|
9
|
+
import { IBinaryTree } from '../../interfaces';
|
|
10
|
+
import { AVLTree, AVLTreeNode } from './avl-tree';
|
|
11
|
+
export declare class AVLTreeCounterNode<K = any, V = any> extends AVLTreeNode<K, V> {
|
|
12
|
+
/**
|
|
13
|
+
* The constructor function initializes a BinaryTreeNode object with a key, value, and count.
|
|
14
|
+
* @param {K} key - The `key` parameter is of type `K` and represents the unique identifier
|
|
15
|
+
* of the binary tree node.
|
|
16
|
+
* @param {V} [value] - The `value` parameter is an optional parameter of type `V`. It represents the value of the binary
|
|
17
|
+
* tree node. If no value is provided, it will be `undefined`.
|
|
18
|
+
* @param {number} [count=1] - The `count` parameter is a number that represents the number of times a particular value
|
|
19
|
+
* occurs in a binary tree node. It has a default value of 1, which means that if no value is provided for the `count`
|
|
20
|
+
* parameter when creating a new instance of the `BinaryTreeNode` class.
|
|
21
|
+
*/
|
|
22
|
+
constructor(key: K, value?: V, count?: number);
|
|
23
|
+
parent?: AVLTreeCounterNode<K, V>;
|
|
24
|
+
_left?: OptNodeOrNull<AVLTreeCounterNode<K, V>>;
|
|
25
|
+
get left(): OptNodeOrNull<AVLTreeCounterNode<K, V>>;
|
|
26
|
+
set left(v: OptNodeOrNull<AVLTreeCounterNode<K, V>>);
|
|
27
|
+
_right?: OptNodeOrNull<AVLTreeCounterNode<K, V>>;
|
|
28
|
+
get right(): OptNodeOrNull<AVLTreeCounterNode<K, V>>;
|
|
29
|
+
set right(v: OptNodeOrNull<AVLTreeCounterNode<K, V>>);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The only distinction between a AVLTreeCounter and a AVLTree lies in the ability of the former to store duplicate nodes through the utilization of counters.
|
|
33
|
+
*/
|
|
34
|
+
export declare class AVLTreeCounter<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends AVLTree<K, V, R, MK, MV, MR> implements IBinaryTree<K, V, R, MK, MV, MR> {
|
|
35
|
+
/**
|
|
36
|
+
* The constructor initializes a new AVLTreeCounter object with optional initial elements.
|
|
37
|
+
* @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter is an
|
|
38
|
+
* iterable object that can contain either keys, nodes, entries, or raw elements.
|
|
39
|
+
* @param [options] - The `options` parameter is an optional object that can be used to customize the
|
|
40
|
+
* behavior of the AVLTreeCounter. It can include properties such as `compareKeys` and
|
|
41
|
+
* `compareValues` functions to define custom comparison logic for keys and values, respectively.
|
|
42
|
+
*/
|
|
43
|
+
constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V, AVLTreeCounterNode<K, V>> | R>, options?: AVLTreeCounterOptions<K, V, R>);
|
|
44
|
+
protected _count: number;
|
|
45
|
+
/**
|
|
46
|
+
* The function calculates the sum of the count property of all nodes in a tree using depth-first
|
|
47
|
+
* search.
|
|
48
|
+
* @returns the sum of the count property of all nodes in the tree.
|
|
49
|
+
*/
|
|
50
|
+
get count(): number;
|
|
51
|
+
/**
|
|
52
|
+
* Time Complexity: O(n)
|
|
53
|
+
* Space Complexity: O(1)
|
|
54
|
+
*
|
|
55
|
+
* The function calculates the sum of the count property of all nodes in a tree using depth-first
|
|
56
|
+
* search.
|
|
57
|
+
* @returns the sum of the count property of all nodes in the tree.
|
|
58
|
+
*/
|
|
59
|
+
getComputedCount(): number;
|
|
60
|
+
/**
|
|
61
|
+
* The function creates a new AVLTreeCounterNode with the specified key, value, and count.
|
|
62
|
+
* @param {K} key - The key parameter represents the key of the node being created. It is of type K,
|
|
63
|
+
* which is a generic type that can be replaced with any specific type when using the function.
|
|
64
|
+
* @param {V} [value] - The `value` parameter is an optional parameter that represents the value
|
|
65
|
+
* associated with the key in the node. It is of type `V`, which can be any data type.
|
|
66
|
+
* @param {number} [count] - The `count` parameter represents the number of occurrences of a
|
|
67
|
+
* key-value pair in the AVLTreeCounterNode. It is an optional parameter, so it can be omitted when
|
|
68
|
+
* calling the `createNode` method. If provided, it specifies the initial count for the node.
|
|
69
|
+
* @returns a new instance of the AVLTreeCounterNode class, casted as AVLTreeCounterNode<K, V>.
|
|
70
|
+
*/
|
|
71
|
+
createNode(key: K, value?: V, count?: number): AVLTreeCounterNode<K, V>;
|
|
72
|
+
/**
|
|
73
|
+
* The function creates a new AVLTreeCounter object with the specified options and returns it.
|
|
74
|
+
* @param [options] - The `options` parameter is an optional object that contains additional
|
|
75
|
+
* configuration options for creating the AVLTreeCounter. It can have the following properties:
|
|
76
|
+
* @returns a new instance of the AVLTreeCounter class, with the specified options, as a TREE
|
|
77
|
+
* object.
|
|
78
|
+
*/
|
|
79
|
+
createTree(options?: AVLTreeCounterOptions<K, V, R>): AVLTreeCounter<K, V, R, MK, MV, MR>;
|
|
80
|
+
/**
|
|
81
|
+
* The function checks if the input is an instance of AVLTreeCounterNode.
|
|
82
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The parameter
|
|
83
|
+
* `keyNodeOrEntry` can be of type `R` or `BTNRep<K, V, AVLTreeCounterNode<K, V>>`.
|
|
84
|
+
* @returns a boolean value indicating whether the input parameter `keyNodeOrEntry` is
|
|
85
|
+
* an instance of the `AVLTreeCounterNode` class.
|
|
86
|
+
*/
|
|
87
|
+
isNode(keyNodeOrEntry: BTNRep<K, V, AVLTreeCounterNode<K, V>>): keyNodeOrEntry is AVLTreeCounterNode<K, V>;
|
|
88
|
+
/**
|
|
89
|
+
* Time Complexity: O(log n)
|
|
90
|
+
* Space Complexity: O(1)
|
|
91
|
+
*
|
|
92
|
+
* The function overrides the add method of a TypeScript class to add a new node to a data structure
|
|
93
|
+
* and update the count.
|
|
94
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The
|
|
95
|
+
* `keyNodeOrEntry` parameter can accept a value of type `R`, which can be any type. It
|
|
96
|
+
* can also accept a value of type `BTNRep<K, V, AVLTreeCounterNode<K, V>>`, which represents a key, node,
|
|
97
|
+
* entry, or raw element
|
|
98
|
+
* @param {V} [value] - The `value` parameter represents the value associated with the key in the
|
|
99
|
+
* data structure. It is an optional parameter, so it can be omitted if not needed.
|
|
100
|
+
* @param [count=1] - The `count` parameter represents the number of times the key-value pair should
|
|
101
|
+
* be added to the data structure. By default, it is set to 1, meaning that the key-value pair will
|
|
102
|
+
* be added once. However, you can specify a different value for `count` if you want to add
|
|
103
|
+
* @returns a boolean value.
|
|
104
|
+
*/
|
|
105
|
+
add(keyNodeOrEntry: BTNRep<K, V, AVLTreeCounterNode<K, V>>, value?: V, count?: number): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Time Complexity: O(log n)
|
|
108
|
+
* Space Complexity: O(1)
|
|
109
|
+
*
|
|
110
|
+
* The function overrides the delete method in a binary tree data structure, handling deletion of
|
|
111
|
+
* nodes and maintaining balance in the tree.
|
|
112
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The `predicate`
|
|
113
|
+
* parameter in the `delete` method is used to specify the condition for deleting a node from the
|
|
114
|
+
* binary tree. It can be a key, node, or entry that determines which
|
|
115
|
+
* node(s) should be deleted.
|
|
116
|
+
* @param [ignoreCount=false] - The `ignoreCount` parameter in the `override delete` method is a
|
|
117
|
+
* boolean flag that determines whether to ignore the count of the node being deleted. If
|
|
118
|
+
* `ignoreCount` is set to `true`, the method will delete the node regardless of its count. If
|
|
119
|
+
* `ignoreCount` is set to
|
|
120
|
+
* @returns The `delete` method overrides the default delete behavior in a binary tree data
|
|
121
|
+
* structure. It takes a predicate or node to be deleted and an optional flag to ignore count. The
|
|
122
|
+
* method returns an array of `BinaryTreeDeleteResult` objects, each containing information about the
|
|
123
|
+
* deleted node and whether balancing is needed in the tree.
|
|
124
|
+
*/
|
|
125
|
+
delete(keyNodeOrEntry: BTNRep<K, V, AVLTreeCounterNode<K, V>>, ignoreCount?: boolean): BinaryTreeDeleteResult<AVLTreeCounterNode<K, V>>[];
|
|
126
|
+
/**
|
|
127
|
+
* Time Complexity: O(1)
|
|
128
|
+
* Space Complexity: O(1)
|
|
129
|
+
*
|
|
130
|
+
* The "clear" function overrides the parent class's "clear" function and also resets the count to
|
|
131
|
+
* zero.
|
|
132
|
+
*/
|
|
133
|
+
clear(): void;
|
|
134
|
+
/**
|
|
135
|
+
* Time Complexity: O(n log n)
|
|
136
|
+
* Space Complexity: O(log n)
|
|
137
|
+
* The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
|
|
138
|
+
* tree using either a recursive or iterative approach.
|
|
139
|
+
* @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
|
|
140
|
+
* specifies the type of iteration to use when building the balanced binary search tree. It has a
|
|
141
|
+
* default value of `this.iterationType`, which means it will use the iteration type currently set in
|
|
142
|
+
* the object.
|
|
143
|
+
* @returns The function `perfectlyBalance` returns a boolean value. It returns `true` if the
|
|
144
|
+
* balancing operation is successful, and `false` if there are no nodes to balance.
|
|
145
|
+
*/
|
|
146
|
+
perfectlyBalance(iterationType?: IterationType): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Time complexity: O(n)
|
|
149
|
+
* Space complexity: O(n)
|
|
150
|
+
*
|
|
151
|
+
* The function overrides the clone method to create a deep copy of a tree object.
|
|
152
|
+
* @returns The `clone()` method is returning a cloned instance of the `TREE` object.
|
|
153
|
+
*/
|
|
154
|
+
clone(): AVLTreeCounter<K, V, R, MK, MV, MR>;
|
|
155
|
+
/**
|
|
156
|
+
* The `map` function in TypeScript overrides the default behavior to create a new AVLTreeCounter
|
|
157
|
+
* with modified entries based on a provided callback.
|
|
158
|
+
* @param callback - The `callback` parameter is a function that will be called for each entry in the
|
|
159
|
+
* AVLTreeCounter. It takes four arguments:
|
|
160
|
+
* @param [options] - The `options` parameter in the `override map` function is of type
|
|
161
|
+
* `AVLTreeCounterOptions<MK, MV, MR>`. This parameter allows you to provide additional
|
|
162
|
+
* configuration options when creating a new `AVLTreeCounter` instance within the `map` function.
|
|
163
|
+
* These options
|
|
164
|
+
* @param {any} [thisArg] - The `thisArg` parameter in the `override map` function is used to specify
|
|
165
|
+
* the value of `this` when executing the `callback` function. It allows you to set the context
|
|
166
|
+
* (value of `this`) for the callback function. This can be useful when you want to access properties
|
|
167
|
+
* or
|
|
168
|
+
* @returns The `map` method is returning a new `AVLTreeCounter` instance with the entries
|
|
169
|
+
* transformed by the provided `callback` function. Each entry in the original tree is passed to the
|
|
170
|
+
* `callback` function along with the index and the original tree itself. The transformed entries are
|
|
171
|
+
* then added to the new `AVLTreeCounter` instance, which is returned at the end.
|
|
172
|
+
*/
|
|
173
|
+
map<MK, MV, MR>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: AVLTreeCounterOptions<MK, MV, MR>, thisArg?: any): AVLTreeCounter<MK, MV, MR>;
|
|
174
|
+
/**
|
|
175
|
+
* The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
|
|
176
|
+
* a node object.
|
|
177
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The
|
|
178
|
+
* `keyNodeOrEntry` parameter can be of type `R` or `BTNRep<K, V, AVLTreeCounterNode<K, V>>`.
|
|
179
|
+
* @param {V} [value] - The `value` parameter is an optional value that can be passed to the
|
|
180
|
+
* `override` function. It represents the value associated with the key in the data structure. If no
|
|
181
|
+
* value is provided, it will default to `undefined`.
|
|
182
|
+
* @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
|
|
183
|
+
* times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
|
|
184
|
+
* @returns either a AVLTreeCounterNode<K, V> object or undefined.
|
|
185
|
+
*/
|
|
186
|
+
protected _keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry: BTNRep<K, V, AVLTreeCounterNode<K, V>>, value?: V, count?: number): [AVLTreeCounterNode<K, V> | undefined, V | undefined];
|
|
187
|
+
/**
|
|
188
|
+
* Time Complexity: O(1)
|
|
189
|
+
* Space Complexity: O(1)
|
|
190
|
+
*
|
|
191
|
+
* The `_swapProperties` function swaps the properties (key, value, count, height) between two nodes
|
|
192
|
+
* in a binary search tree.
|
|
193
|
+
* @param {BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>} srcNode - The `srcNode` parameter represents the source node
|
|
194
|
+
* that will be swapped with the `destNode`.
|
|
195
|
+
* @param {BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>} destNode - The `destNode` parameter represents the destination
|
|
196
|
+
* node where the properties will be swapped with the source node.
|
|
197
|
+
* @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
|
|
198
|
+
* If either `srcNode` or `destNode` is undefined, it returns `undefined`.
|
|
199
|
+
*/
|
|
200
|
+
protected _swapProperties(srcNode: BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>, destNode: BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>): AVLTreeCounterNode<K, V> | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Time Complexity: O(1)
|
|
203
|
+
* Space Complexity: O(1)
|
|
204
|
+
*
|
|
205
|
+
* The function replaces an old node with a new node and updates the count property of the new node.
|
|
206
|
+
* @param {AVLTreeCounterNode<K, V>} oldNode - The oldNode parameter represents the node that needs to be replaced in the
|
|
207
|
+
* data structure. It is of type AVLTreeCounterNode<K, V>.
|
|
208
|
+
* @param {AVLTreeCounterNode<K, V>} newNode - The `newNode` parameter is an instance of the `AVLTreeCounterNode<K, V>` class.
|
|
209
|
+
* @returns The method is returning the result of calling the `_replaceNode` method from the
|
|
210
|
+
* superclass, which is of type `AVLTreeCounterNode<K, V>`.
|
|
211
|
+
*/
|
|
212
|
+
protected _replaceNode(oldNode: AVLTreeCounterNode<K, V>, newNode: AVLTreeCounterNode<K, V>): AVLTreeCounterNode<K, V>;
|
|
213
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AVLTree, AVLTreeNode } from './avl-tree';
|
|
2
|
-
export class
|
|
2
|
+
export class AVLTreeCounterNode extends AVLTreeNode {
|
|
3
3
|
/**
|
|
4
4
|
* The constructor function initializes a BinaryTreeNode object with a key, value, and count.
|
|
5
5
|
* @param {K} key - The `key` parameter is of type `K` and represents the unique identifier
|
|
@@ -14,33 +14,38 @@ export class AVLTreeMultiMapNode extends AVLTreeNode {
|
|
|
14
14
|
super(key, value);
|
|
15
15
|
this.count = count;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
get count() {
|
|
23
|
-
return this._count;
|
|
17
|
+
parent = undefined;
|
|
18
|
+
_left = undefined;
|
|
19
|
+
get left() {
|
|
20
|
+
return this._left;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
set left(v) {
|
|
23
|
+
if (v) {
|
|
24
|
+
v.parent = this;
|
|
25
|
+
}
|
|
26
|
+
this._left = v;
|
|
27
|
+
}
|
|
28
|
+
_right = undefined;
|
|
29
|
+
get right() {
|
|
30
|
+
return this._right;
|
|
31
|
+
}
|
|
32
|
+
set right(v) {
|
|
33
|
+
if (v) {
|
|
34
|
+
v.parent = this;
|
|
35
|
+
}
|
|
36
|
+
this._right = v;
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
|
-
* The only distinction between a
|
|
40
|
+
* The only distinction between a AVLTreeCounter and a AVLTree lies in the ability of the former to store duplicate nodes through the utilization of counters.
|
|
36
41
|
*/
|
|
37
|
-
export class
|
|
42
|
+
export class AVLTreeCounter extends AVLTree {
|
|
38
43
|
/**
|
|
39
|
-
* The constructor initializes a new
|
|
44
|
+
* The constructor initializes a new AVLTreeCounter object with optional initial elements.
|
|
40
45
|
* @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter is an
|
|
41
46
|
* iterable object that can contain either keys, nodes, entries, or raw elements.
|
|
42
47
|
* @param [options] - The `options` parameter is an optional object that can be used to customize the
|
|
43
|
-
* behavior of the
|
|
48
|
+
* behavior of the AVLTreeCounter. It can include properties such as `compareKeys` and
|
|
44
49
|
* `compareValues` functions to define custom comparison logic for keys and values, respectively.
|
|
45
50
|
*/
|
|
46
51
|
constructor(keysNodesEntriesOrRaws = [], options) {
|
|
@@ -71,29 +76,28 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
71
76
|
return sum;
|
|
72
77
|
}
|
|
73
78
|
/**
|
|
74
|
-
* The function creates a new
|
|
79
|
+
* The function creates a new AVLTreeCounterNode with the specified key, value, and count.
|
|
75
80
|
* @param {K} key - The key parameter represents the key of the node being created. It is of type K,
|
|
76
81
|
* which is a generic type that can be replaced with any specific type when using the function.
|
|
77
82
|
* @param {V} [value] - The `value` parameter is an optional parameter that represents the value
|
|
78
83
|
* associated with the key in the node. It is of type `V`, which can be any data type.
|
|
79
84
|
* @param {number} [count] - The `count` parameter represents the number of occurrences of a
|
|
80
|
-
* key-value pair in the
|
|
85
|
+
* key-value pair in the AVLTreeCounterNode. It is an optional parameter, so it can be omitted when
|
|
81
86
|
* calling the `createNode` method. If provided, it specifies the initial count for the node.
|
|
82
|
-
* @returns a new instance of the
|
|
87
|
+
* @returns a new instance of the AVLTreeCounterNode class, casted as AVLTreeCounterNode<K, V>.
|
|
83
88
|
*/
|
|
84
89
|
createNode(key, value, count) {
|
|
85
|
-
return new
|
|
90
|
+
return new AVLTreeCounterNode(key, this._isMapMode ? undefined : value, count);
|
|
86
91
|
}
|
|
87
92
|
/**
|
|
88
|
-
* The function creates a new
|
|
93
|
+
* The function creates a new AVLTreeCounter object with the specified options and returns it.
|
|
89
94
|
* @param [options] - The `options` parameter is an optional object that contains additional
|
|
90
|
-
* configuration options for creating the
|
|
91
|
-
* @returns a new instance of the
|
|
95
|
+
* configuration options for creating the AVLTreeCounter. It can have the following properties:
|
|
96
|
+
* @returns a new instance of the AVLTreeCounter class, with the specified options, as a TREE
|
|
92
97
|
* object.
|
|
93
98
|
*/
|
|
94
|
-
// @ts-ignore
|
|
95
99
|
createTree(options) {
|
|
96
|
-
return new
|
|
100
|
+
return new AVLTreeCounter([], {
|
|
97
101
|
iterationType: this.iterationType,
|
|
98
102
|
isMapMode: this._isMapMode,
|
|
99
103
|
specifyComparable: this._specifyComparable,
|
|
@@ -103,14 +107,14 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
/**
|
|
106
|
-
* The function checks if the input is an instance of
|
|
107
|
-
* @param {BTNRep<K, V,
|
|
108
|
-
* `
|
|
109
|
-
* @returns a boolean value indicating whether the input parameter `
|
|
110
|
-
* an instance of the `
|
|
110
|
+
* The function checks if the input is an instance of AVLTreeCounterNode.
|
|
111
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The parameter
|
|
112
|
+
* `keyNodeOrEntry` can be of type `R` or `BTNRep<K, V, AVLTreeCounterNode<K, V>>`.
|
|
113
|
+
* @returns a boolean value indicating whether the input parameter `keyNodeOrEntry` is
|
|
114
|
+
* an instance of the `AVLTreeCounterNode` class.
|
|
111
115
|
*/
|
|
112
|
-
isNode(
|
|
113
|
-
return
|
|
116
|
+
isNode(keyNodeOrEntry) {
|
|
117
|
+
return keyNodeOrEntry instanceof AVLTreeCounterNode;
|
|
114
118
|
}
|
|
115
119
|
/**
|
|
116
120
|
* Time Complexity: O(log n)
|
|
@@ -118,9 +122,9 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
118
122
|
*
|
|
119
123
|
* The function overrides the add method of a TypeScript class to add a new node to a data structure
|
|
120
124
|
* and update the count.
|
|
121
|
-
* @param {BTNRep<K, V,
|
|
122
|
-
* `
|
|
123
|
-
* can also accept a value of type `BTNRep<K, V,
|
|
125
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The
|
|
126
|
+
* `keyNodeOrEntry` parameter can accept a value of type `R`, which can be any type. It
|
|
127
|
+
* can also accept a value of type `BTNRep<K, V, AVLTreeCounterNode<K, V>>`, which represents a key, node,
|
|
124
128
|
* entry, or raw element
|
|
125
129
|
* @param {V} [value] - The `value` parameter represents the value associated with the key in the
|
|
126
130
|
* data structure. It is an optional parameter, so it can be omitted if not needed.
|
|
@@ -129,8 +133,8 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
129
133
|
* be added once. However, you can specify a different value for `count` if you want to add
|
|
130
134
|
* @returns a boolean value.
|
|
131
135
|
*/
|
|
132
|
-
add(
|
|
133
|
-
const [newNode, newValue] = this.
|
|
136
|
+
add(keyNodeOrEntry, value, count = 1) {
|
|
137
|
+
const [newNode, newValue] = this._keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry, value, count);
|
|
134
138
|
if (newNode === undefined)
|
|
135
139
|
return false;
|
|
136
140
|
const orgNodeCount = newNode?.count || 0;
|
|
@@ -146,7 +150,7 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
146
150
|
*
|
|
147
151
|
* The function overrides the delete method in a binary tree data structure, handling deletion of
|
|
148
152
|
* nodes and maintaining balance in the tree.
|
|
149
|
-
* @param {BTNRep<K, V,
|
|
153
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The `predicate`
|
|
150
154
|
* parameter in the `delete` method is used to specify the condition for deleting a node from the
|
|
151
155
|
* binary tree. It can be a key, node, or entry that determines which
|
|
152
156
|
* node(s) should be deleted.
|
|
@@ -159,11 +163,11 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
159
163
|
* method returns an array of `BinaryTreeDeleteResult` objects, each containing information about the
|
|
160
164
|
* deleted node and whether balancing is needed in the tree.
|
|
161
165
|
*/
|
|
162
|
-
delete(
|
|
166
|
+
delete(keyNodeOrEntry, ignoreCount = false) {
|
|
163
167
|
const deletedResult = [];
|
|
164
168
|
if (!this.root)
|
|
165
169
|
return deletedResult;
|
|
166
|
-
const curr = this.getNode(
|
|
170
|
+
const curr = this.getNode(keyNodeOrEntry) ?? undefined;
|
|
167
171
|
if (!curr)
|
|
168
172
|
return deletedResult;
|
|
169
173
|
const parent = curr?.parent ? curr.parent : undefined;
|
|
@@ -175,7 +179,7 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
175
179
|
else {
|
|
176
180
|
if (!curr.left) {
|
|
177
181
|
if (!parent) {
|
|
178
|
-
if (curr.right !== undefined)
|
|
182
|
+
if (curr.right !== undefined && curr.right !== null)
|
|
179
183
|
this._setRoot(curr.right);
|
|
180
184
|
}
|
|
181
185
|
else {
|
|
@@ -288,7 +292,6 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
288
292
|
* The function overrides the clone method to create a deep copy of a tree object.
|
|
289
293
|
* @returns The `clone()` method is returning a cloned instance of the `TREE` object.
|
|
290
294
|
*/
|
|
291
|
-
// @ts-ignore
|
|
292
295
|
clone() {
|
|
293
296
|
const cloned = this.createTree();
|
|
294
297
|
if (this._isMapMode)
|
|
@@ -300,26 +303,25 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
300
303
|
return cloned;
|
|
301
304
|
}
|
|
302
305
|
/**
|
|
303
|
-
* The `map` function in TypeScript overrides the default behavior to create a new
|
|
306
|
+
* The `map` function in TypeScript overrides the default behavior to create a new AVLTreeCounter
|
|
304
307
|
* with modified entries based on a provided callback.
|
|
305
308
|
* @param callback - The `callback` parameter is a function that will be called for each entry in the
|
|
306
|
-
*
|
|
309
|
+
* AVLTreeCounter. It takes four arguments:
|
|
307
310
|
* @param [options] - The `options` parameter in the `override map` function is of type
|
|
308
|
-
* `
|
|
309
|
-
* configuration options when creating a new `
|
|
311
|
+
* `AVLTreeCounterOptions<MK, MV, MR>`. This parameter allows you to provide additional
|
|
312
|
+
* configuration options when creating a new `AVLTreeCounter` instance within the `map` function.
|
|
310
313
|
* These options
|
|
311
314
|
* @param {any} [thisArg] - The `thisArg` parameter in the `override map` function is used to specify
|
|
312
315
|
* the value of `this` when executing the `callback` function. It allows you to set the context
|
|
313
316
|
* (value of `this`) for the callback function. This can be useful when you want to access properties
|
|
314
317
|
* or
|
|
315
|
-
* @returns The `map` method is returning a new `
|
|
318
|
+
* @returns The `map` method is returning a new `AVLTreeCounter` instance with the entries
|
|
316
319
|
* transformed by the provided `callback` function. Each entry in the original tree is passed to the
|
|
317
320
|
* `callback` function along with the index and the original tree itself. The transformed entries are
|
|
318
|
-
* then added to the new `
|
|
321
|
+
* then added to the new `AVLTreeCounter` instance, which is returned at the end.
|
|
319
322
|
*/
|
|
320
|
-
// @ts-ignore
|
|
321
323
|
map(callback, options, thisArg) {
|
|
322
|
-
const newTree = new
|
|
324
|
+
const newTree = new AVLTreeCounter([], options);
|
|
323
325
|
let index = 0;
|
|
324
326
|
for (const [key, value] of this) {
|
|
325
327
|
newTree.add(callback.call(thisArg, key, value, index++, this));
|
|
@@ -329,36 +331,28 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
329
331
|
/**
|
|
330
332
|
* The function `keyValueNodeEntryRawToNodeAndValue` converts a key, value, entry, or raw element into
|
|
331
333
|
* a node object.
|
|
332
|
-
* @param {BTNRep<K, V,
|
|
333
|
-
* `
|
|
334
|
+
* @param {BTNRep<K, V, AVLTreeCounterNode<K, V>>} keyNodeOrEntry - The
|
|
335
|
+
* `keyNodeOrEntry` parameter can be of type `R` or `BTNRep<K, V, AVLTreeCounterNode<K, V>>`.
|
|
334
336
|
* @param {V} [value] - The `value` parameter is an optional value that can be passed to the
|
|
335
337
|
* `override` function. It represents the value associated with the key in the data structure. If no
|
|
336
338
|
* value is provided, it will default to `undefined`.
|
|
337
339
|
* @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
|
|
338
340
|
* times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
|
|
339
|
-
* @returns either a
|
|
341
|
+
* @returns either a AVLTreeCounterNode<K, V> object or undefined.
|
|
340
342
|
*/
|
|
341
|
-
|
|
342
|
-
if (
|
|
343
|
+
_keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry, value, count = 1) {
|
|
344
|
+
if (keyNodeOrEntry === undefined || keyNodeOrEntry === null)
|
|
343
345
|
return [undefined, undefined];
|
|
344
|
-
if (this.isNode(
|
|
345
|
-
return [
|
|
346
|
-
if (this.isEntry(
|
|
347
|
-
const [key, entryValue] =
|
|
346
|
+
if (this.isNode(keyNodeOrEntry))
|
|
347
|
+
return [keyNodeOrEntry, value];
|
|
348
|
+
if (this.isEntry(keyNodeOrEntry)) {
|
|
349
|
+
const [key, entryValue] = keyNodeOrEntry;
|
|
348
350
|
if (key === undefined || key === null)
|
|
349
351
|
return [undefined, undefined];
|
|
350
352
|
const finalValue = value ?? entryValue;
|
|
351
353
|
return [this.createNode(key, finalValue, count), finalValue];
|
|
352
354
|
}
|
|
353
|
-
|
|
354
|
-
const [key, entryValue] = this._toEntryFn(keyNodeEntryOrRaw);
|
|
355
|
-
const finalValue = value ?? entryValue;
|
|
356
|
-
if (this.isKey(key))
|
|
357
|
-
return [this.createNode(key, finalValue, count), finalValue];
|
|
358
|
-
}
|
|
359
|
-
if (this.isKey(keyNodeEntryOrRaw))
|
|
360
|
-
return [this.createNode(keyNodeEntryOrRaw, value, count), value];
|
|
361
|
-
return [undefined, undefined];
|
|
355
|
+
return [this.createNode(keyNodeOrEntry, value, count), value];
|
|
362
356
|
}
|
|
363
357
|
/**
|
|
364
358
|
* Time Complexity: O(1)
|
|
@@ -366,9 +360,9 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
366
360
|
*
|
|
367
361
|
* The `_swapProperties` function swaps the properties (key, value, count, height) between two nodes
|
|
368
362
|
* in a binary search tree.
|
|
369
|
-
* @param {
|
|
363
|
+
* @param {BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>} srcNode - The `srcNode` parameter represents the source node
|
|
370
364
|
* that will be swapped with the `destNode`.
|
|
371
|
-
* @param {
|
|
365
|
+
* @param {BSTNOptKeyOrNode<K, AVLTreeCounterNode<K, V>>} destNode - The `destNode` parameter represents the destination
|
|
372
366
|
* node where the properties will be swapped with the source node.
|
|
373
367
|
* @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
|
|
374
368
|
* If either `srcNode` or `destNode` is undefined, it returns `undefined`.
|
|
@@ -401,15 +395,15 @@ export class AVLTreeMultiMap extends AVLTree {
|
|
|
401
395
|
* Space Complexity: O(1)
|
|
402
396
|
*
|
|
403
397
|
* The function replaces an old node with a new node and updates the count property of the new node.
|
|
404
|
-
* @param {
|
|
405
|
-
* data structure. It is of type
|
|
406
|
-
* @param {
|
|
398
|
+
* @param {AVLTreeCounterNode<K, V>} oldNode - The oldNode parameter represents the node that needs to be replaced in the
|
|
399
|
+
* data structure. It is of type AVLTreeCounterNode<K, V>.
|
|
400
|
+
* @param {AVLTreeCounterNode<K, V>} newNode - The `newNode` parameter is an instance of the `AVLTreeCounterNode<K, V>` class.
|
|
407
401
|
* @returns The method is returning the result of calling the `_replaceNode` method from the
|
|
408
|
-
* superclass, which is of type `
|
|
402
|
+
* superclass, which is of type `AVLTreeCounterNode<K, V>`.
|
|
409
403
|
*/
|
|
410
404
|
_replaceNode(oldNode, newNode) {
|
|
411
405
|
newNode.count = oldNode.count + newNode.count;
|
|
412
406
|
return super._replaceNode(oldNode, newNode);
|
|
413
407
|
}
|
|
414
408
|
}
|
|
415
|
-
//# sourceMappingURL=avl-tree-
|
|
409
|
+
//# sourceMappingURL=avl-tree-counter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avl-tree-counter.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree-counter.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,OAAO,kBAAqC,SAAQ,WAAiB;IACzE;;;;;;;;;OASG;IACH,YAAY,GAAM,EAAE,KAAS,EAAE,KAAK,GAAG,CAAC;QACtC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEQ,MAAM,GAA8B,SAAS,CAAC;IAE9C,KAAK,GAA6C,SAAS,CAAC;IAErE,IAAa,IAAI;QACf,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAa,IAAI,CAAC,CAA0C;QAC1D,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;IAEQ,MAAM,GAA6C,SAAS,CAAC;IAEtE,IAAa,KAAK;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAa,KAAK,CAAC,CAA0C;QAC3D,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,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