data-structure-typed 1.18.0 → 1.18.6
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/README.md +193 -66
- package/backup/recursive-type/src/assets/complexities-diff.jpg +0 -0
- package/backup/recursive-type/src/assets/data-structure-complexities.jpg +0 -0
- package/backup/recursive-type/src/assets/logo.png +0 -0
- package/backup/recursive-type/src/assets/overview-diagram-of-data-structures.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/aa-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/avl-tree.ts +288 -0
- package/backup/recursive-type/src/data-structures/binary-tree/b-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-indexed-tree.ts +78 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-tree.ts +1502 -0
- package/backup/recursive-type/src/data-structures/binary-tree/bst.ts +503 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/bst-rotation.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/segment-tree.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/index.ts +11 -0
- package/backup/recursive-type/src/data-structures/binary-tree/rb-tree.ts +110 -0
- package/backup/recursive-type/src/data-structures/binary-tree/segment-tree.ts +243 -0
- package/backup/recursive-type/src/data-structures/binary-tree/splay-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/tree-multiset.ts +55 -0
- package/backup/recursive-type/src/data-structures/binary-tree/two-three-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/diagrams/README.md +5 -0
- package/backup/recursive-type/src/data-structures/graph/abstract-graph.ts +985 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/mst.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-articulation-point-bridge.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-complicate-simple.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-strongly-connected-component.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.mp4 +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.webp +0 -0
- package/backup/recursive-type/src/data-structures/graph/directed-graph.ts +478 -0
- package/backup/recursive-type/src/data-structures/graph/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/graph/undirected-graph.ts +293 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-map.ts +67 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-set.ts +56 -0
- package/backup/recursive-type/src/data-structures/hash/hash-table.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/index.ts +6 -0
- package/backup/recursive-type/src/data-structures/hash/pair.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-map.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-set.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/heap.ts +176 -0
- package/backup/recursive-type/src/data-structures/heap/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/max-heap.ts +31 -0
- package/backup/recursive-type/src/data-structures/heap/min-heap.ts +34 -0
- package/backup/recursive-type/src/data-structures/index.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/abstract-graph.ts +42 -0
- package/backup/recursive-type/src/data-structures/interfaces/avl-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/binary-tree.ts +56 -0
- package/backup/recursive-type/src/data-structures/interfaces/bst.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/directed-graph.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/heap.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/index.ts +13 -0
- package/backup/recursive-type/src/data-structures/interfaces/navigator.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/priority-queue.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/undirected-graph.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/doubly-linked-list.ts +573 -0
- package/backup/recursive-type/src/data-structures/linked-list/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/singly-linked-list.ts +490 -0
- package/backup/recursive-type/src/data-structures/linked-list/skip-linked-list.ts +3 -0
- package/backup/recursive-type/src/data-structures/matrix/index.ts +4 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix.ts +27 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix2d.ts +208 -0
- package/backup/recursive-type/src/data-structures/matrix/navigator.ts +122 -0
- package/backup/recursive-type/src/data-structures/matrix/vector2d.ts +316 -0
- package/backup/recursive-type/src/data-structures/priority-queue/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/priority-queue/max-priority-queue.ts +49 -0
- package/backup/recursive-type/src/data-structures/priority-queue/min-priority-queue.ts +50 -0
- package/backup/recursive-type/src/data-structures/priority-queue/priority-queue.ts +354 -0
- package/backup/recursive-type/src/data-structures/queue/deque.ts +251 -0
- package/backup/recursive-type/src/data-structures/queue/index.ts +2 -0
- package/backup/recursive-type/src/data-structures/queue/queue.ts +120 -0
- package/backup/recursive-type/src/data-structures/stack/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/stack/stack.ts +98 -0
- package/backup/recursive-type/src/data-structures/tree/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/tree/tree.ts +80 -0
- package/backup/recursive-type/src/data-structures/trie/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/trie/trie.ts +227 -0
- package/backup/recursive-type/src/data-structures/types/abstract-graph.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/avl-tree.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/binary-tree.ts +10 -0
- package/backup/recursive-type/src/data-structures/types/bst.ts +6 -0
- package/backup/recursive-type/src/data-structures/types/directed-graph.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/heap.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/index.ts +12 -0
- package/backup/recursive-type/src/data-structures/types/navigator.ts +13 -0
- package/backup/recursive-type/src/data-structures/types/priority-queue.ts +9 -0
- package/backup/recursive-type/src/data-structures/types/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/index.ts +1 -0
- package/backup/recursive-type/src/utils/index.ts +2 -0
- package/backup/recursive-type/src/utils/types/index.ts +1 -0
- package/backup/recursive-type/src/utils/types/utils.ts +6 -0
- package/backup/recursive-type/src/utils/utils.ts +78 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +333 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +1455 -0
- package/dist/data-structures/binary-tree/avl-tree.d.ts +20 -25
- package/dist/data-structures/binary-tree/avl-tree.js +10 -18
- package/dist/data-structures/binary-tree/binary-tree.d.ts +18 -345
- package/dist/data-structures/binary-tree/binary-tree.js +39 -1444
- package/dist/data-structures/binary-tree/bst.d.ts +24 -31
- package/dist/data-structures/binary-tree/bst.js +46 -53
- package/dist/data-structures/binary-tree/index.d.ts +1 -0
- package/dist/data-structures/binary-tree/index.js +1 -0
- package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -2
- package/dist/data-structures/binary-tree/rb-tree.js +64 -5
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +11 -25
- package/dist/data-structures/binary-tree/tree-multiset.js +29 -31
- package/dist/data-structures/graph/abstract-graph.d.ts +56 -58
- package/dist/data-structures/graph/abstract-graph.js +84 -68
- package/dist/data-structures/graph/directed-graph.d.ts +124 -95
- package/dist/data-structures/graph/directed-graph.js +156 -108
- package/dist/data-structures/graph/undirected-graph.d.ts +83 -58
- package/dist/data-structures/graph/undirected-graph.js +98 -71
- package/dist/data-structures/hash/coordinate-set.d.ts +1 -1
- package/dist/data-structures/index.d.ts +1 -0
- package/dist/data-structures/index.js +1 -0
- package/dist/data-structures/interfaces/abstract-graph.d.ts +22 -0
- package/dist/data-structures/interfaces/abstract-graph.js +2 -0
- package/dist/data-structures/interfaces/avl-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/avl-tree.js +2 -0
- package/dist/data-structures/interfaces/binary-tree.d.ts +26 -0
- package/dist/data-structures/interfaces/binary-tree.js +2 -0
- package/dist/data-structures/interfaces/bst.d.ts +1 -0
- package/dist/data-structures/interfaces/bst.js +2 -0
- package/dist/data-structures/interfaces/directed-graph.d.ts +9 -0
- package/dist/data-structures/interfaces/directed-graph.js +2 -0
- package/dist/data-structures/interfaces/doubly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/doubly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/heap.d.ts +1 -0
- package/dist/data-structures/interfaces/heap.js +2 -0
- package/dist/data-structures/interfaces/index.d.ts +13 -0
- package/dist/data-structures/interfaces/index.js +29 -0
- package/dist/data-structures/interfaces/navigator.d.ts +1 -0
- package/dist/data-structures/interfaces/navigator.js +2 -0
- package/dist/data-structures/interfaces/priority-queue.d.ts +1 -0
- package/dist/data-structures/interfaces/priority-queue.js +2 -0
- package/dist/data-structures/interfaces/segment-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/segment-tree.js +2 -0
- package/dist/data-structures/interfaces/singly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/singly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/tree-multiset.d.ts +1 -0
- package/dist/data-structures/interfaces/tree-multiset.js +2 -0
- package/dist/data-structures/interfaces/undirected-graph.d.ts +2 -0
- package/dist/data-structures/interfaces/undirected-graph.js +2 -0
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +4 -4
- package/dist/data-structures/queue/deque.d.ts +5 -5
- package/dist/data-structures/queue/deque.js +6 -6
- package/dist/data-structures/queue/queue.d.ts +1 -1
- package/dist/data-structures/stack/stack.d.ts +1 -1
- package/dist/data-structures/types/abstract-binary-tree.d.ts +32 -0
- package/dist/data-structures/types/abstract-binary-tree.js +21 -0
- package/dist/data-structures/types/abstract-graph.d.ts +1 -20
- package/dist/data-structures/types/avl-tree.d.ts +3 -4
- package/dist/data-structures/types/binary-tree.d.ts +3 -10
- package/dist/data-structures/types/bst.d.ts +10 -4
- package/dist/data-structures/types/bst.js +7 -0
- package/dist/data-structures/types/directed-graph.d.ts +5 -9
- package/dist/data-structures/types/directed-graph.js +7 -0
- package/dist/data-structures/types/heap.d.ts +2 -2
- package/dist/data-structures/types/helpers.d.ts +8 -0
- package/dist/data-structures/types/helpers.js +2 -0
- package/dist/data-structures/types/index.d.ts +3 -1
- package/dist/data-structures/types/index.js +3 -1
- package/dist/data-structures/types/navigator.d.ts +2 -2
- package/dist/data-structures/types/priority-queue.d.ts +2 -2
- package/dist/data-structures/types/rb-tree.d.ts +6 -0
- package/dist/data-structures/types/rb-tree.js +8 -0
- package/dist/data-structures/types/tree-multiset.d.ts +5 -4
- package/docs/assets/search.js +1 -1
- package/docs/classes/AVLTree.html +310 -309
- package/docs/classes/AVLTreeNode.html +122 -68
- package/docs/classes/AaTree.html +30 -17
- package/docs/classes/AbstractBinaryTree.html +2023 -0
- package/docs/classes/AbstractBinaryTreeNode.html +491 -0
- package/docs/classes/AbstractEdge.html +84 -39
- package/docs/classes/AbstractGraph.html +235 -119
- package/docs/classes/AbstractVertex.html +87 -35
- package/docs/classes/ArrayDeque.html +43 -30
- package/docs/classes/BST.html +297 -285
- package/docs/classes/BSTNode.html +123 -62
- package/docs/classes/BTree.html +30 -17
- package/docs/classes/BinaryIndexedTree.html +38 -25
- package/docs/classes/BinaryTree.html +596 -589
- package/docs/classes/BinaryTreeNode.html +181 -161
- package/docs/classes/Character.html +33 -20
- package/docs/classes/CoordinateMap.html +38 -25
- package/docs/classes/CoordinateSet.html +39 -26
- package/docs/classes/Deque.html +63 -50
- package/docs/classes/DirectedEdge.html +90 -46
- package/docs/classes/DirectedGraph.html +374 -212
- package/docs/classes/DirectedVertex.html +79 -41
- package/docs/classes/DoublyLinkedList.html +68 -55
- package/docs/classes/DoublyLinkedListNode.html +40 -27
- package/docs/classes/HashTable.html +30 -17
- package/docs/classes/Heap.html +45 -32
- package/docs/classes/HeapItem.html +37 -24
- package/docs/classes/Matrix2D.html +45 -32
- package/docs/classes/MatrixNTI2D.html +33 -20
- package/docs/classes/MaxHeap.html +45 -32
- package/docs/classes/MaxPriorityQueue.html +83 -65
- package/docs/classes/MinHeap.html +45 -32
- package/docs/classes/MinPriorityQueue.html +83 -65
- package/docs/classes/Navigator.html +40 -27
- package/docs/classes/ObjectDeque.html +78 -55
- package/docs/classes/Pair.html +30 -17
- package/docs/classes/PriorityQueue.html +78 -60
- package/docs/classes/Queue.html +45 -32
- package/docs/classes/SegmentTree.html +46 -33
- package/docs/classes/SegmentTreeNode.html +49 -36
- package/docs/classes/SinglyLinkedList.html +65 -52
- package/docs/classes/SinglyLinkedListNode.html +37 -24
- package/docs/classes/SkipLinkedList.html +30 -17
- package/docs/classes/SplayTree.html +30 -17
- package/docs/classes/Stack.html +43 -30
- package/docs/classes/TreeMap.html +30 -17
- package/docs/classes/TreeMultiSet.html +330 -316
- package/docs/classes/TreeMultiSetNode.html +450 -0
- package/docs/classes/TreeNode.html +45 -32
- package/docs/classes/TreeSet.html +30 -17
- package/docs/classes/Trie.html +42 -29
- package/docs/classes/TrieNode.html +40 -27
- package/docs/classes/TwoThreeTree.html +30 -17
- package/docs/classes/UndirectedEdge.html +86 -56
- package/docs/classes/UndirectedGraph.html +286 -165
- package/docs/classes/UndirectedVertex.html +79 -41
- package/docs/classes/Vector2D.html +57 -44
- package/docs/enums/CP.html +36 -23
- package/docs/enums/FamilyPosition.html +48 -35
- package/docs/enums/LoopType.html +42 -29
- package/docs/{interfaces/PriorityQueueOptions.html → enums/RBColor.html} +52 -55
- package/docs/{interfaces/AVLTreeDeleted.html → enums/TopologicalProperty.html} +59 -48
- package/docs/index.html +211 -73
- package/docs/interfaces/{NavigatorParams.html → IBinaryTree.html} +56 -67
- package/docs/interfaces/IBinaryTreeNode.html +396 -0
- package/docs/interfaces/IDirectedGraph.html +36 -23
- package/docs/interfaces/IGraph.html +134 -93
- package/docs/interfaces/{HeapOptions.html → IUNDirectedGraph.html} +38 -57
- package/docs/modules.html +57 -31
- package/docs/types/{ToThunkFn.html → AVLTreeOptions.html} +35 -27
- package/docs/types/AbstractBinaryTreeOptions.html +150 -0
- package/docs/types/AbstractRecursiveBinaryTreeNode.html +146 -0
- package/docs/types/{ResultsByProperty.html → AbstractResultByProperty.html} +35 -22
- package/docs/types/{TreeMultiSetDeletedResult.html → AbstractResultsByProperty.html} +35 -29
- package/docs/types/BSTComparator.html +30 -17
- package/docs/types/{TrlAsyncFn.html → BSTOptions.html} +36 -31
- package/docs/types/BinaryTreeDeletedResult.html +153 -0
- package/docs/types/BinaryTreeNodeId.html +30 -17
- package/docs/types/BinaryTreeNodePropertyName.html +30 -17
- package/docs/types/{BinaryTreeDeleted.html → BinaryTreeOptions.html} +35 -31
- package/docs/types/DFSOrderPattern.html +30 -17
- package/docs/types/DijkstraResult.html +30 -17
- package/docs/types/Direction.html +30 -17
- package/docs/types/{SpecifyOptional.html → EdgeId.html} +34 -28
- package/docs/types/{TrlFn.html → HeapOptions.html} +45 -24
- package/docs/types/IdObject.html +151 -0
- package/docs/types/{BSTDeletedResult.html → KeyValObject.html} +36 -30
- package/docs/types/NavigatorParams.html +175 -0
- package/docs/types/NodeOrPropertyName.html +30 -17
- package/docs/types/PriorityQueueComparator.html +30 -17
- package/docs/types/PriorityQueueDFSOrderPattern.html +30 -17
- package/docs/types/PriorityQueueOptions.html +155 -0
- package/docs/types/{Thunk.html → RBTreeOptions.html} +35 -27
- package/docs/types/RecursiveAVLTreeNode.html +146 -0
- package/docs/types/RecursiveBSTNode.html +146 -0
- package/docs/types/RecursiveBinaryTreeNode.html +146 -0
- package/docs/types/RecursiveTreeMultiSetNode.html +146 -0
- package/docs/types/SegmentTreeNodeVal.html +30 -17
- package/docs/types/TopologicalStatus.html +30 -17
- package/docs/types/TreeMultiSetOptions.html +146 -0
- package/docs/types/Turning.html +30 -17
- package/docs/types/VertexId.html +30 -17
- package/notes/note.md +8 -1
- package/package.json +10 -2
- package/docs/classes/RBTree.html +0 -153
- package/docs/types/ResultByProperty.html +0 -133
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './binary-tree';
|
|
2
|
+
export * from './bst';
|
|
3
|
+
export * from './avl-tree';
|
|
4
|
+
export * from './segment-tree';
|
|
5
|
+
export * from './tree-multiset';
|
|
6
|
+
export * from './abstract-graph';
|
|
7
|
+
export * from './directed-graph';
|
|
8
|
+
export * from './undirected-graph';
|
|
9
|
+
export * from './priority-queue';
|
|
10
|
+
export * from './heap';
|
|
11
|
+
export * from './singly-linked-list';
|
|
12
|
+
export * from './doubly-linked-list';
|
|
13
|
+
export * from './navigator';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./binary-tree"), exports);
|
|
18
|
+
__exportStar(require("./bst"), exports);
|
|
19
|
+
__exportStar(require("./avl-tree"), exports);
|
|
20
|
+
__exportStar(require("./segment-tree"), exports);
|
|
21
|
+
__exportStar(require("./tree-multiset"), exports);
|
|
22
|
+
__exportStar(require("./abstract-graph"), exports);
|
|
23
|
+
__exportStar(require("./directed-graph"), exports);
|
|
24
|
+
__exportStar(require("./undirected-graph"), exports);
|
|
25
|
+
__exportStar(require("./priority-queue"), exports);
|
|
26
|
+
__exportStar(require("./heap"), exports);
|
|
27
|
+
__exportStar(require("./singly-linked-list"), exports);
|
|
28
|
+
__exportStar(require("./doubly-linked-list"), exports);
|
|
29
|
+
__exportStar(require("./navigator"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,7 +22,7 @@ export declare class DoublyLinkedListNode<T = number> {
|
|
|
22
22
|
get prev(): DoublyLinkedListNode<T> | null;
|
|
23
23
|
set prev(value: DoublyLinkedListNode<T> | null);
|
|
24
24
|
}
|
|
25
|
-
export declare class DoublyLinkedList<T> {
|
|
25
|
+
export declare class DoublyLinkedList<T = number> {
|
|
26
26
|
/**
|
|
27
27
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
28
28
|
*/
|
|
@@ -19,7 +19,7 @@ export declare class SinglyLinkedListNode<T = number> {
|
|
|
19
19
|
get next(): SinglyLinkedListNode<T> | null;
|
|
20
20
|
set next(value: SinglyLinkedListNode<T> | null);
|
|
21
21
|
}
|
|
22
|
-
export declare class SinglyLinkedList<T> {
|
|
22
|
+
export declare class SinglyLinkedList<T = number> {
|
|
23
23
|
/**
|
|
24
24
|
* The constructor initializes the linked list with an empty head, tail, and length.
|
|
25
25
|
*/
|
|
@@ -15,7 +15,6 @@ export declare class PriorityQueue<T = number> {
|
|
|
15
15
|
constructor(options: PriorityQueueOptions<T>);
|
|
16
16
|
protected _nodes: T[];
|
|
17
17
|
get nodes(): T[];
|
|
18
|
-
protected set nodes(value: T[]);
|
|
19
18
|
get size(): number;
|
|
20
19
|
/**
|
|
21
20
|
* The `heapify` function creates a new PriorityQueue instance and fixes the heap property.
|
|
@@ -112,6 +111,7 @@ export declare class PriorityQueue<T = number> {
|
|
|
112
111
|
* @returns an array of type `(T | null)[]`.
|
|
113
112
|
*/
|
|
114
113
|
DFS(dfsMode: PriorityQueueDFSOrderPattern): (T | null)[];
|
|
114
|
+
protected _setNodes(value: T[]): void;
|
|
115
115
|
protected readonly _comparator: PriorityQueueComparator<T>;
|
|
116
116
|
/**
|
|
117
117
|
* The function compares two numbers using a custom comparator function.
|
|
@@ -61,9 +61,6 @@ var PriorityQueue = /** @class */ (function () {
|
|
|
61
61
|
get: function () {
|
|
62
62
|
return this._nodes;
|
|
63
63
|
},
|
|
64
|
-
set: function (value) {
|
|
65
|
-
this._nodes = value;
|
|
66
|
-
},
|
|
67
64
|
enumerable: false,
|
|
68
65
|
configurable: true
|
|
69
66
|
});
|
|
@@ -167,7 +164,7 @@ var PriorityQueue = /** @class */ (function () {
|
|
|
167
164
|
* The clear function clears the nodes array.
|
|
168
165
|
*/
|
|
169
166
|
PriorityQueue.prototype.clear = function () {
|
|
170
|
-
this.
|
|
167
|
+
this._setNodes([]);
|
|
171
168
|
};
|
|
172
169
|
/**
|
|
173
170
|
* The toArray function returns an array containing all the elements in the nodes property.
|
|
@@ -256,6 +253,9 @@ var PriorityQueue = /** @class */ (function () {
|
|
|
256
253
|
this._isValidIndex(0) && traverse(0);
|
|
257
254
|
return visitedNode;
|
|
258
255
|
};
|
|
256
|
+
PriorityQueue.prototype._setNodes = function (value) {
|
|
257
|
+
this._nodes = value;
|
|
258
|
+
};
|
|
259
259
|
/**
|
|
260
260
|
* The function compares two numbers using a custom comparator function.
|
|
261
261
|
* @param {number} a - The parameter "a" is a number that represents the index of a node in an array.
|
|
@@ -8,15 +8,12 @@
|
|
|
8
8
|
import { DoublyLinkedList } from '../linked-list';
|
|
9
9
|
export declare class Deque<T> extends DoublyLinkedList<T> {
|
|
10
10
|
}
|
|
11
|
-
export declare class ObjectDeque<T> {
|
|
11
|
+
export declare class ObjectDeque<T = number> {
|
|
12
12
|
constructor(capacity?: number);
|
|
13
13
|
private _nodes;
|
|
14
14
|
get nodes(): {
|
|
15
15
|
[p: number]: T;
|
|
16
16
|
};
|
|
17
|
-
protected set nodes(value: {
|
|
18
|
-
[p: number]: T;
|
|
19
|
-
});
|
|
20
17
|
private _capacity;
|
|
21
18
|
get capacity(): number;
|
|
22
19
|
set capacity(value: number);
|
|
@@ -28,7 +25,6 @@ export declare class ObjectDeque<T> {
|
|
|
28
25
|
set last(value: number);
|
|
29
26
|
private _size;
|
|
30
27
|
get size(): number;
|
|
31
|
-
protected set size(value: number);
|
|
32
28
|
addFirst(value: T): void;
|
|
33
29
|
addLast(value: T): void;
|
|
34
30
|
pollFirst(): T | undefined;
|
|
@@ -37,6 +33,10 @@ export declare class ObjectDeque<T> {
|
|
|
37
33
|
peekLast(): T | undefined;
|
|
38
34
|
get(index: number): NonNullable<T> | null;
|
|
39
35
|
isEmpty(): boolean;
|
|
36
|
+
protected _seNodes(value: {
|
|
37
|
+
[p: number]: T;
|
|
38
|
+
}): void;
|
|
39
|
+
protected _setSize(value: number): void;
|
|
40
40
|
}
|
|
41
41
|
export declare class ArrayDeque<T> {
|
|
42
42
|
protected _nodes: T[];
|
|
@@ -51,9 +51,6 @@ var ObjectDeque = /** @class */ (function () {
|
|
|
51
51
|
get: function () {
|
|
52
52
|
return this._nodes;
|
|
53
53
|
},
|
|
54
|
-
set: function (value) {
|
|
55
|
-
this._nodes = value;
|
|
56
|
-
},
|
|
57
54
|
enumerable: false,
|
|
58
55
|
configurable: true
|
|
59
56
|
});
|
|
@@ -91,9 +88,6 @@ var ObjectDeque = /** @class */ (function () {
|
|
|
91
88
|
get: function () {
|
|
92
89
|
return this._size;
|
|
93
90
|
},
|
|
94
|
-
set: function (value) {
|
|
95
|
-
this._size = value;
|
|
96
|
-
},
|
|
97
91
|
enumerable: false,
|
|
98
92
|
configurable: true
|
|
99
93
|
});
|
|
@@ -153,6 +147,12 @@ var ObjectDeque = /** @class */ (function () {
|
|
|
153
147
|
ObjectDeque.prototype.isEmpty = function () {
|
|
154
148
|
return this._size <= 0;
|
|
155
149
|
};
|
|
150
|
+
ObjectDeque.prototype._seNodes = function (value) {
|
|
151
|
+
this._nodes = value;
|
|
152
|
+
};
|
|
153
|
+
ObjectDeque.prototype._setSize = function (value) {
|
|
154
|
+
this._size = value;
|
|
155
|
+
};
|
|
156
156
|
return ObjectDeque;
|
|
157
157
|
}());
|
|
158
158
|
exports.ObjectDeque = ObjectDeque;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @copyright Tyler Zeng <zrwusa@gmail.com>
|
|
4
4
|
* @class
|
|
5
5
|
*/
|
|
6
|
-
export declare class Stack<T> {
|
|
6
|
+
export declare class Stack<T = number> {
|
|
7
7
|
protected _elements: T[];
|
|
8
8
|
/**
|
|
9
9
|
* The constructor initializes an array of elements, which can be provided as an optional parameter.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AbstractBinaryTreeNode } from '../binary-tree';
|
|
2
|
+
/**
|
|
3
|
+
* Enum representing different loop types.
|
|
4
|
+
*
|
|
5
|
+
* - `iterative`: Indicates the iterative loop type (with loops that use iterations).
|
|
6
|
+
* - `recursive`: Indicates the recursive loop type (with loops that call themselves).
|
|
7
|
+
*/
|
|
8
|
+
export declare enum LoopType {
|
|
9
|
+
ITERATIVE = "ITERATIVE",
|
|
10
|
+
RECURSIVE = "RECURSIVE"
|
|
11
|
+
}
|
|
12
|
+
export declare enum FamilyPosition {
|
|
13
|
+
ROOT = 0,
|
|
14
|
+
LEFT = 1,
|
|
15
|
+
RIGHT = 2
|
|
16
|
+
}
|
|
17
|
+
export type BinaryTreeNodePropertyName = 'id' | 'val' | 'count';
|
|
18
|
+
export type NodeOrPropertyName = 'node' | BinaryTreeNodePropertyName;
|
|
19
|
+
export type DFSOrderPattern = 'in' | 'pre' | 'post';
|
|
20
|
+
export type BinaryTreeNodeId = number;
|
|
21
|
+
export type BinaryTreeDeletedResult<N> = {
|
|
22
|
+
deleted: N | null | undefined;
|
|
23
|
+
needBalanced: N | null;
|
|
24
|
+
};
|
|
25
|
+
export type AbstractResultByProperty<N extends AbstractBinaryTreeNode<N['val'], N>> = N['val'] | N | number | BinaryTreeNodeId;
|
|
26
|
+
export type AbstractResultsByProperty<N extends AbstractBinaryTreeNode<N['val'], N>> = AbstractResultByProperty<N>[];
|
|
27
|
+
export type AbstractRecursiveBinaryTreeNode<T> = AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
28
|
+
export type AbstractBinaryTreeOptions = {
|
|
29
|
+
loopType?: LoopType;
|
|
30
|
+
autoIncrementId?: boolean;
|
|
31
|
+
isDuplicatedVal?: boolean;
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FamilyPosition = exports.LoopType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing different loop types.
|
|
6
|
+
*
|
|
7
|
+
* - `iterative`: Indicates the iterative loop type (with loops that use iterations).
|
|
8
|
+
* - `recursive`: Indicates the recursive loop type (with loops that call themselves).
|
|
9
|
+
*/
|
|
10
|
+
var LoopType;
|
|
11
|
+
(function (LoopType) {
|
|
12
|
+
LoopType["ITERATIVE"] = "ITERATIVE";
|
|
13
|
+
LoopType["RECURSIVE"] = "RECURSIVE";
|
|
14
|
+
})(LoopType || (exports.LoopType = LoopType = {}));
|
|
15
|
+
/* This enumeration defines the position of a node within a family tree composed of three associated nodes, where 'root' represents the root node of the family tree, 'left' represents the left child node, and 'right' represents the right child node. */
|
|
16
|
+
var FamilyPosition;
|
|
17
|
+
(function (FamilyPosition) {
|
|
18
|
+
FamilyPosition[FamilyPosition["ROOT"] = 0] = "ROOT";
|
|
19
|
+
FamilyPosition[FamilyPosition["LEFT"] = 1] = "LEFT";
|
|
20
|
+
FamilyPosition[FamilyPosition["RIGHT"] = 2] = "RIGHT";
|
|
21
|
+
})(FamilyPosition || (exports.FamilyPosition = FamilyPosition = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type VertexId = string | number;
|
|
2
|
+
export type EdgeId = string;
|
|
2
3
|
export type DijkstraResult<V> = {
|
|
3
4
|
distMap: Map<V, number>;
|
|
4
5
|
preMap: Map<V, V | null>;
|
|
@@ -7,23 +8,3 @@ export type DijkstraResult<V> = {
|
|
|
7
8
|
minDist: number;
|
|
8
9
|
minPath: V[];
|
|
9
10
|
} | null;
|
|
10
|
-
export interface IGraph<V, E> {
|
|
11
|
-
hasVertex(vertexOrId: V | VertexId): boolean;
|
|
12
|
-
getVertex(vertexOrId: VertexId | V): V | null;
|
|
13
|
-
getVertexId(vertexOrId: V | VertexId): VertexId;
|
|
14
|
-
vertexSet(): Map<VertexId, V>;
|
|
15
|
-
addVertex(v: V): boolean;
|
|
16
|
-
removeVertex(vertexOrId: V | VertexId): boolean;
|
|
17
|
-
removeAllVertices(vertices: V[] | VertexId[]): boolean;
|
|
18
|
-
degreeOf(vertexOrId: V | VertexId): number;
|
|
19
|
-
edgesOf(vertexOrId: V | VertexId): E[];
|
|
20
|
-
hasEdge(src: V | VertexId, dest: V | VertexId): boolean;
|
|
21
|
-
getEdge(srcOrId: V | VertexId, destOrId: V | VertexId): E | null;
|
|
22
|
-
edgeSet(): E[];
|
|
23
|
-
addEdge(edge: E): boolean;
|
|
24
|
-
removeEdgeBetween(srcOrId: V | VertexId, destOrId: V | VertexId): E | null;
|
|
25
|
-
removeEdge(edge: E): E | null;
|
|
26
|
-
setEdgeWeight(srcOrId: V | VertexId, destOrId: V | VertexId, weight: number): boolean;
|
|
27
|
-
getMinPathBetween(v1: V | VertexId, v2: V | VertexId, isWeight?: boolean): V[] | null;
|
|
28
|
-
getNeighbors(vertexOrId: V | VertexId): V[];
|
|
29
|
-
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AVLTreeNode } from '../binary-tree';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
2
|
+
import { BSTOptions } from './bst';
|
|
3
|
+
export type RecursiveAVLTreeNode<T> = AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
4
|
+
export type AVLTreeOptions = BSTOptions & {};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { BinaryTreeNode } from '../binary-tree';
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type BinaryTreeNodeId = number;
|
|
6
|
-
export type BinaryTreeDeleted<T> = {
|
|
7
|
-
deleted: BinaryTreeNode<T> | null | undefined;
|
|
8
|
-
needBalanced: BinaryTreeNode<T> | null;
|
|
9
|
-
};
|
|
10
|
-
export type ResultByProperty<T> = T | BinaryTreeNode<T> | number | BinaryTreeNodeId;
|
|
11
|
-
export type ResultsByProperty<T> = ResultByProperty<T>[];
|
|
2
|
+
import { AbstractBinaryTreeOptions } from './abstract-binary-tree';
|
|
3
|
+
export type RecursiveBinaryTreeNode<T> = BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
4
|
+
export type BinaryTreeOptions = AbstractBinaryTreeOptions & {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { BSTNode } from '../binary-tree';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BinaryTreeOptions } from './binary-tree';
|
|
3
|
+
import { BinaryTreeNodeId } from './abstract-binary-tree';
|
|
3
4
|
export type BSTComparator = (a: BinaryTreeNodeId, b: BinaryTreeNodeId) => number;
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export type RecursiveBSTNode<T> = BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
6
|
+
export type BSTOptions = BinaryTreeOptions & {
|
|
7
|
+
comparator?: BSTComparator;
|
|
7
8
|
};
|
|
9
|
+
export declare enum CP {
|
|
10
|
+
lt = "lt",
|
|
11
|
+
eq = "eq",
|
|
12
|
+
gt = "gt"
|
|
13
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { VertexId } from './abstract-graph';
|
|
2
|
-
export interface IDirectedGraph<V, E> {
|
|
3
|
-
incomingEdgesOf(vertex: V): E[];
|
|
4
|
-
outgoingEdgesOf(vertex: V): E[];
|
|
5
|
-
inDegreeOf(vertexOrId: V | VertexId): number;
|
|
6
|
-
outDegreeOf(vertexOrId: V | VertexId): number;
|
|
7
|
-
getEdgeSrc(e: E): V | null;
|
|
8
|
-
getEdgeDest(e: E): V | null;
|
|
9
|
-
}
|
|
10
1
|
export type TopologicalStatus = 0 | 1 | 2;
|
|
2
|
+
export declare enum TopologicalProperty {
|
|
3
|
+
VAL = "VAL",
|
|
4
|
+
NODE = "NODE",
|
|
5
|
+
ID = "ID"
|
|
6
|
+
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TopologicalProperty = void 0;
|
|
4
|
+
var TopologicalProperty;
|
|
5
|
+
(function (TopologicalProperty) {
|
|
6
|
+
TopologicalProperty["VAL"] = "VAL";
|
|
7
|
+
TopologicalProperty["NODE"] = "NODE";
|
|
8
|
+
TopologicalProperty["ID"] = "ID";
|
|
9
|
+
})(TopologicalProperty || (exports.TopologicalProperty = TopologicalProperty = {}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type HeapOptions<T> = {
|
|
2
2
|
priority?: (element: T) => number;
|
|
3
|
-
}
|
|
3
|
+
};
|
|
@@ -4,10 +4,12 @@ export * from './avl-tree';
|
|
|
4
4
|
export * from './segment-tree';
|
|
5
5
|
export * from './tree-multiset';
|
|
6
6
|
export * from './abstract-graph';
|
|
7
|
+
export * from './abstract-binary-tree';
|
|
8
|
+
export * from './rb-tree';
|
|
7
9
|
export * from './directed-graph';
|
|
8
10
|
export * from './priority-queue';
|
|
9
11
|
export * from './heap';
|
|
10
12
|
export * from './singly-linked-list';
|
|
11
13
|
export * from './doubly-linked-list';
|
|
12
14
|
export * from './navigator';
|
|
13
|
-
export * from '
|
|
15
|
+
export * from './helpers';
|
|
@@ -20,10 +20,12 @@ __exportStar(require("./avl-tree"), exports);
|
|
|
20
20
|
__exportStar(require("./segment-tree"), exports);
|
|
21
21
|
__exportStar(require("./tree-multiset"), exports);
|
|
22
22
|
__exportStar(require("./abstract-graph"), exports);
|
|
23
|
+
__exportStar(require("./abstract-binary-tree"), exports);
|
|
24
|
+
__exportStar(require("./rb-tree"), exports);
|
|
23
25
|
__exportStar(require("./directed-graph"), exports);
|
|
24
26
|
__exportStar(require("./priority-queue"), exports);
|
|
25
27
|
__exportStar(require("./heap"), exports);
|
|
26
28
|
__exportStar(require("./singly-linked-list"), exports);
|
|
27
29
|
__exportStar(require("./doubly-linked-list"), exports);
|
|
28
30
|
__exportStar(require("./navigator"), exports);
|
|
29
|
-
__exportStar(require("
|
|
31
|
+
__exportStar(require("./helpers"), exports);
|
|
@@ -2,7 +2,7 @@ export type Direction = 'up' | 'right' | 'down' | 'left';
|
|
|
2
2
|
export type Turning = {
|
|
3
3
|
[key in Direction]: Direction;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type NavigatorParams<T> = {
|
|
6
6
|
matrix: T[][];
|
|
7
7
|
turning: Turning;
|
|
8
8
|
onMove: (cur: [number, number]) => void;
|
|
@@ -11,4 +11,4 @@ export interface NavigatorParams<T> {
|
|
|
11
11
|
charDir: Direction;
|
|
12
12
|
VISITED: T;
|
|
13
13
|
};
|
|
14
|
-
}
|
|
14
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type PriorityQueueComparator<T> = (a: T, b: T) => number;
|
|
2
|
-
export
|
|
2
|
+
export type PriorityQueueOptions<T> = {
|
|
3
3
|
nodes?: T[];
|
|
4
4
|
isFix?: boolean;
|
|
5
5
|
comparator: PriorityQueueComparator<T>;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export type PriorityQueueDFSOrderPattern = 'pre' | 'in' | 'post';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BSTOptions } from './bst';
|
|
2
|
+
import { TreeMultiSetNode } from '../binary-tree';
|
|
3
|
+
export type RecursiveTreeMultiSetNode<T> = TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, TreeMultiSetNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
4
|
+
export type TreeMultiSetOptions = Omit<BSTOptions, 'isDuplicatedVal'> & {
|
|
5
|
+
isDuplicatedVal: true;
|
|
5
6
|
};
|