data-structure-typed 1.38.1 → 1.38.3
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 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.d.ts +9 -9
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/{lib → dist/cjs}/data-structures/binary-tree/bst.d.ts +4 -4
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/index.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -0
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/index.js.map +1 -0
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -0
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/hash-table.js.map +1 -0
- package/dist/cjs/data-structures/hash/index.js.map +1 -0
- package/dist/cjs/data-structures/hash/tree-map.js.map +1 -0
- package/dist/cjs/data-structures/hash/tree-set.js.map +1 -0
- package/dist/cjs/data-structures/heap/heap.js.map +1 -0
- package/dist/cjs/data-structures/heap/index.js.map +1 -0
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -0
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -0
- package/dist/cjs/data-structures/index.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/index.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/cjs/data-structures/matrix/index.js.map +1 -0
- package/dist/cjs/data-structures/matrix/matrix.js.map +1 -0
- package/{lib → dist/cjs}/data-structures/matrix/matrix2d.js +13 -5
- package/dist/cjs/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/cjs/data-structures/matrix/navigator.js.map +1 -0
- package/dist/cjs/data-structures/matrix/vector2d.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/index.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -0
- package/dist/cjs/data-structures/queue/deque.js.map +1 -0
- package/dist/cjs/data-structures/queue/index.js.map +1 -0
- package/dist/cjs/data-structures/queue/queue.js.map +1 -0
- package/dist/cjs/data-structures/stack/index.js.map +1 -0
- package/dist/cjs/data-structures/stack/stack.js.map +1 -0
- package/dist/cjs/data-structures/tree/index.js.map +1 -0
- package/dist/cjs/data-structures/tree/tree.js.map +1 -0
- package/dist/cjs/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/data-structures/trie/trie.js.map +1 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/binary-tree.js.map +1 -0
- package/dist/cjs/interfaces/doubly-linked-list.js.map +1 -0
- package/dist/{interfaces → cjs/interfaces}/graph.js.map +1 -1
- package/dist/{interfaces → cjs/interfaces}/heap.js.map +1 -1
- package/dist/cjs/interfaces/index.js.map +1 -0
- package/dist/{interfaces → cjs/interfaces}/navigator.js.map +1 -1
- package/dist/cjs/interfaces/priority-queue.js.map +1 -0
- package/dist/cjs/interfaces/segment-tree.js.map +1 -0
- package/dist/cjs/interfaces/singly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/{lib → dist/cjs}/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/index.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/cjs/types/data-structures/binary-tree/tree-multiset.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/abstract-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/index.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/map-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/hash-table.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/index.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/tree-map.js.map +1 -0
- package/dist/cjs/types/data-structures/hash/tree-set.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/heap.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/index.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/max-heap.js.map +1 -0
- package/dist/cjs/types/data-structures/heap/min-heap.js.map +1 -0
- package/dist/cjs/types/data-structures/index.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/index.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/matrix.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/navigator.js.map +1 -0
- package/dist/cjs/types/data-structures/matrix/vector2d.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/index.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/priority-queue/priority-queue.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/deque.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/index.js.map +1 -0
- package/dist/cjs/types/data-structures/queue/queue.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/index.js.map +1 -0
- package/dist/cjs/types/data-structures/stack/stack.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/index.js.map +1 -0
- package/dist/cjs/types/data-structures/tree/tree.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/index.js.map +1 -0
- package/dist/cjs/types/data-structures/trie/trie.js.map +1 -0
- package/{lib → dist/cjs}/types/helpers.d.ts +1 -1
- package/dist/cjs/types/helpers.js.map +1 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/utils/index.js.map +1 -0
- package/dist/{types → cjs/types}/utils/utils.js.map +1 -1
- package/dist/cjs/types/utils/validate-type.js.map +1 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/utils.js.map +1 -0
- package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.js +10 -4
- package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.js +12 -3
- package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.d.ts +9 -9
- package/{lib → dist/mjs}/data-structures/binary-tree/binary-tree.js +66 -49
- package/dist/{data-structures → mjs/data-structures}/binary-tree/bst.d.ts +4 -4
- package/{lib → dist/mjs}/data-structures/binary-tree/bst.js +42 -40
- package/dist/mjs/data-structures/binary-tree/index.js +23 -0
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +28 -0
- package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.js +17 -10
- package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.js +19 -13
- package/{lib → dist/mjs}/data-structures/graph/abstract-graph.js +29 -24
- package/{lib → dist/mjs}/data-structures/graph/directed-graph.js +22 -14
- package/dist/mjs/data-structures/graph/index.js +20 -0
- package/{lib → dist/mjs}/data-structures/graph/map-graph.js +14 -5
- package/{lib → dist/mjs}/data-structures/graph/undirected-graph.js +19 -13
- package/{lib → dist/mjs}/data-structures/hash/coordinate-map.js +6 -2
- package/{lib → dist/mjs}/data-structures/hash/coordinate-set.js +6 -2
- package/{lib → dist/mjs}/data-structures/hash/hash-map.js +11 -1
- package/{lib → dist/mjs}/data-structures/hash/hash-table.js +16 -4
- package/dist/mjs/data-structures/hash/index.js +22 -0
- package/dist/mjs/data-structures/hash/tree-map.js +6 -0
- package/dist/mjs/data-structures/hash/tree-set.js +6 -0
- package/{lib → dist/mjs}/data-structures/heap/heap.js +23 -7
- package/dist/mjs/data-structures/heap/index.js +19 -0
- package/{lib → dist/mjs}/data-structures/heap/max-heap.js +6 -2
- package/{lib → dist/mjs}/data-structures/heap/min-heap.js +6 -2
- package/dist/mjs/data-structures/index.js +27 -0
- package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.js +15 -6
- package/dist/mjs/data-structures/linked-list/index.js +19 -0
- package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.js +12 -2
- package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.js +14 -2
- package/dist/mjs/data-structures/matrix/index.js +20 -0
- package/{lib → dist/mjs}/data-structures/matrix/matrix.js +6 -1
- package/dist/{data-structures → mjs/data-structures}/matrix/matrix2d.js +5 -2
- package/{lib → dist/mjs}/data-structures/matrix/navigator.js +14 -2
- package/{lib → dist/mjs}/data-structures/matrix/vector2d.js +9 -2
- package/dist/mjs/data-structures/priority-queue/index.js +19 -0
- package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.js +6 -2
- package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.js +6 -2
- package/dist/mjs/data-structures/priority-queue/priority-queue.js +17 -0
- package/{lib → dist/mjs}/data-structures/queue/deque.js +21 -22
- package/dist/mjs/data-structures/queue/index.js +18 -0
- package/{lib → dist/mjs}/data-structures/queue/queue.js +11 -5
- package/dist/mjs/data-structures/stack/index.js +17 -0
- package/{lib → dist/mjs}/data-structures/stack/stack.js +6 -1
- package/dist/mjs/data-structures/tree/index.js +17 -0
- package/{lib → dist/mjs}/data-structures/tree/tree.js +8 -1
- package/dist/mjs/data-structures/trie/index.js +17 -0
- package/{lib → dist/mjs}/data-structures/trie/trie.js +12 -2
- package/dist/mjs/index.js +20 -0
- package/dist/mjs/interfaces/binary-tree.js +2 -0
- package/dist/mjs/interfaces/doubly-linked-list.js +2 -0
- package/dist/mjs/interfaces/graph.js +2 -0
- package/dist/mjs/interfaces/heap.js +2 -0
- package/dist/mjs/interfaces/index.js +24 -0
- package/dist/mjs/interfaces/navigator.js +2 -0
- package/dist/mjs/interfaces/priority-queue.js +2 -0
- package/dist/mjs/interfaces/segment-tree.js +2 -0
- package/dist/mjs/interfaces/singly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/avl-tree.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
- package/dist/{types → mjs/types}/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-tree.js +7 -4
- package/dist/mjs/types/data-structures/binary-tree/bst.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/index.js +22 -0
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.js +8 -0
- package/dist/mjs/types/data-structures/binary-tree/segment-tree.js +2 -0
- package/dist/mjs/types/data-structures/binary-tree/tree-multiset.js +2 -0
- package/dist/mjs/types/data-structures/graph/abstract-graph.js +2 -0
- package/dist/mjs/types/data-structures/graph/directed-graph.js +9 -0
- package/dist/mjs/types/data-structures/graph/index.js +19 -0
- package/dist/mjs/types/data-structures/graph/map-graph.js +2 -0
- package/dist/mjs/types/data-structures/graph/undirected-graph.js +2 -0
- package/dist/mjs/types/data-structures/hash/coordinate-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/coordinate-set.js +2 -0
- package/dist/mjs/types/data-structures/hash/hash-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/hash-table.js +2 -0
- package/dist/mjs/types/data-structures/hash/index.js +2 -0
- package/dist/mjs/types/data-structures/hash/tree-map.js +2 -0
- package/dist/mjs/types/data-structures/hash/tree-set.js +2 -0
- package/dist/mjs/types/data-structures/heap/heap.js +2 -0
- package/dist/mjs/types/data-structures/heap/index.js +17 -0
- package/dist/mjs/types/data-structures/heap/max-heap.js +2 -0
- package/dist/mjs/types/data-structures/heap/min-heap.js +2 -0
- package/dist/mjs/types/data-structures/index.js +27 -0
- package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/index.js +18 -0
- package/dist/mjs/types/data-structures/linked-list/singly-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.js +2 -0
- package/dist/mjs/types/data-structures/matrix/index.js +17 -0
- package/dist/mjs/types/data-structures/matrix/matrix.js +2 -0
- package/dist/mjs/types/data-structures/matrix/matrix2d.js +2 -0
- package/dist/mjs/types/data-structures/matrix/navigator.js +2 -0
- package/dist/mjs/types/data-structures/matrix/vector2d.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/index.js +19 -0
- package/dist/mjs/types/data-structures/priority-queue/max-priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/min-priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.js +2 -0
- package/dist/mjs/types/data-structures/queue/deque.js +2 -0
- package/dist/mjs/types/data-structures/queue/index.js +18 -0
- package/dist/mjs/types/data-structures/queue/queue.js +2 -0
- package/dist/mjs/types/data-structures/stack/index.js +17 -0
- package/dist/mjs/types/data-structures/stack/stack.js +2 -0
- package/dist/mjs/types/data-structures/tree/index.js +17 -0
- package/dist/mjs/types/data-structures/tree/tree.js +2 -0
- package/dist/mjs/types/data-structures/trie/index.js +17 -0
- package/dist/mjs/types/data-structures/trie/trie.js +2 -0
- package/dist/{types → mjs/types}/helpers.d.ts +1 -1
- package/dist/mjs/types/helpers.js +9 -0
- package/dist/mjs/types/index.js +19 -0
- package/dist/mjs/types/utils/index.js +18 -0
- package/dist/mjs/types/utils/utils.js +2 -0
- package/dist/mjs/types/utils/validate-type.js +2 -0
- package/dist/mjs/utils/index.js +17 -0
- package/dist/mjs/utils/utils.js +64 -0
- package/dist/umd/index.global.js +27 -0
- package/dist/umd/index.global.js.map +1 -0
- package/package.json +21 -23
- package/src/data-structures/binary-tree/binary-tree.ts +19 -19
- package/src/data-structures/binary-tree/bst.ts +7 -7
- package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
- package/src/types/helpers.ts +1 -1
- package/test/integration/index.html +3 -4
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +23 -7
- package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +2 -1
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +20 -1
- package/test/unit/data-structures/hash/hash-table.test.ts +1 -1
- package/test/unit/data-structures/matrix/navigator.test.ts +1 -1
- package/test/unit/data-structures/queue/deque.test.ts +1 -1
- package/test/unit/data-structures/queue/queue.test.ts +1 -1
- package/tsconfig-base.json +27 -0
- package/tsconfig-cjs.json +9 -0
- package/tsup.config.js +11 -0
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.map +1 -1
- package/dist/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/data-structures/binary-tree/index.js.map +0 -1
- package/dist/data-structures/binary-tree/rb-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/tree-multiset.js.map +0 -1
- package/dist/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/data-structures/graph/index.js.map +0 -1
- package/dist/data-structures/graph/map-graph.js.map +0 -1
- package/dist/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/data-structures/hash/hash-map.js.map +0 -1
- package/dist/data-structures/hash/hash-table.js.map +0 -1
- package/dist/data-structures/hash/index.js.map +0 -1
- package/dist/data-structures/hash/tree-map.js.map +0 -1
- package/dist/data-structures/hash/tree-set.js.map +0 -1
- package/dist/data-structures/heap/heap.js.map +0 -1
- package/dist/data-structures/heap/index.js.map +0 -1
- package/dist/data-structures/heap/max-heap.js.map +0 -1
- package/dist/data-structures/heap/min-heap.js.map +0 -1
- package/dist/data-structures/index.js.map +0 -1
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/data-structures/linked-list/index.js.map +0 -1
- package/dist/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/data-structures/matrix/index.js.map +0 -1
- package/dist/data-structures/matrix/matrix.js.map +0 -1
- package/dist/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/data-structures/matrix/navigator.js.map +0 -1
- package/dist/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/data-structures/priority-queue/index.js.map +0 -1
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/data-structures/queue/deque.js.map +0 -1
- package/dist/data-structures/queue/index.js.map +0 -1
- package/dist/data-structures/queue/queue.js.map +0 -1
- package/dist/data-structures/stack/index.js.map +0 -1
- package/dist/data-structures/stack/stack.js.map +0 -1
- package/dist/data-structures/tree/index.js.map +0 -1
- package/dist/data-structures/tree/tree.js.map +0 -1
- package/dist/data-structures/trie/index.js.map +0 -1
- package/dist/data-structures/trie/trie.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interfaces/binary-tree.js.map +0 -1
- package/dist/interfaces/doubly-linked-list.js.map +0 -1
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/priority-queue.js.map +0 -1
- package/dist/interfaces/segment-tree.js.map +0 -1
- package/dist/interfaces/singly-linked-list.js.map +0 -1
- package/dist/types/data-structures/binary-tree/avl-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree/binary-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree/bst.js.map +0 -1
- package/dist/types/data-structures/binary-tree/index.js.map +0 -1
- package/dist/types/data-structures/binary-tree/rb-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree/segment-tree.js.map +0 -1
- package/dist/types/data-structures/binary-tree/tree-multiset.js.map +0 -1
- package/dist/types/data-structures/graph/abstract-graph.js.map +0 -1
- package/dist/types/data-structures/graph/directed-graph.js.map +0 -1
- package/dist/types/data-structures/graph/index.js.map +0 -1
- package/dist/types/data-structures/graph/map-graph.js.map +0 -1
- package/dist/types/data-structures/graph/undirected-graph.js.map +0 -1
- package/dist/types/data-structures/hash/coordinate-map.js.map +0 -1
- package/dist/types/data-structures/hash/coordinate-set.js.map +0 -1
- package/dist/types/data-structures/hash/hash-map.js.map +0 -1
- package/dist/types/data-structures/hash/hash-table.js.map +0 -1
- package/dist/types/data-structures/hash/index.js.map +0 -1
- package/dist/types/data-structures/hash/tree-map.js.map +0 -1
- package/dist/types/data-structures/hash/tree-set.js.map +0 -1
- package/dist/types/data-structures/heap/heap.js.map +0 -1
- package/dist/types/data-structures/heap/index.js.map +0 -1
- package/dist/types/data-structures/heap/max-heap.js.map +0 -1
- package/dist/types/data-structures/heap/min-heap.js.map +0 -1
- package/dist/types/data-structures/index.js.map +0 -1
- package/dist/types/data-structures/linked-list/doubly-linked-list.js.map +0 -1
- package/dist/types/data-structures/linked-list/index.js.map +0 -1
- package/dist/types/data-structures/linked-list/singly-linked-list.js.map +0 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.js.map +0 -1
- package/dist/types/data-structures/matrix/index.js.map +0 -1
- package/dist/types/data-structures/matrix/matrix.js.map +0 -1
- package/dist/types/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/types/data-structures/matrix/navigator.js.map +0 -1
- package/dist/types/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/types/data-structures/priority-queue/index.js.map +0 -1
- package/dist/types/data-structures/priority-queue/max-priority-queue.js.map +0 -1
- package/dist/types/data-structures/priority-queue/min-priority-queue.js.map +0 -1
- package/dist/types/data-structures/priority-queue/priority-queue.js.map +0 -1
- package/dist/types/data-structures/queue/deque.js.map +0 -1
- package/dist/types/data-structures/queue/index.js.map +0 -1
- package/dist/types/data-structures/queue/queue.js.map +0 -1
- package/dist/types/data-structures/stack/index.js.map +0 -1
- package/dist/types/data-structures/stack/stack.js.map +0 -1
- package/dist/types/data-structures/tree/index.js.map +0 -1
- package/dist/types/data-structures/tree/tree.js.map +0 -1
- package/dist/types/data-structures/trie/index.js.map +0 -1
- package/dist/types/data-structures/trie/trie.js.map +0 -1
- package/dist/types/helpers.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/utils/index.js.map +0 -1
- package/dist/types/utils/validate-type.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/utils.js.map +0 -1
- package/lib/data-structures/binary-tree/index.js +0 -7
- package/lib/data-structures/binary-tree/rb-tree.js +0 -22
- package/lib/data-structures/graph/index.js +0 -4
- package/lib/data-structures/hash/index.js +0 -6
- package/lib/data-structures/hash/tree-map.js +0 -2
- package/lib/data-structures/hash/tree-set.js +0 -2
- package/lib/data-structures/heap/index.js +0 -3
- package/lib/data-structures/index.js +0 -11
- package/lib/data-structures/linked-list/index.js +0 -3
- package/lib/data-structures/matrix/index.js +0 -4
- package/lib/data-structures/priority-queue/index.js +0 -3
- package/lib/data-structures/priority-queue/priority-queue.js +0 -13
- package/lib/data-structures/queue/index.js +0 -2
- package/lib/data-structures/stack/index.js +0 -1
- package/lib/data-structures/tree/index.js +0 -1
- package/lib/data-structures/trie/index.js +0 -1
- package/lib/index.js +0 -4
- package/lib/interfaces/binary-tree.js +0 -1
- package/lib/interfaces/doubly-linked-list.js +0 -1
- package/lib/interfaces/graph.js +0 -1
- package/lib/interfaces/heap.js +0 -1
- package/lib/interfaces/index.js +0 -8
- package/lib/interfaces/navigator.js +0 -1
- package/lib/interfaces/priority-queue.js +0 -1
- package/lib/interfaces/segment-tree.js +0 -1
- package/lib/interfaces/singly-linked-list.js +0 -1
- package/lib/types/data-structures/binary-tree/avl-tree.js +0 -1
- package/lib/types/data-structures/binary-tree/binary-indexed-tree.js +0 -1
- package/lib/types/data-structures/binary-tree/bst.js +0 -1
- package/lib/types/data-structures/binary-tree/index.js +0 -6
- package/lib/types/data-structures/binary-tree/rb-tree.js +0 -5
- package/lib/types/data-structures/binary-tree/segment-tree.js +0 -1
- package/lib/types/data-structures/binary-tree/tree-multiset.js +0 -1
- package/lib/types/data-structures/graph/abstract-graph.js +0 -1
- package/lib/types/data-structures/graph/directed-graph.js +0 -6
- package/lib/types/data-structures/graph/index.js +0 -3
- package/lib/types/data-structures/graph/map-graph.js +0 -1
- package/lib/types/data-structures/graph/undirected-graph.js +0 -1
- package/lib/types/data-structures/hash/coordinate-map.js +0 -1
- package/lib/types/data-structures/hash/coordinate-set.js +0 -1
- package/lib/types/data-structures/hash/hash-map.js +0 -1
- package/lib/types/data-structures/hash/hash-table.js +0 -1
- package/lib/types/data-structures/hash/index.js +0 -1
- package/lib/types/data-structures/hash/tree-map.js +0 -1
- package/lib/types/data-structures/hash/tree-set.js +0 -1
- package/lib/types/data-structures/heap/heap.js +0 -1
- package/lib/types/data-structures/heap/index.js +0 -1
- package/lib/types/data-structures/heap/max-heap.js +0 -1
- package/lib/types/data-structures/heap/min-heap.js +0 -1
- package/lib/types/data-structures/index.js +0 -11
- package/lib/types/data-structures/linked-list/doubly-linked-list.js +0 -1
- package/lib/types/data-structures/linked-list/index.js +0 -2
- package/lib/types/data-structures/linked-list/singly-linked-list.js +0 -1
- package/lib/types/data-structures/linked-list/skip-linked-list.js +0 -1
- package/lib/types/data-structures/matrix/index.js +0 -1
- package/lib/types/data-structures/matrix/matrix.js +0 -1
- package/lib/types/data-structures/matrix/matrix2d.js +0 -1
- package/lib/types/data-structures/matrix/navigator.js +0 -1
- package/lib/types/data-structures/matrix/vector2d.js +0 -1
- package/lib/types/data-structures/priority-queue/index.js +0 -3
- package/lib/types/data-structures/priority-queue/max-priority-queue.js +0 -1
- package/lib/types/data-structures/priority-queue/min-priority-queue.js +0 -1
- package/lib/types/data-structures/priority-queue/priority-queue.js +0 -1
- package/lib/types/data-structures/queue/deque.js +0 -1
- package/lib/types/data-structures/queue/index.js +0 -2
- package/lib/types/data-structures/queue/queue.js +0 -1
- package/lib/types/data-structures/stack/index.js +0 -1
- package/lib/types/data-structures/stack/stack.js +0 -1
- package/lib/types/data-structures/tree/index.js +0 -1
- package/lib/types/data-structures/tree/tree.js +0 -1
- package/lib/types/data-structures/trie/index.js +0 -1
- package/lib/types/data-structures/trie/trie.js +0 -1
- package/lib/types/helpers.js +0 -6
- package/lib/types/index.js +0 -3
- package/lib/types/utils/index.js +0 -2
- package/lib/types/utils/utils.js +0 -1
- package/lib/types/utils/validate-type.js +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/utils.js +0 -63
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/avl-tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-indexed-tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/binary-tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/bst.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/rb-tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/segment-tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/binary-tree/tree-multiset.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/abstract-graph.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/directed-graph.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/map-graph.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/graph/undirected-graph.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-map.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/coordinate-set.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/hash-map.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/hash-table.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-map.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/hash/tree-set.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/heap.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/heap.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/max-heap.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/heap/min-heap.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/doubly-linked-list.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/singly-linked-list.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/linked-list/skip-linked-list.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/matrix.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/matrix2d.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/navigator.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/matrix/vector2d.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/max-priority-queue.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/min-priority-queue.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/priority-queue/priority-queue.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/deque.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/deque.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/queue.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/queue/queue.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/stack.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/stack/stack.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/tree.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/tree/tree.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/index.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/index.js +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/trie.d.ts +0 -0
- /package/dist/{data-structures → cjs/data-structures}/trie/trie.js +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{index.js → cjs/index.js} +0 -0
- /package/dist/{interfaces → cjs/interfaces}/binary-tree.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/binary-tree.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/doubly-linked-list.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/graph.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/graph.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/heap.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/heap.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/index.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/navigator.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/navigator.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/priority-queue.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/priority-queue.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/segment-tree.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/segment-tree.js +0 -0
- /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.d.ts +0 -0
- /package/dist/{interfaces → cjs/interfaces}/singly-linked-list.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/avl-tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-indexed-tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/binary-tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/bst.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/rb-tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/segment-tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/binary-tree/tree-multiset.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/abstract-graph.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/directed-graph.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/map-graph.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/map-graph.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/graph/undirected-graph.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/coordinate-map.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/coordinate-set.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/hash-map.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/hash-map.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/hash-table.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/hash-table.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/tree-map.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/tree-map.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/tree-set.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/hash/tree-set.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/heap.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/heap.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/max-heap.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/max-heap.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/min-heap.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/heap/min-heap.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/doubly-linked-list.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/singly-linked-list.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/linked-list/skip-linked-list.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/matrix.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/matrix.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/matrix2d.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/navigator.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/navigator.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/matrix/vector2d.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/max-priority-queue.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/min-priority-queue.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/priority-queue/priority-queue.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/deque.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/deque.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/queue.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/queue/queue.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/stack/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/stack/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/stack/stack.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/stack/stack.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/tree/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/tree/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/tree/tree.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/tree/tree.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/trie/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/trie/index.js +0 -0
- /package/dist/{types → cjs/types}/data-structures/trie/trie.d.ts +0 -0
- /package/dist/{types → cjs/types}/data-structures/trie/trie.js +0 -0
- /package/dist/{types → cjs/types}/helpers.js +0 -0
- /package/dist/{types → cjs/types}/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/index.js +0 -0
- /package/dist/{types → cjs/types}/utils/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/index.js +0 -0
- /package/dist/{types → cjs/types}/utils/utils.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/utils.js +0 -0
- /package/dist/{types → cjs/types}/utils/validate-type.d.ts +0 -0
- /package/dist/{types → cjs/types}/utils/validate-type.js +0 -0
- /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/index.js +0 -0
- /package/dist/{utils → cjs/utils}/utils.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/utils.js +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/avl-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/rb-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/binary-tree/tree-multiset.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/map-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/coordinate-map.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/coordinate-set.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/hash-map.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/hash-table.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/tree-map.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/hash/tree-set.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/heap/heap.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/heap/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/heap/max-heap.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/heap/min-heap.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/linked-list/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/matrix.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/matrix2d.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/navigator.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/matrix/vector2d.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/priority-queue/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/queue/deque.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/queue/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/queue/queue.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/stack/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/stack/stack.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/tree/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/tree/tree.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/trie/index.d.ts +0 -0
- /package/{lib → dist/mjs}/data-structures/trie/trie.d.ts +0 -0
- /package/{lib → dist/mjs}/index.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/binary-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/doubly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/graph.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/heap.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/index.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/navigator.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/segment-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/interfaces/singly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/avl-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/bst.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/rb-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/binary-tree/tree-multiset.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/graph/directed-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/graph/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/graph/map-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-map.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/coordinate-set.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/hash-map.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/hash-table.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/tree-map.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/hash/tree-set.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/heap/heap.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/heap/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/heap/max-heap.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/heap/min-heap.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/linked-list/doubly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/linked-list/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/linked-list/singly-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/matrix/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/matrix/matrix.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/matrix/matrix2d.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/matrix/navigator.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/matrix/vector2d.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/priority-queue/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/queue/deque.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/queue/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/queue/queue.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/stack/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/stack/stack.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/tree/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/tree/tree.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/trie/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/data-structures/trie/trie.d.ts +0 -0
- /package/{lib → dist/mjs}/types/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/index.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/utils.d.ts +0 -0
- /package/{lib → dist/mjs}/types/utils/validate-type.d.ts +0 -0
- /package/{lib → dist/mjs}/utils/index.d.ts +0 -0
- /package/{lib → dist/mjs}/utils/utils.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-structure-typed",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.3",
|
|
4
4
|
"description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "
|
|
7
|
-
"types": "
|
|
8
|
-
"
|
|
9
|
-
"umd:main": "umd/bundle.min.js",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/mjs/index.js",
|
|
7
|
+
"types": "dist/mjs/index.d.ts",
|
|
8
|
+
"umd:main": "dist/umd/index.global.js",
|
|
10
9
|
"exports": {
|
|
11
|
-
"
|
|
12
|
-
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/mjs/index.js",
|
|
12
|
+
"require": "./dist/cjs/index.js",
|
|
13
|
+
"types": "./dist/mjs/index.d.ts"
|
|
14
|
+
}
|
|
13
15
|
},
|
|
14
16
|
"scripts": {
|
|
15
|
-
"build": "npm run build:
|
|
16
|
-
"build:
|
|
17
|
-
"build:
|
|
18
|
-
"build:umd": "
|
|
17
|
+
"build": "npm run build:mjs && npm run build:cjs && npm run build:umd && npm run build:docs",
|
|
18
|
+
"build:mjs": "rm -rf dist/mjs && tsc -p tsconfig.json",
|
|
19
|
+
"build:cjs": "rm -rf dist/cjs && tsc -p tsconfig-cjs.json",
|
|
20
|
+
"build:umd": "tsup",
|
|
19
21
|
"build:docs": "typedoc --out docs ./src",
|
|
20
22
|
"check": "tsc --noEmit",
|
|
21
23
|
"lint:src": "eslint --fix 'src/**/*.{js,ts}'",
|
|
@@ -59,26 +61,25 @@
|
|
|
59
61
|
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
|
60
62
|
"@typescript-eslint/parser": "^6.7.4",
|
|
61
63
|
"auto-changelog": "^2.4.0",
|
|
62
|
-
"avl-tree-typed": "^1.38.
|
|
64
|
+
"avl-tree-typed": "^1.38.2",
|
|
63
65
|
"benchmark": "^2.1.4",
|
|
64
|
-
"binary-tree-typed": "^1.38.
|
|
65
|
-
"bst-typed": "^1.38.
|
|
66
|
+
"binary-tree-typed": "^1.38.2",
|
|
67
|
+
"bst-typed": "^1.38.2",
|
|
66
68
|
"dependency-cruiser": "^14.1.0",
|
|
67
69
|
"eslint": "^8.50.0",
|
|
68
70
|
"eslint-config-prettier": "^9.0.0",
|
|
69
71
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
70
72
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
71
73
|
"eslint-plugin-import": "^2.28.1",
|
|
72
|
-
"heap-typed": "^1.38.
|
|
74
|
+
"heap-typed": "^1.38.2",
|
|
73
75
|
"istanbul-badges-readme": "^1.8.5",
|
|
74
76
|
"jest": "^29.7.0",
|
|
75
77
|
"prettier": "^3.0.3",
|
|
76
78
|
"ts-jest": "^29.1.1",
|
|
77
79
|
"ts-loader": "^9.4.4",
|
|
80
|
+
"tsup": "^7.2.0",
|
|
78
81
|
"typedoc": "^0.25.1",
|
|
79
|
-
"typescript": "^5.2.2"
|
|
80
|
-
"webpack": "^5.88.2",
|
|
81
|
-
"webpack-cli": "^5.1.4"
|
|
82
|
+
"typescript": "^5.2.2"
|
|
82
83
|
},
|
|
83
84
|
"keywords": [
|
|
84
85
|
"data",
|
|
@@ -226,8 +227,5 @@
|
|
|
226
227
|
"tarjan",
|
|
227
228
|
"Tarjan",
|
|
228
229
|
"Tarjan's"
|
|
229
|
-
]
|
|
230
|
-
"dependencies": {
|
|
231
|
-
"data-structure-typed": "^1.37.5"
|
|
232
|
-
}
|
|
230
|
+
]
|
|
233
231
|
}
|
|
@@ -512,9 +512,9 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
512
512
|
* traverse the binary tree. It can have two possible values:
|
|
513
513
|
* @returns The function `getNodes` returns an array of nodes (`N[]`).
|
|
514
514
|
*/
|
|
515
|
-
getNodes(
|
|
515
|
+
getNodes<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
516
516
|
nodeProperty: BinaryTreeNodeKey | N,
|
|
517
|
-
callback:
|
|
517
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
518
518
|
onlyOne = false,
|
|
519
519
|
beginRoot: N | null = this.root,
|
|
520
520
|
iterationType = this.iterationType
|
|
@@ -570,9 +570,9 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
570
570
|
* performed when searching for nodes in the binary tree. It can have one of the following values:
|
|
571
571
|
* @returns a boolean value.
|
|
572
572
|
*/
|
|
573
|
-
has(
|
|
573
|
+
has<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
574
574
|
nodeProperty: BinaryTreeNodeKey | N,
|
|
575
|
-
callback:
|
|
575
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
576
576
|
beginRoot = this.root,
|
|
577
577
|
iterationType = this.iterationType
|
|
578
578
|
): boolean {
|
|
@@ -595,9 +595,9 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
595
595
|
* performed when searching for a node in the binary tree. It can have one of the following values:
|
|
596
596
|
* @returns either the found node (of type N) or null if no node is found.
|
|
597
597
|
*/
|
|
598
|
-
get(
|
|
598
|
+
get<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
599
599
|
nodeProperty: BinaryTreeNodeKey | N,
|
|
600
|
-
callback:
|
|
600
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
601
601
|
beginRoot = this.root,
|
|
602
602
|
iterationType = this.iterationType
|
|
603
603
|
): N | null {
|
|
@@ -761,11 +761,11 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
761
761
|
* performed on the binary tree. It can have two possible values:
|
|
762
762
|
* @returns The function `subTreeTraverse` returns an array of `MapCallbackReturn<N>`.
|
|
763
763
|
*/
|
|
764
|
-
subTreeTraverse(
|
|
765
|
-
callback:
|
|
764
|
+
subTreeTraverse<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
765
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
766
766
|
beginRoot: N | BinaryTreeNodeKey | null = this.root,
|
|
767
767
|
iterationType = this.iterationType
|
|
768
|
-
):
|
|
768
|
+
): ReturnType<C>[] {
|
|
769
769
|
if (typeof beginRoot === 'number') beginRoot = this.get(beginRoot);
|
|
770
770
|
|
|
771
771
|
const ans: MapCallbackReturn<N>[] = [];
|
|
@@ -808,12 +808,12 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
808
808
|
* iteration used in the depth-first search algorithm. It can have two possible values:
|
|
809
809
|
* @returns The function `dfs` returns an array of `MapCallbackReturn<N>` values.
|
|
810
810
|
*/
|
|
811
|
-
dfs(
|
|
812
|
-
callback:
|
|
811
|
+
dfs<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
812
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
813
813
|
pattern: DFSOrderPattern = 'in',
|
|
814
814
|
beginRoot: N | null = this.root,
|
|
815
815
|
iterationType: IterationType = IterationType.ITERATIVE
|
|
816
|
-
):
|
|
816
|
+
): ReturnType<C>[] {
|
|
817
817
|
if (!beginRoot) return [];
|
|
818
818
|
const ans: MapCallbackReturn<N>[] = [];
|
|
819
819
|
if (iterationType === IterationType.RECURSIVE) {
|
|
@@ -896,12 +896,12 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
896
896
|
* in the breadth-first search (BFS) algorithm. It can have two possible values:
|
|
897
897
|
* @returns The function `bfs` returns an array of `BFSCallbackReturn<N>[]`.
|
|
898
898
|
*/
|
|
899
|
-
bfs(
|
|
900
|
-
callback:
|
|
899
|
+
bfs<C extends BFSCallback<N> = BFSCallback<N, BinaryTreeNodeKey>>(
|
|
900
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
901
901
|
withLevel: boolean = false,
|
|
902
902
|
beginRoot: N | null = this.root,
|
|
903
903
|
iterationType = this.iterationType
|
|
904
|
-
):
|
|
904
|
+
): ReturnType<C>[] {
|
|
905
905
|
if (!beginRoot) return [];
|
|
906
906
|
|
|
907
907
|
const ans: BFSCallbackReturn<N>[] = [];
|
|
@@ -964,11 +964,11 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
964
964
|
* `beginRoot` is `null`, an empty array will be returned.
|
|
965
965
|
* @returns The `morris` function returns an array of `MapCallbackReturn<N>` values.
|
|
966
966
|
*/
|
|
967
|
-
morris(
|
|
968
|
-
callback:
|
|
967
|
+
morris<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
968
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
969
969
|
pattern: DFSOrderPattern = 'in',
|
|
970
970
|
beginRoot: N | null = this.root
|
|
971
|
-
):
|
|
971
|
+
): ReturnType<C>[] {
|
|
972
972
|
if (beginRoot === null) return [];
|
|
973
973
|
const ans: MapCallbackReturn<N>[] = [];
|
|
974
974
|
|
|
@@ -1078,7 +1078,7 @@ export class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode>
|
|
|
1078
1078
|
* This is because the purpose of the Morris algorithm is to save space rather than permanently alter the tree's shape.
|
|
1079
1079
|
*/
|
|
1080
1080
|
|
|
1081
|
-
protected _defaultCallbackByKey:
|
|
1081
|
+
protected _defaultCallbackByKey: (node: N) => number = node => node.key;
|
|
1082
1082
|
|
|
1083
1083
|
/**
|
|
1084
1084
|
* The function `_addTo` adds a new node to a binary tree if there is an available position.
|
|
@@ -238,9 +238,9 @@ export class BST<N extends BSTNode<N['val'], N> = BSTNode> extends BinaryTree<N>
|
|
|
238
238
|
* @returns either the first node that matches the given nodeProperty and callback, or null if no
|
|
239
239
|
* matching node is found.
|
|
240
240
|
*/
|
|
241
|
-
override get(
|
|
241
|
+
override get<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
242
242
|
nodeProperty: BinaryTreeNodeKey | N,
|
|
243
|
-
callback:
|
|
243
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
244
244
|
beginRoot = this.root,
|
|
245
245
|
iterationType = this.iterationType
|
|
246
246
|
): N | null {
|
|
@@ -289,9 +289,9 @@ export class BST<N extends BSTNode<N['val'], N> = BSTNode> extends BinaryTree<N>
|
|
|
289
289
|
* traverse the binary tree. It can have one of the following values:
|
|
290
290
|
* @returns an array of nodes (N[]).
|
|
291
291
|
*/
|
|
292
|
-
override getNodes(
|
|
292
|
+
override getNodes<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
293
293
|
nodeProperty: BinaryTreeNodeKey | N,
|
|
294
|
-
callback:
|
|
294
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
295
295
|
onlyOne = false,
|
|
296
296
|
beginRoot: N | null = this.root,
|
|
297
297
|
iterationType = this.iterationType
|
|
@@ -363,12 +363,12 @@ export class BST<N extends BSTNode<N['val'], N> = BSTNode> extends BinaryTree<N>
|
|
|
363
363
|
* done recursively or iteratively. It can have two possible values:
|
|
364
364
|
* @returns The function `lesserOrGreaterTraverse` returns an array of `MapCallbackReturn<N>`.
|
|
365
365
|
*/
|
|
366
|
-
lesserOrGreaterTraverse(
|
|
367
|
-
callback:
|
|
366
|
+
lesserOrGreaterTraverse<C extends MapCallback<N> = MapCallback<N, BinaryTreeNodeKey>>(
|
|
367
|
+
callback: C = this._defaultCallbackByKey as C,
|
|
368
368
|
lesserOrGreater: CP = CP.lt,
|
|
369
369
|
targetNode: N | BinaryTreeNodeKey | null = this.root,
|
|
370
370
|
iterationType = this.iterationType
|
|
371
|
-
):
|
|
371
|
+
): ReturnType<C>[] {
|
|
372
372
|
if (typeof targetNode === 'number') targetNode = this.get(targetNode);
|
|
373
373
|
const ans: MapCallbackReturn<N>[] = [];
|
|
374
374
|
if (!targetNode) return ans;
|
|
@@ -24,7 +24,7 @@ export enum FamilyPosition {
|
|
|
24
24
|
|
|
25
25
|
export type BinaryTreeNodeKey = number;
|
|
26
26
|
|
|
27
|
-
export type BFSCallback<N> = (node: N, level?: number) =>
|
|
27
|
+
export type BFSCallback<N, D = any> = (node: N, level?: number) => D;
|
|
28
28
|
|
|
29
29
|
export type BFSCallbackReturn<N> = ReturnType<BFSCallback<N>>;
|
|
30
30
|
|
package/src/types/helpers.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type Comparator<T> = (a: T, b: T) => number;
|
|
|
2
2
|
|
|
3
3
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
|
4
4
|
|
|
5
|
-
export type MapCallback<N> = (node: N) =>
|
|
5
|
+
export type MapCallback<N, D = any> = (node: N) => D;
|
|
6
6
|
|
|
7
7
|
export type MapCallbackReturn<N> = ReturnType<MapCallback<N>>;
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset='UTF-8'>
|
|
5
5
|
<title>CDN Test</title>
|
|
6
|
-
<script src='https://cdn.jsdelivr.net/npm/data-structure-typed/umd/
|
|
6
|
+
<script src='https://cdn.jsdelivr.net/npm/data-structure-typed/dist/umd/index.global.js'></script>
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<div id='app'>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
$avlTreeSpan.innerText = 'AVLTree';
|
|
24
24
|
$avlTree.append($avlTreeSpan);
|
|
25
25
|
avlTree.add(1, 1);
|
|
26
|
-
console.log(avlTree.
|
|
26
|
+
console.log(avlTree.bfs());
|
|
27
27
|
$modules.append($avlTree);
|
|
28
28
|
|
|
29
29
|
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
console.log(performance.now() - startTime);
|
|
42
42
|
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
43
|
+
} catch (e) {
|
|
45
44
|
console.error(e);
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {AVLTree,
|
|
1
|
+
import {AVLTree, AVLTreeNode, CP} from '../../../../src';
|
|
2
2
|
|
|
3
3
|
describe('AVL Tree Test', () => {
|
|
4
4
|
it('should perform various operations on a AVL Tree', () => {
|
|
@@ -38,8 +38,7 @@ describe('AVL Tree Test', () => {
|
|
|
38
38
|
expect(dfs[dfs.length - 1].key).toBe(16);
|
|
39
39
|
|
|
40
40
|
tree.perfectlyBalance();
|
|
41
|
-
const bfs
|
|
42
|
-
tree.bfs(node => bfs.push(node));
|
|
41
|
+
const bfs = tree.bfs(node => node);
|
|
43
42
|
expect(tree.isPerfectlyBalanced()).toBe(true);
|
|
44
43
|
expect(bfs[0].key).toBe(8);
|
|
45
44
|
expect(bfs[bfs.length - 1].key).toBe(16);
|
|
@@ -98,16 +97,33 @@ describe('AVL Tree Test', () => {
|
|
|
98
97
|
expect(tree.getHeight()).toBe(1);
|
|
99
98
|
|
|
100
99
|
expect(tree.isAVLBalanced()).toBe(true);
|
|
101
|
-
const lastBFSIds =
|
|
102
|
-
tree.bfs(node => lastBFSIds.push(node.key));
|
|
100
|
+
const lastBFSIds = tree.bfs();
|
|
103
101
|
expect(lastBFSIds[0]).toBe(12);
|
|
104
102
|
expect(lastBFSIds[1]).toBe(2);
|
|
105
103
|
expect(lastBFSIds[2]).toBe(16);
|
|
106
104
|
|
|
107
|
-
const lastBFSNodes
|
|
108
|
-
tree.bfs(node => lastBFSNodes.push(node));
|
|
105
|
+
const lastBFSNodes = tree.bfs(node => node);
|
|
109
106
|
expect(lastBFSNodes[0].key).toBe(12);
|
|
110
107
|
expect(lastBFSNodes[1].key).toBe(2);
|
|
111
108
|
expect(lastBFSNodes[2].key).toBe(16);
|
|
112
109
|
});
|
|
113
110
|
});
|
|
111
|
+
|
|
112
|
+
describe('AVLTree APIs test', () => {
|
|
113
|
+
const avl = new AVLTree<AVLTreeNode<{id: number; text: string}>>();
|
|
114
|
+
beforeEach(() => {
|
|
115
|
+
avl.clear();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('add', () => {
|
|
119
|
+
avl.add(1);
|
|
120
|
+
const node2 = new AVLTreeNode(2);
|
|
121
|
+
avl.add(node2);
|
|
122
|
+
const node3 = new AVLTreeNode(3, {id: 3, text: 'text3'});
|
|
123
|
+
avl.add(node3);
|
|
124
|
+
avl.add(node3, {id: 3, text: 'text33'});
|
|
125
|
+
|
|
126
|
+
const bfsRes = avl.bfs(node => node.key, false);
|
|
127
|
+
expect(bfsRes[0]).toBe(2);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BinaryIndexedTree} from '../../../../src';
|
|
2
|
-
import {isDebugTest} from '../../../config';
|
|
2
|
+
// import {isDebugTest} from '../../../config';
|
|
3
3
|
|
|
4
4
|
// const isDebug = isDebugTest;
|
|
5
5
|
|
|
@@ -251,6 +251,7 @@ describe('BinaryIndexedTree additional tests', () => {
|
|
|
251
251
|
expect(bit.lowerBound(200)).toBe(10);
|
|
252
252
|
});
|
|
253
253
|
});
|
|
254
|
+
|
|
254
255
|
function loopUpperBoundTests(bit: BinaryIndexedTree, values: number[]) {
|
|
255
256
|
for (const value of values) {
|
|
256
257
|
const index = bit.upperBound(value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {BinaryTree, BinaryTreeNode} from '../../../../src';
|
|
1
|
+
import {AVLTree, AVLTreeNode, BinaryTree, BinaryTreeNode} from '../../../../src';
|
|
2
2
|
|
|
3
3
|
describe('BinaryTreeNode', () => {
|
|
4
4
|
it('should create an instance of BinaryTreeNode', () => {
|
|
@@ -194,3 +194,22 @@ describe('BinaryTree Morris Traversal', () => {
|
|
|
194
194
|
expect(node1?.right).toBe(node3);
|
|
195
195
|
});
|
|
196
196
|
});
|
|
197
|
+
|
|
198
|
+
describe('BinaryTree APIs test', () => {
|
|
199
|
+
const avl = new AVLTree<AVLTreeNode<{id: number; text: string}>>();
|
|
200
|
+
beforeEach(() => {
|
|
201
|
+
avl.clear();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('add', () => {
|
|
205
|
+
avl.add(1);
|
|
206
|
+
const node2 = new AVLTreeNode(2);
|
|
207
|
+
avl.add(node2);
|
|
208
|
+
const node3 = new AVLTreeNode(3, {id: 3, text: 'text3'});
|
|
209
|
+
avl.add(node3);
|
|
210
|
+
avl.add(node3, {id: 3, text: 'text33'});
|
|
211
|
+
|
|
212
|
+
const bfsRes = avl.bfs(node => node);
|
|
213
|
+
expect(bfsRes[0]?.key).toBe(2);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"baseUrl": "src",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"inlineSourceMap": false,
|
|
9
|
+
"lib": ["esnext"],
|
|
10
|
+
"listEmittedFiles": false,
|
|
11
|
+
"listFiles": false,
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"pretty": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"rootDir": "src",
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"strict": true,
|
|
19
|
+
"traceResolution": false,
|
|
20
|
+
"types": ["node", "jest"]
|
|
21
|
+
},
|
|
22
|
+
"compileOnSave": false,
|
|
23
|
+
"exclude": ["node_modules", "dist"],
|
|
24
|
+
"include": [
|
|
25
|
+
"./src/**/*.ts", // Include your .ts files
|
|
26
|
+
]
|
|
27
|
+
}
|