tree-multimap-typed 1.42.5
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/.dependency-cruiser.js +449 -0
- package/.eslintrc.js +65 -0
- package/.prettierignore +6 -0
- package/.prettierrc.js +16 -0
- package/LICENSE +21 -0
- package/README.md +527 -0
- package/coverage/clover.xml +14 -0
- package/coverage/coverage-final.json +96 -0
- package/coverage/coverage-summary.json +60 -0
- package/coverage/lcov-report/base.css +403 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +120 -0
- package/coverage/lcov-report/index.ts.html +110 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +206 -0
- package/coverage/lcov.info +14 -0
- package/dist/data-structures/binary-tree/avl-tree.d.ts +106 -0
- package/dist/data-structures/binary-tree/avl-tree.js +349 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +149 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +269 -0
- package/dist/data-structures/binary-tree/binary-tree.d.ts +322 -0
- package/dist/data-structures/binary-tree/binary-tree.js +1305 -0
- package/dist/data-structures/binary-tree/bst.d.ts +175 -0
- package/dist/data-structures/binary-tree/bst.js +546 -0
- package/dist/data-structures/binary-tree/index.d.ts +7 -0
- package/dist/data-structures/binary-tree/index.js +23 -0
- package/dist/data-structures/binary-tree/rb-tree.d.ts +93 -0
- package/dist/data-structures/binary-tree/rb-tree.js +434 -0
- package/dist/data-structures/binary-tree/segment-tree.d.ts +67 -0
- package/dist/data-structures/binary-tree/segment-tree.js +180 -0
- package/dist/data-structures/binary-tree/tree-multimap.d.ts +126 -0
- package/dist/data-structures/binary-tree/tree-multimap.js +358 -0
- package/dist/data-structures/graph/abstract-graph.d.ts +347 -0
- package/dist/data-structures/graph/abstract-graph.js +936 -0
- package/dist/data-structures/graph/directed-graph.d.ts +194 -0
- package/dist/data-structures/graph/directed-graph.js +404 -0
- package/dist/data-structures/graph/index.d.ts +4 -0
- package/dist/data-structures/graph/index.js +20 -0
- package/dist/data-structures/graph/map-graph.d.ts +73 -0
- package/dist/data-structures/graph/map-graph.js +93 -0
- package/dist/data-structures/graph/undirected-graph.d.ts +120 -0
- package/dist/data-structures/graph/undirected-graph.js +239 -0
- package/dist/data-structures/hash/coordinate-map.d.ts +44 -0
- package/dist/data-structures/hash/coordinate-map.js +62 -0
- package/dist/data-structures/hash/coordinate-set.d.ts +36 -0
- package/dist/data-structures/hash/coordinate-set.js +52 -0
- package/dist/data-structures/hash/hash-map.d.ts +50 -0
- package/dist/data-structures/hash/hash-map.js +153 -0
- package/dist/data-structures/hash/hash-table.d.ts +103 -0
- package/dist/data-structures/hash/hash-table.js +236 -0
- package/dist/data-structures/hash/index.d.ts +6 -0
- package/dist/data-structures/hash/index.js +22 -0
- package/dist/data-structures/hash/tree-map.d.ts +2 -0
- package/dist/data-structures/hash/tree-map.js +6 -0
- package/dist/data-structures/hash/tree-set.d.ts +2 -0
- package/dist/data-structures/hash/tree-set.js +6 -0
- package/dist/data-structures/heap/heap.d.ts +235 -0
- package/dist/data-structures/heap/heap.js +515 -0
- package/dist/data-structures/heap/index.d.ts +3 -0
- package/dist/data-structures/heap/index.js +19 -0
- package/dist/data-structures/heap/max-heap.d.ts +15 -0
- package/dist/data-structures/heap/max-heap.js +26 -0
- package/dist/data-structures/heap/min-heap.d.ts +15 -0
- package/dist/data-structures/heap/min-heap.js +26 -0
- package/dist/data-structures/index.d.ts +11 -0
- package/dist/data-structures/index.js +27 -0
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +253 -0
- package/dist/data-structures/linked-list/doubly-linked-list.js +569 -0
- package/dist/data-structures/linked-list/index.d.ts +3 -0
- package/dist/data-structures/linked-list/index.js +19 -0
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +232 -0
- package/dist/data-structures/linked-list/singly-linked-list.js +533 -0
- package/dist/data-structures/linked-list/skip-linked-list.d.ts +80 -0
- package/dist/data-structures/linked-list/skip-linked-list.js +187 -0
- package/dist/data-structures/matrix/index.d.ts +4 -0
- package/dist/data-structures/matrix/index.js +20 -0
- package/dist/data-structures/matrix/matrix.d.ts +21 -0
- package/dist/data-structures/matrix/matrix.js +28 -0
- package/dist/data-structures/matrix/matrix2d.d.ts +107 -0
- package/dist/data-structures/matrix/matrix2d.js +199 -0
- package/dist/data-structures/matrix/navigator.d.ts +52 -0
- package/dist/data-structures/matrix/navigator.js +106 -0
- package/dist/data-structures/matrix/vector2d.d.ts +200 -0
- package/dist/data-structures/matrix/vector2d.js +290 -0
- package/dist/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/data-structures/priority-queue/index.js +19 -0
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +15 -0
- package/dist/data-structures/priority-queue/max-priority-queue.js +26 -0
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +15 -0
- package/dist/data-structures/priority-queue/min-priority-queue.js +26 -0
- package/dist/data-structures/priority-queue/priority-queue.d.ts +15 -0
- package/dist/data-structures/priority-queue/priority-queue.js +17 -0
- package/dist/data-structures/queue/deque.d.ts +161 -0
- package/dist/data-structures/queue/deque.js +264 -0
- package/dist/data-structures/queue/index.d.ts +2 -0
- package/dist/data-structures/queue/index.js +18 -0
- package/dist/data-structures/queue/queue.d.ts +122 -0
- package/dist/data-structures/queue/queue.js +187 -0
- package/dist/data-structures/stack/index.d.ts +1 -0
- package/dist/data-structures/stack/index.js +17 -0
- package/dist/data-structures/stack/stack.d.ts +64 -0
- package/dist/data-structures/stack/stack.js +94 -0
- package/dist/data-structures/tree/index.d.ts +1 -0
- package/dist/data-structures/tree/index.js +17 -0
- package/dist/data-structures/tree/tree.d.ts +8 -0
- package/dist/data-structures/tree/tree.js +40 -0
- package/dist/data-structures/trie/index.d.ts +1 -0
- package/dist/data-structures/trie/index.js +17 -0
- package/dist/data-structures/trie/trie.d.ts +79 -0
- package/dist/data-structures/trie/trie.js +251 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/interfaces/binary-tree.d.ts +7 -0
- package/dist/interfaces/binary-tree.js +2 -0
- package/dist/interfaces/doubly-linked-list.d.ts +1 -0
- package/dist/interfaces/doubly-linked-list.js +2 -0
- package/dist/interfaces/graph.d.ts +5 -0
- package/dist/interfaces/graph.js +2 -0
- package/dist/interfaces/heap.d.ts +1 -0
- package/dist/interfaces/heap.js +2 -0
- package/dist/interfaces/index.d.ts +8 -0
- package/dist/interfaces/index.js +24 -0
- package/dist/interfaces/navigator.d.ts +1 -0
- package/dist/interfaces/navigator.js +2 -0
- package/dist/interfaces/priority-queue.d.ts +1 -0
- package/dist/interfaces/priority-queue.js +2 -0
- package/dist/interfaces/segment-tree.d.ts +1 -0
- package/dist/interfaces/segment-tree.js +2 -0
- package/dist/interfaces/singly-linked-list.d.ts +1 -0
- package/dist/interfaces/singly-linked-list.js +2 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +4 -0
- package/dist/types/data-structures/binary-tree/avl-tree.js +2 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +1 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.js +2 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +29 -0
- package/dist/types/data-structures/binary-tree/binary-tree.js +24 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +7 -0
- package/dist/types/data-structures/binary-tree/bst.js +2 -0
- package/dist/types/data-structures/binary-tree/index.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/index.js +22 -0
- package/dist/types/data-structures/binary-tree/rb-tree.d.ts +8 -0
- package/dist/types/data-structures/binary-tree/rb-tree.js +8 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +1 -0
- package/dist/types/data-structures/binary-tree/segment-tree.js +2 -0
- package/dist/types/data-structures/binary-tree/tree-multimap.d.ts +4 -0
- package/dist/types/data-structures/binary-tree/tree-multimap.js +2 -0
- package/dist/types/data-structures/graph/abstract-graph.d.ts +10 -0
- package/dist/types/data-structures/graph/abstract-graph.js +2 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +6 -0
- package/dist/types/data-structures/graph/directed-graph.js +9 -0
- package/dist/types/data-structures/graph/index.d.ts +3 -0
- package/dist/types/data-structures/graph/index.js +19 -0
- package/dist/types/data-structures/graph/map-graph.d.ts +1 -0
- package/dist/types/data-structures/graph/map-graph.js +2 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +1 -0
- package/dist/types/data-structures/graph/undirected-graph.js +2 -0
- package/dist/types/data-structures/hash/coordinate-map.d.ts +1 -0
- package/dist/types/data-structures/hash/coordinate-map.js +2 -0
- package/dist/types/data-structures/hash/coordinate-set.d.ts +1 -0
- package/dist/types/data-structures/hash/coordinate-set.js +2 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +1 -0
- package/dist/types/data-structures/hash/hash-map.js +2 -0
- package/dist/types/data-structures/hash/hash-table.d.ts +1 -0
- package/dist/types/data-structures/hash/hash-table.js +2 -0
- package/dist/types/data-structures/hash/index.d.ts +1 -0
- package/dist/types/data-structures/hash/index.js +2 -0
- package/dist/types/data-structures/hash/tree-map.d.ts +1 -0
- package/dist/types/data-structures/hash/tree-map.js +2 -0
- package/dist/types/data-structures/hash/tree-set.d.ts +1 -0
- package/dist/types/data-structures/hash/tree-set.js +2 -0
- package/dist/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/types/data-structures/heap/heap.js +2 -0
- package/dist/types/data-structures/heap/index.d.ts +1 -0
- package/dist/types/data-structures/heap/index.js +17 -0
- package/dist/types/data-structures/heap/max-heap.d.ts +1 -0
- package/dist/types/data-structures/heap/max-heap.js +2 -0
- package/dist/types/data-structures/heap/min-heap.d.ts +1 -0
- package/dist/types/data-structures/heap/min-heap.js +2 -0
- package/dist/types/data-structures/index.d.ts +11 -0
- package/dist/types/data-structures/index.js +27 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.js +2 -0
- package/dist/types/data-structures/linked-list/index.d.ts +2 -0
- package/dist/types/data-structures/linked-list/index.js +18 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +1 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.js +2 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +1 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.js +2 -0
- package/dist/types/data-structures/matrix/index.d.ts +1 -0
- package/dist/types/data-structures/matrix/index.js +17 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +1 -0
- package/dist/types/data-structures/matrix/matrix.js +2 -0
- package/dist/types/data-structures/matrix/matrix2d.d.ts +1 -0
- package/dist/types/data-structures/matrix/matrix2d.js +2 -0
- package/dist/types/data-structures/matrix/navigator.d.ts +14 -0
- package/dist/types/data-structures/matrix/navigator.js +2 -0
- package/dist/types/data-structures/matrix/vector2d.d.ts +1 -0
- package/dist/types/data-structures/matrix/vector2d.js +2 -0
- package/dist/types/data-structures/priority-queue/index.d.ts +3 -0
- package/dist/types/data-structures/priority-queue/index.js +19 -0
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -0
- package/dist/types/data-structures/priority-queue/max-priority-queue.js +2 -0
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +1 -0
- package/dist/types/data-structures/priority-queue/min-priority-queue.js +2 -0
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/types/data-structures/priority-queue/priority-queue.js +2 -0
- package/dist/types/data-structures/queue/deque.d.ts +1 -0
- package/dist/types/data-structures/queue/deque.js +2 -0
- package/dist/types/data-structures/queue/index.d.ts +2 -0
- package/dist/types/data-structures/queue/index.js +18 -0
- package/dist/types/data-structures/queue/queue.d.ts +1 -0
- package/dist/types/data-structures/queue/queue.js +2 -0
- package/dist/types/data-structures/stack/index.d.ts +1 -0
- package/dist/types/data-structures/stack/index.js +17 -0
- package/dist/types/data-structures/stack/stack.d.ts +1 -0
- package/dist/types/data-structures/stack/stack.js +2 -0
- package/dist/types/data-structures/tree/index.d.ts +1 -0
- package/dist/types/data-structures/tree/index.js +17 -0
- package/dist/types/data-structures/tree/tree.d.ts +1 -0
- package/dist/types/data-structures/tree/tree.js +2 -0
- package/dist/types/data-structures/trie/index.d.ts +1 -0
- package/dist/types/data-structures/trie/index.js +17 -0
- package/dist/types/data-structures/trie/trie.d.ts +1 -0
- package/dist/types/data-structures/trie/trie.js +2 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/types/helpers.js +9 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +19 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.js +18 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/dist/types/utils/utils.js +2 -0
- package/dist/types/utils/validate-type.d.ts +19 -0
- package/dist/types/utils/validate-type.js +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/utils.d.ts +20 -0
- package/dist/utils/utils.js +73 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +50 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1383 -0
- package/docs/classes/TreeMultiset.html +2376 -0
- package/docs/classes/TreeMultisetNode.html +313 -0
- package/docs/index.html +523 -0
- package/docs/modules.html +45 -0
- package/jest.config.js +8 -0
- package/package.json +184 -0
- package/src/data-structures/binary-tree/avl-tree.ts +352 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +306 -0
- package/src/data-structures/binary-tree/binary-tree.ts +1558 -0
- package/src/data-structures/binary-tree/bst.ts +564 -0
- package/src/data-structures/binary-tree/index.ts +7 -0
- package/src/data-structures/binary-tree/rb-tree.ts +486 -0
- package/src/data-structures/binary-tree/segment-tree.ts +190 -0
- package/src/data-structures/binary-tree/tree-multimap.ts +381 -0
- package/src/data-structures/graph/abstract-graph.ts +1056 -0
- package/src/data-structures/graph/directed-graph.ts +450 -0
- package/src/data-structures/graph/index.ts +4 -0
- package/src/data-structures/graph/map-graph.ts +106 -0
- package/src/data-structures/graph/undirected-graph.ts +260 -0
- package/src/data-structures/hash/coordinate-map.ts +63 -0
- package/src/data-structures/hash/coordinate-set.ts +52 -0
- package/src/data-structures/hash/hash-map.ts +185 -0
- package/src/data-structures/hash/hash-table.ts +268 -0
- package/src/data-structures/hash/index.ts +6 -0
- package/src/data-structures/hash/tree-map.ts +1 -0
- package/src/data-structures/hash/tree-set.ts +1 -0
- package/src/data-structures/heap/heap.ts +589 -0
- package/src/data-structures/heap/index.ts +3 -0
- package/src/data-structures/heap/max-heap.ts +26 -0
- package/src/data-structures/heap/min-heap.ts +26 -0
- package/src/data-structures/index.ts +11 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +605 -0
- package/src/data-structures/linked-list/index.ts +3 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +576 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +221 -0
- package/src/data-structures/matrix/index.ts +4 -0
- package/src/data-structures/matrix/matrix.ts +27 -0
- package/src/data-structures/matrix/matrix2d.ts +211 -0
- package/src/data-structures/matrix/navigator.ts +121 -0
- package/src/data-structures/matrix/vector2d.ts +314 -0
- package/src/data-structures/priority-queue/index.ts +3 -0
- package/src/data-structures/priority-queue/max-priority-queue.ts +25 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +25 -0
- package/src/data-structures/priority-queue/priority-queue.ts +16 -0
- package/src/data-structures/queue/deque.ts +281 -0
- package/src/data-structures/queue/index.ts +2 -0
- package/src/data-structures/queue/queue.ts +209 -0
- package/src/data-structures/stack/index.ts +1 -0
- package/src/data-structures/stack/stack.ts +102 -0
- package/src/data-structures/tree/index.ts +1 -0
- package/src/data-structures/tree/tree.ts +41 -0
- package/src/data-structures/trie/index.ts +1 -0
- package/src/data-structures/trie/trie.ts +262 -0
- package/src/index.ts +11 -0
- package/src/interfaces/binary-tree.ts +10 -0
- package/src/interfaces/doubly-linked-list.ts +1 -0
- package/src/interfaces/graph.ts +7 -0
- package/src/interfaces/heap.ts +1 -0
- package/src/interfaces/index.ts +8 -0
- package/src/interfaces/navigator.ts +1 -0
- package/src/interfaces/priority-queue.ts +1 -0
- package/src/interfaces/segment-tree.ts +1 -0
- package/src/interfaces/singly-linked-list.ts +1 -0
- package/src/types/data-structures/binary-tree/avl-tree.ts +5 -0
- package/src/types/data-structures/binary-tree/binary-indexed-tree.ts +1 -0
- package/src/types/data-structures/binary-tree/binary-tree.ts +31 -0
- package/src/types/data-structures/binary-tree/bst.ts +11 -0
- package/src/types/data-structures/binary-tree/index.ts +6 -0
- package/src/types/data-structures/binary-tree/rb-tree.ts +8 -0
- package/src/types/data-structures/binary-tree/segment-tree.ts +1 -0
- package/src/types/data-structures/binary-tree/tree-multimap.ts +6 -0
- package/src/types/data-structures/graph/abstract-graph.ts +11 -0
- package/src/types/data-structures/graph/directed-graph.ts +8 -0
- package/src/types/data-structures/graph/index.ts +3 -0
- package/src/types/data-structures/graph/map-graph.ts +1 -0
- package/src/types/data-structures/graph/undirected-graph.ts +1 -0
- package/src/types/data-structures/hash/coordinate-map.ts +1 -0
- package/src/types/data-structures/hash/coordinate-set.ts +1 -0
- package/src/types/data-structures/hash/hash-map.ts +1 -0
- package/src/types/data-structures/hash/hash-table.ts +1 -0
- package/src/types/data-structures/hash/index.ts +1 -0
- package/src/types/data-structures/hash/tree-map.ts +1 -0
- package/src/types/data-structures/hash/tree-set.ts +1 -0
- package/src/types/data-structures/heap/heap.ts +1 -0
- package/src/types/data-structures/heap/index.ts +1 -0
- package/src/types/data-structures/heap/max-heap.ts +1 -0
- package/src/types/data-structures/heap/min-heap.ts +1 -0
- package/src/types/data-structures/index.ts +11 -0
- package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -0
- package/src/types/data-structures/linked-list/index.ts +2 -0
- package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -0
- package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -0
- package/src/types/data-structures/matrix/index.ts +1 -0
- package/src/types/data-structures/matrix/matrix.ts +1 -0
- package/src/types/data-structures/matrix/matrix2d.ts +1 -0
- package/src/types/data-structures/matrix/navigator.ts +14 -0
- package/src/types/data-structures/matrix/vector2d.ts +1 -0
- package/src/types/data-structures/priority-queue/index.ts +3 -0
- package/src/types/data-structures/priority-queue/max-priority-queue.ts +1 -0
- package/src/types/data-structures/priority-queue/min-priority-queue.ts +1 -0
- package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
- package/src/types/data-structures/queue/deque.ts +1 -0
- package/src/types/data-structures/queue/index.ts +2 -0
- package/src/types/data-structures/queue/queue.ts +1 -0
- package/src/types/data-structures/stack/index.ts +1 -0
- package/src/types/data-structures/stack/stack.ts +1 -0
- package/src/types/data-structures/tree/index.ts +1 -0
- package/src/types/data-structures/tree/tree.ts +1 -0
- package/src/types/data-structures/trie/index.ts +1 -0
- package/src/types/data-structures/trie/trie.ts +1 -0
- package/src/types/helpers.ts +11 -0
- package/src/types/index.ts +3 -0
- package/src/types/utils/index.ts +2 -0
- package/src/types/utils/utils.ts +6 -0
- package/src/types/utils/validate-type.ts +35 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/utils.ts +86 -0
- package/test/index.test.ts +461 -0
- package/tsconfig.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+

|
|
2
|
+

|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
# What
|
|
10
|
+
|
|
11
|
+
## Brief
|
|
12
|
+
|
|
13
|
+
This is a standalone Tree Multiset data structure from the data-structure-typed collection. If you wish to access more
|
|
14
|
+
data structures or advanced features, you can transition to directly installing the
|
|
15
|
+
complete [data-structure-typed](https://www.npmjs.com/package/data-structure-typed) package
|
|
16
|
+
|
|
17
|
+
# How
|
|
18
|
+
|
|
19
|
+
## install
|
|
20
|
+
|
|
21
|
+
### npm
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i tree-multimap-typed --save
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### yarn
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn add tree-multimap-typed
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### methods
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
### snippet
|
|
38
|
+
|
|
39
|
+
#### TS
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### JS
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API docs & Examples
|
|
52
|
+
|
|
53
|
+
[API Docs](https://data-structure-typed-docs.vercel.app)
|
|
54
|
+
|
|
55
|
+
[Live Examples](https://data-structure-typed-examples.vercel.app)
|
|
56
|
+
|
|
57
|
+
<a href="https://github.com/zrwusa/data-structure-typed-examples" target="_blank">Examples Repository</a>
|
|
58
|
+
|
|
59
|
+
## Data Structures
|
|
60
|
+
|
|
61
|
+
<table>
|
|
62
|
+
<thead>
|
|
63
|
+
<tr>
|
|
64
|
+
<th>Data Structure</th>
|
|
65
|
+
<th>Unit Test</th>
|
|
66
|
+
<th>Performance Test</th>
|
|
67
|
+
<th>API Documentation</th>
|
|
68
|
+
<th>Implemented</th>
|
|
69
|
+
</tr>
|
|
70
|
+
</thead>
|
|
71
|
+
<tbody>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>Binary Tree</td>
|
|
74
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
75
|
+
</td>
|
|
76
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
77
|
+
</td>
|
|
78
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
79
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td>Binary Search Tree (BST)</td>
|
|
83
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
84
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
85
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html"><span>BST</span></a></td>
|
|
86
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td>AVL Tree</td>
|
|
90
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
91
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
92
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html"><span>AVLTree</span></a></td>
|
|
93
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td>Tree Multiset</td>
|
|
97
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
98
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
99
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultimap.html"><span>TreeMultimap</span></a></td>
|
|
100
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td>Segment Tree</td>
|
|
104
|
+
<td></td>
|
|
105
|
+
<td></td>
|
|
106
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html"><span>SegmentTree</span></a></td>
|
|
107
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td>Binary Indexed Tree</td>
|
|
111
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
112
|
+
<td></td>
|
|
113
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html"><span>BinaryIndexedTree</span></a></td>
|
|
114
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr>
|
|
117
|
+
<td>Graph</td>
|
|
118
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
119
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
120
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>AbstractGraph</span></a></td>
|
|
121
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
122
|
+
</tr>
|
|
123
|
+
<tr>
|
|
124
|
+
<td>Directed Graph</td>
|
|
125
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
126
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
127
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>DirectedGraph</span></a></td>
|
|
128
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
129
|
+
</tr>
|
|
130
|
+
<tr>
|
|
131
|
+
<td>Undirected Graph</td>
|
|
132
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
133
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
134
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>UndirectedGraph</span></a></td>
|
|
135
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td>Linked List</td>
|
|
139
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
140
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
141
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
142
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
143
|
+
</tr>
|
|
144
|
+
<tr>
|
|
145
|
+
<td>Singly Linked List</td>
|
|
146
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
147
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
148
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
149
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td>Doubly Linked List</td>
|
|
153
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
154
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
155
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>DoublyLinkedList</span></a></td>
|
|
156
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
157
|
+
</tr>
|
|
158
|
+
<tr>
|
|
159
|
+
<td>Queue</td>
|
|
160
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
161
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
162
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>Queue</span></a></td>
|
|
163
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td>Object Deque</td>
|
|
167
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
168
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
169
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ObjectDeque.html"><span>ObjectDeque</span></a></td>
|
|
170
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
171
|
+
</tr>
|
|
172
|
+
<tr>
|
|
173
|
+
<td>Array Deque</td>
|
|
174
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
175
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
176
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ArrayDeque.html"><span>ArrayDeque</span></a></td>
|
|
177
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr>
|
|
180
|
+
<td>Stack</td>
|
|
181
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
182
|
+
<td></td>
|
|
183
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
|
|
184
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
185
|
+
</tr>
|
|
186
|
+
|
|
187
|
+
[//]: # (<tr>)
|
|
188
|
+
|
|
189
|
+
[//]: # (<td>Hash</td>)
|
|
190
|
+
|
|
191
|
+
[//]: # (<td></td>)
|
|
192
|
+
|
|
193
|
+
[//]: # (<td></td>)
|
|
194
|
+
|
|
195
|
+
[//]: # (<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashTable.html"><span>HashTable</span></a></td>)
|
|
196
|
+
|
|
197
|
+
[//]: # (<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>)
|
|
198
|
+
|
|
199
|
+
[//]: # (</tr>)
|
|
200
|
+
<tr>
|
|
201
|
+
<td>Coordinate Set</td>
|
|
202
|
+
<td></td>
|
|
203
|
+
<td></td>
|
|
204
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateSet.html"><span>CoordinateSet</span></a></td>
|
|
205
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
206
|
+
</tr>
|
|
207
|
+
<tr>
|
|
208
|
+
<td>Coordinate Map</td>
|
|
209
|
+
<td></td>
|
|
210
|
+
<td></td>
|
|
211
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateMap.html"><span>CoordinateMap</span></a></td>
|
|
212
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
213
|
+
</tr>
|
|
214
|
+
<tr>
|
|
215
|
+
<td>Heap</td>
|
|
216
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
217
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
218
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html"><span>Heap</span></a></td>
|
|
219
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td>Priority Queue</td>
|
|
223
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
224
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
225
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>PriorityQueue</span></a></td>
|
|
226
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
227
|
+
</tr>
|
|
228
|
+
<tr>
|
|
229
|
+
<td>Max Priority Queue</td>
|
|
230
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
231
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
232
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>MaxPriorityQueue</span></a></td>
|
|
233
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
234
|
+
</tr>
|
|
235
|
+
<tr>
|
|
236
|
+
<td>Min Priority Queue</td>
|
|
237
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
238
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
239
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>MinPriorityQueue</span></a></td>
|
|
240
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td>Trie</td>
|
|
244
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
245
|
+
<td></td>
|
|
246
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>Trie</span></a></td>
|
|
247
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
248
|
+
</tr>
|
|
249
|
+
</tbody>
|
|
250
|
+
</table>
|
|
251
|
+
|
|
252
|
+
# Why
|
|
253
|
+
|
|
254
|
+
## Complexities
|
|
255
|
+
|
|
256
|
+
### performance of Big O
|
|
257
|
+
|
|
258
|
+
<table>
|
|
259
|
+
<thead>
|
|
260
|
+
<tr>
|
|
261
|
+
<th>Big O Notation</th>
|
|
262
|
+
<th>Type</th>
|
|
263
|
+
<th>Computations for 10 elements</th>
|
|
264
|
+
<th>Computations for 100 elements</th>
|
|
265
|
+
<th>Computations for 1000 elements</th>
|
|
266
|
+
</tr>
|
|
267
|
+
</thead>
|
|
268
|
+
<tbody>
|
|
269
|
+
<tr>
|
|
270
|
+
<td><strong>O(1)</strong></td>
|
|
271
|
+
<td>Constant</td>
|
|
272
|
+
<td>1</td>
|
|
273
|
+
<td>1</td>
|
|
274
|
+
<td>1</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td><strong>O(log N)</strong></td>
|
|
278
|
+
<td>Logarithmic</td>
|
|
279
|
+
<td>3</td>
|
|
280
|
+
<td>6</td>
|
|
281
|
+
<td>9</td>
|
|
282
|
+
</tr>
|
|
283
|
+
<tr>
|
|
284
|
+
<td><strong>O(N)</strong></td>
|
|
285
|
+
<td>Linear</td>
|
|
286
|
+
<td>10</td>
|
|
287
|
+
<td>100</td>
|
|
288
|
+
<td>1000</td>
|
|
289
|
+
</tr>
|
|
290
|
+
<tr>
|
|
291
|
+
<td><strong>O(N log N)</strong></td>
|
|
292
|
+
<td>n log(n)</td>
|
|
293
|
+
<td>30</td>
|
|
294
|
+
<td>600</td>
|
|
295
|
+
<td>9000</td>
|
|
296
|
+
</tr>
|
|
297
|
+
<tr>
|
|
298
|
+
<td><strong>O(N^2)</strong></td>
|
|
299
|
+
<td>Quadratic</td>
|
|
300
|
+
<td>100</td>
|
|
301
|
+
<td>10000</td>
|
|
302
|
+
<td>1000000</td>
|
|
303
|
+
</tr>
|
|
304
|
+
<tr>
|
|
305
|
+
<td><strong>O(2^N)</strong></td>
|
|
306
|
+
<td>Exponential</td>
|
|
307
|
+
<td>1024</td>
|
|
308
|
+
<td>1.26e+29</td>
|
|
309
|
+
<td>1.07e+301</td>
|
|
310
|
+
</tr>
|
|
311
|
+
<tr>
|
|
312
|
+
<td><strong>O(N!)</strong></td>
|
|
313
|
+
<td>Factorial</td>
|
|
314
|
+
<td>3628800</td>
|
|
315
|
+
<td>9.3e+157</td>
|
|
316
|
+
<td>4.02e+2567</td>
|
|
317
|
+
</tr>
|
|
318
|
+
</tbody>
|
|
319
|
+
</table>
|
|
320
|
+
|
|
321
|
+
### Data Structure Complexity
|
|
322
|
+
|
|
323
|
+
<table>
|
|
324
|
+
<thead>
|
|
325
|
+
<tr>
|
|
326
|
+
<th>Data Structure</th>
|
|
327
|
+
<th>Access</th>
|
|
328
|
+
<th>Search</th>
|
|
329
|
+
<th>Insertion</th>
|
|
330
|
+
<th>Deletion</th>
|
|
331
|
+
<th>Comments</th>
|
|
332
|
+
</tr>
|
|
333
|
+
</thead>
|
|
334
|
+
<tbody>
|
|
335
|
+
<tr>
|
|
336
|
+
<td><strong>Array</strong></td>
|
|
337
|
+
<td>1</td>
|
|
338
|
+
<td>n</td>
|
|
339
|
+
<td>n</td>
|
|
340
|
+
<td>n</td>
|
|
341
|
+
<td></td>
|
|
342
|
+
</tr>
|
|
343
|
+
<tr>
|
|
344
|
+
<td><strong>Stack</strong></td>
|
|
345
|
+
<td>n</td>
|
|
346
|
+
<td>n</td>
|
|
347
|
+
<td>1</td>
|
|
348
|
+
<td>1</td>
|
|
349
|
+
<td></td>
|
|
350
|
+
</tr>
|
|
351
|
+
<tr>
|
|
352
|
+
<td><strong>Queue</strong></td>
|
|
353
|
+
<td>n</td>
|
|
354
|
+
<td>n</td>
|
|
355
|
+
<td>1</td>
|
|
356
|
+
<td>1</td>
|
|
357
|
+
<td></td>
|
|
358
|
+
</tr>
|
|
359
|
+
<tr>
|
|
360
|
+
<td><strong>Linked List</strong></td>
|
|
361
|
+
<td>n</td>
|
|
362
|
+
<td>n</td>
|
|
363
|
+
<td>1</td>
|
|
364
|
+
<td>n</td>
|
|
365
|
+
<td></td>
|
|
366
|
+
</tr>
|
|
367
|
+
<tr>
|
|
368
|
+
<td><strong>Hash Table</strong></td>
|
|
369
|
+
<td>-</td>
|
|
370
|
+
<td>n</td>
|
|
371
|
+
<td>n</td>
|
|
372
|
+
<td>n</td>
|
|
373
|
+
<td>In case of perfect hash function costs would be O(1)</td>
|
|
374
|
+
</tr>
|
|
375
|
+
<tr>
|
|
376
|
+
<td><strong>Binary Search Tree</strong></td>
|
|
377
|
+
<td>n</td>
|
|
378
|
+
<td>n</td>
|
|
379
|
+
<td>n</td>
|
|
380
|
+
<td>n</td>
|
|
381
|
+
<td>In case of balanced tree costs would be O(log(n))</td>
|
|
382
|
+
</tr>
|
|
383
|
+
<tr>
|
|
384
|
+
<td><strong>B-Tree</strong></td>
|
|
385
|
+
<td>log(n)</td>
|
|
386
|
+
<td>log(n)</td>
|
|
387
|
+
<td>log(n)</td>
|
|
388
|
+
<td>log(n)</td>
|
|
389
|
+
<td></td>
|
|
390
|
+
</tr>
|
|
391
|
+
<tr>
|
|
392
|
+
<td><strong>Red-Black Tree</strong></td>
|
|
393
|
+
<td>log(n)</td>
|
|
394
|
+
<td>log(n)</td>
|
|
395
|
+
<td>log(n)</td>
|
|
396
|
+
<td>log(n)</td>
|
|
397
|
+
<td></td>
|
|
398
|
+
</tr>
|
|
399
|
+
<tr>
|
|
400
|
+
<td><strong>AVL Tree</strong></td>
|
|
401
|
+
<td>log(n)</td>
|
|
402
|
+
<td>log(n)</td>
|
|
403
|
+
<td>log(n)</td>
|
|
404
|
+
<td>log(n)</td>
|
|
405
|
+
<td></td>
|
|
406
|
+
</tr>
|
|
407
|
+
<tr>
|
|
408
|
+
<td><strong>Bloom Filter</strong></td>
|
|
409
|
+
<td>-</td>
|
|
410
|
+
<td>1</td>
|
|
411
|
+
<td>1</td>
|
|
412
|
+
<td>-</td>
|
|
413
|
+
<td>False positives are possible while searching</td>
|
|
414
|
+
</tr>
|
|
415
|
+
</tbody>
|
|
416
|
+
</table>
|
|
417
|
+
|
|
418
|
+
### Sorting Complexity
|
|
419
|
+
|
|
420
|
+
<table>
|
|
421
|
+
<thead>
|
|
422
|
+
<tr>
|
|
423
|
+
<th>Name</th>
|
|
424
|
+
<th>Best</th>
|
|
425
|
+
<th>Average</th>
|
|
426
|
+
<th>Worst</th>
|
|
427
|
+
<th>Memory</th>
|
|
428
|
+
<th>Stable</th>
|
|
429
|
+
<th>Comments</th>
|
|
430
|
+
</tr>
|
|
431
|
+
</thead>
|
|
432
|
+
<tbody>
|
|
433
|
+
<tr>
|
|
434
|
+
<td><strong>Bubble sort</strong></td>
|
|
435
|
+
<td>n</td>
|
|
436
|
+
<td>n<sup>2</sup></td>
|
|
437
|
+
<td>n<sup>2</sup></td>
|
|
438
|
+
<td>1</td>
|
|
439
|
+
<td>Yes</td>
|
|
440
|
+
<td></td>
|
|
441
|
+
</tr>
|
|
442
|
+
<tr>
|
|
443
|
+
<td><strong>Insertion sort</strong></td>
|
|
444
|
+
<td>n</td>
|
|
445
|
+
<td>n<sup>2</sup></td>
|
|
446
|
+
<td>n<sup>2</sup></td>
|
|
447
|
+
<td>1</td>
|
|
448
|
+
<td>Yes</td>
|
|
449
|
+
<td></td>
|
|
450
|
+
</tr>
|
|
451
|
+
<tr>
|
|
452
|
+
<td><strong>Selection sort</strong></td>
|
|
453
|
+
<td>n<sup>2</sup></td>
|
|
454
|
+
<td>n<sup>2</sup></td>
|
|
455
|
+
<td>n<sup>2</sup></td>
|
|
456
|
+
<td>1</td>
|
|
457
|
+
<td>No</td>
|
|
458
|
+
<td></td>
|
|
459
|
+
</tr>
|
|
460
|
+
<tr>
|
|
461
|
+
<td><strong>Heap sort</strong></td>
|
|
462
|
+
<td>n log(n)</td>
|
|
463
|
+
<td>n log(n)</td>
|
|
464
|
+
<td>n log(n)</td>
|
|
465
|
+
<td>1</td>
|
|
466
|
+
<td>No</td>
|
|
467
|
+
<td></td>
|
|
468
|
+
</tr>
|
|
469
|
+
<tr>
|
|
470
|
+
<td><strong>Merge sort</strong></td>
|
|
471
|
+
<td>n log(n)</td>
|
|
472
|
+
<td>n log(n)</td>
|
|
473
|
+
<td>n log(n)</td>
|
|
474
|
+
<td>n</td>
|
|
475
|
+
<td>Yes</td>
|
|
476
|
+
<td></td>
|
|
477
|
+
</tr>
|
|
478
|
+
<tr>
|
|
479
|
+
<td><strong>Quick sort</strong></td>
|
|
480
|
+
<td>n log(n)</td>
|
|
481
|
+
<td>n log(n)</td>
|
|
482
|
+
<td>n<sup>2</sup></td>
|
|
483
|
+
<td>log(n)</td>
|
|
484
|
+
<td>No</td>
|
|
485
|
+
<td>Quicksort is usually done in-place with O(log(n)) stack space</td>
|
|
486
|
+
</tr>
|
|
487
|
+
<tr>
|
|
488
|
+
<td><strong>Shell sort</strong></td>
|
|
489
|
+
<td>n log(n)</td>
|
|
490
|
+
<td>depends on gap sequence</td>
|
|
491
|
+
<td>n (log(n))<sup>2</sup></td>
|
|
492
|
+
<td>1</td>
|
|
493
|
+
<td>No</td>
|
|
494
|
+
<td></td>
|
|
495
|
+
</tr>
|
|
496
|
+
<tr>
|
|
497
|
+
<td><strong>Counting sort</strong></td>
|
|
498
|
+
<td>n + r</td>
|
|
499
|
+
<td>n + r</td>
|
|
500
|
+
<td>n + r</td>
|
|
501
|
+
<td>n + r</td>
|
|
502
|
+
<td>Yes</td>
|
|
503
|
+
<td>r - biggest number in array</td>
|
|
504
|
+
</tr>
|
|
505
|
+
<tr>
|
|
506
|
+
<td><strong>Radix sort</strong></td>
|
|
507
|
+
<td>n * k</td>
|
|
508
|
+
<td>n * k</td>
|
|
509
|
+
<td>n * k</td>
|
|
510
|
+
<td>n + k</td>
|
|
511
|
+
<td>Yes</td>
|
|
512
|
+
<td>k - length of longest key</td>
|
|
513
|
+
</tr>
|
|
514
|
+
</tbody>
|
|
515
|
+
</table>
|
|
516
|
+
|
|
517
|
+

|
|
518
|
+
|
|
519
|
+

|
|
520
|
+
|
|
521
|
+

|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<coverage generated="1696760638977" clover="3.2.0">
|
|
3
|
+
<project timestamp="1696760638977" name="All files">
|
|
4
|
+
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
5
|
+
coveredmethods="2" elements="3" coveredelements="3" complexity="0" loc="1" ncloc="1" packages="1"
|
|
6
|
+
files="1" classes="1"/>
|
|
7
|
+
<file name="index.ts"
|
|
8
|
+
path="/Users/revone/projects/data-structure-typed-individuals/tree-multimap-typed/src/index.ts">
|
|
9
|
+
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
10
|
+
coveredmethods="2"/>
|
|
11
|
+
<line num="8" count="7" type="stmt"/>
|
|
12
|
+
</file>
|
|
13
|
+
</project>
|
|
14
|
+
</coverage>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"/Users/revone/projects/data-structure-typed-individuals/tree-multimap-typed/src/index.ts": {
|
|
3
|
+
"path": "/Users/revone/projects/data-structure-typed-individuals/tree-multimap-typed/src/index.ts",
|
|
4
|
+
"statementMap": {
|
|
5
|
+
"0": {
|
|
6
|
+
"start": {
|
|
7
|
+
"line": 8,
|
|
8
|
+
"column": 0
|
|
9
|
+
},
|
|
10
|
+
"end": {
|
|
11
|
+
"line": 8,
|
|
12
|
+
"column": 9
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"1": {
|
|
16
|
+
"start": {
|
|
17
|
+
"line": 8,
|
|
18
|
+
"column": 9
|
|
19
|
+
},
|
|
20
|
+
"end": {
|
|
21
|
+
"line": 8,
|
|
22
|
+
"column": 27
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"2": {
|
|
26
|
+
"start": {
|
|
27
|
+
"line": 8,
|
|
28
|
+
"column": 27
|
|
29
|
+
},
|
|
30
|
+
"end": {
|
|
31
|
+
"line": 8,
|
|
32
|
+
"column": 70
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"fnMap": {
|
|
37
|
+
"0": {
|
|
38
|
+
"name": "(anonymous_0)",
|
|
39
|
+
"decl": {
|
|
40
|
+
"start": {
|
|
41
|
+
"line": 8,
|
|
42
|
+
"column": 9
|
|
43
|
+
},
|
|
44
|
+
"end": {
|
|
45
|
+
"line": 8,
|
|
46
|
+
"column": 25
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"loc": {
|
|
50
|
+
"start": {
|
|
51
|
+
"line": 8,
|
|
52
|
+
"column": 9
|
|
53
|
+
},
|
|
54
|
+
"end": {
|
|
55
|
+
"line": 8,
|
|
56
|
+
"column": 27
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"1": {
|
|
61
|
+
"name": "(anonymous_1)",
|
|
62
|
+
"decl": {
|
|
63
|
+
"start": {
|
|
64
|
+
"line": 8,
|
|
65
|
+
"column": 27
|
|
66
|
+
},
|
|
67
|
+
"end": {
|
|
68
|
+
"line": 8,
|
|
69
|
+
"column": 39
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"loc": {
|
|
73
|
+
"start": {
|
|
74
|
+
"line": 8,
|
|
75
|
+
"column": 27
|
|
76
|
+
},
|
|
77
|
+
"end": {
|
|
78
|
+
"line": 8,
|
|
79
|
+
"column": 70
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"branchMap": {},
|
|
85
|
+
"s": {
|
|
86
|
+
"0": 1,
|
|
87
|
+
"1": 7,
|
|
88
|
+
"2": 5
|
|
89
|
+
},
|
|
90
|
+
"f": {
|
|
91
|
+
"0": 6,
|
|
92
|
+
"1": 4
|
|
93
|
+
},
|
|
94
|
+
"b": {}
|
|
95
|
+
}
|
|
96
|
+
}
|