data-structure-typed 1.18.6 → 1.18.8
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 +154 -366
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +72 -51
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +226 -158
- package/dist/data-structures/binary-tree/avl-tree.d.ts +7 -6
- package/dist/data-structures/binary-tree/avl-tree.js +5 -3
- package/dist/data-structures/binary-tree/binary-tree.d.ts +16 -6
- package/dist/data-structures/binary-tree/binary-tree.js +16 -7
- package/dist/data-structures/binary-tree/bst.d.ts +37 -28
- package/dist/data-structures/binary-tree/bst.js +44 -76
- package/dist/data-structures/binary-tree/rb-tree.d.ts +30 -1
- package/dist/data-structures/binary-tree/rb-tree.js +27 -14
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +18 -7
- package/dist/data-structures/binary-tree/tree-multiset.js +20 -15
- package/dist/data-structures/graph/abstract-graph.d.ts +28 -27
- package/dist/data-structures/graph/abstract-graph.js +58 -36
- package/dist/data-structures/graph/directed-graph.d.ts +27 -24
- package/dist/data-structures/graph/directed-graph.js +65 -60
- package/dist/data-structures/graph/undirected-graph.d.ts +12 -18
- package/dist/data-structures/graph/undirected-graph.js +52 -65
- package/dist/data-structures/interfaces/abstract-binary-tree.d.ts +100 -0
- package/dist/data-structures/interfaces/abstract-binary-tree.js +2 -0
- package/dist/data-structures/interfaces/abstract-graph.d.ts +3 -8
- package/dist/data-structures/interfaces/avl-tree.d.ts +16 -1
- package/dist/data-structures/interfaces/binary-tree.d.ts +4 -24
- package/dist/data-structures/interfaces/bst.d.ts +18 -1
- package/dist/data-structures/interfaces/directed-graph.d.ts +4 -1
- package/dist/data-structures/interfaces/index.d.ts +1 -1
- package/dist/data-structures/interfaces/index.js +1 -1
- package/dist/data-structures/interfaces/rb-tree.d.ts +9 -0
- package/dist/data-structures/interfaces/rb-tree.js +2 -0
- package/dist/data-structures/interfaces/tree-multiset.d.ts +7 -1
- package/dist/data-structures/interfaces/undirected-graph.d.ts +4 -1
- package/dist/data-structures/tree/tree.d.ts +1 -4
- package/dist/data-structures/tree/tree.js +1 -12
- package/dist/data-structures/types/abstract-binary-tree.d.ts +11 -7
- package/dist/data-structures/types/abstract-binary-tree.js +9 -5
- package/dist/data-structures/types/avl-tree.d.ts +1 -1
- package/dist/data-structures/types/binary-tree.d.ts +1 -1
- package/dist/data-structures/types/bst.d.ts +1 -1
- package/dist/data-structures/types/bst.js +1 -1
- package/dist/data-structures/types/directed-graph.js +1 -1
- package/dist/data-structures/types/helpers.d.ts +1 -8
- package/dist/data-structures/types/rb-tree.d.ts +2 -0
- package/dist/data-structures/types/rb-tree.js +1 -1
- package/dist/data-structures/types/tree-multiset.d.ts +4 -4
- package/dist/utils/types/utils.d.ts +18 -0
- package/dist/utils/utils.d.ts +6 -1
- package/dist/utils/utils.js +83 -1
- package/package.json +2 -2
- 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 +0 -3
- package/backup/recursive-type/src/data-structures/binary-tree/avl-tree.ts +0 -288
- package/backup/recursive-type/src/data-structures/binary-tree/b-tree.ts +0 -3
- package/backup/recursive-type/src/data-structures/binary-tree/binary-indexed-tree.ts +0 -78
- package/backup/recursive-type/src/data-structures/binary-tree/binary-tree.ts +0 -1502
- package/backup/recursive-type/src/data-structures/binary-tree/bst.ts +0 -503
- 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 +0 -11
- package/backup/recursive-type/src/data-structures/binary-tree/rb-tree.ts +0 -110
- package/backup/recursive-type/src/data-structures/binary-tree/segment-tree.ts +0 -243
- package/backup/recursive-type/src/data-structures/binary-tree/splay-tree.ts +0 -3
- package/backup/recursive-type/src/data-structures/binary-tree/tree-multiset.ts +0 -55
- package/backup/recursive-type/src/data-structures/binary-tree/two-three-tree.ts +0 -3
- package/backup/recursive-type/src/data-structures/diagrams/README.md +0 -5
- package/backup/recursive-type/src/data-structures/graph/abstract-graph.ts +0 -985
- 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 +0 -478
- package/backup/recursive-type/src/data-structures/graph/index.ts +0 -3
- package/backup/recursive-type/src/data-structures/graph/undirected-graph.ts +0 -293
- package/backup/recursive-type/src/data-structures/hash/coordinate-map.ts +0 -67
- package/backup/recursive-type/src/data-structures/hash/coordinate-set.ts +0 -56
- package/backup/recursive-type/src/data-structures/hash/hash-table.ts +0 -3
- package/backup/recursive-type/src/data-structures/hash/index.ts +0 -6
- package/backup/recursive-type/src/data-structures/hash/pair.ts +0 -3
- package/backup/recursive-type/src/data-structures/hash/tree-map.ts +0 -3
- package/backup/recursive-type/src/data-structures/hash/tree-set.ts +0 -3
- package/backup/recursive-type/src/data-structures/heap/heap.ts +0 -176
- package/backup/recursive-type/src/data-structures/heap/index.ts +0 -3
- package/backup/recursive-type/src/data-structures/heap/max-heap.ts +0 -31
- package/backup/recursive-type/src/data-structures/heap/min-heap.ts +0 -34
- package/backup/recursive-type/src/data-structures/index.ts +0 -15
- package/backup/recursive-type/src/data-structures/interfaces/abstract-graph.ts +0 -42
- package/backup/recursive-type/src/data-structures/interfaces/avl-tree.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/binary-tree.ts +0 -56
- package/backup/recursive-type/src/data-structures/interfaces/bst.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/directed-graph.ts +0 -15
- package/backup/recursive-type/src/data-structures/interfaces/doubly-linked-list.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/heap.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/index.ts +0 -13
- package/backup/recursive-type/src/data-structures/interfaces/navigator.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/priority-queue.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/segment-tree.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/singly-linked-list.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/tree-multiset.ts +0 -1
- package/backup/recursive-type/src/data-structures/interfaces/undirected-graph.ts +0 -3
- package/backup/recursive-type/src/data-structures/linked-list/doubly-linked-list.ts +0 -573
- package/backup/recursive-type/src/data-structures/linked-list/index.ts +0 -3
- package/backup/recursive-type/src/data-structures/linked-list/singly-linked-list.ts +0 -490
- package/backup/recursive-type/src/data-structures/linked-list/skip-linked-list.ts +0 -3
- package/backup/recursive-type/src/data-structures/matrix/index.ts +0 -4
- package/backup/recursive-type/src/data-structures/matrix/matrix.ts +0 -27
- package/backup/recursive-type/src/data-structures/matrix/matrix2d.ts +0 -208
- package/backup/recursive-type/src/data-structures/matrix/navigator.ts +0 -122
- package/backup/recursive-type/src/data-structures/matrix/vector2d.ts +0 -316
- package/backup/recursive-type/src/data-structures/priority-queue/index.ts +0 -3
- package/backup/recursive-type/src/data-structures/priority-queue/max-priority-queue.ts +0 -49
- package/backup/recursive-type/src/data-structures/priority-queue/min-priority-queue.ts +0 -50
- package/backup/recursive-type/src/data-structures/priority-queue/priority-queue.ts +0 -354
- package/backup/recursive-type/src/data-structures/queue/deque.ts +0 -251
- package/backup/recursive-type/src/data-structures/queue/index.ts +0 -2
- package/backup/recursive-type/src/data-structures/queue/queue.ts +0 -120
- package/backup/recursive-type/src/data-structures/stack/index.ts +0 -1
- package/backup/recursive-type/src/data-structures/stack/stack.ts +0 -98
- package/backup/recursive-type/src/data-structures/tree/index.ts +0 -1
- package/backup/recursive-type/src/data-structures/tree/tree.ts +0 -80
- package/backup/recursive-type/src/data-structures/trie/index.ts +0 -1
- package/backup/recursive-type/src/data-structures/trie/trie.ts +0 -227
- package/backup/recursive-type/src/data-structures/types/abstract-graph.ts +0 -5
- package/backup/recursive-type/src/data-structures/types/avl-tree.ts +0 -8
- package/backup/recursive-type/src/data-structures/types/binary-tree.ts +0 -10
- package/backup/recursive-type/src/data-structures/types/bst.ts +0 -6
- package/backup/recursive-type/src/data-structures/types/directed-graph.ts +0 -8
- package/backup/recursive-type/src/data-structures/types/doubly-linked-list.ts +0 -1
- package/backup/recursive-type/src/data-structures/types/heap.ts +0 -5
- package/backup/recursive-type/src/data-structures/types/index.ts +0 -12
- package/backup/recursive-type/src/data-structures/types/navigator.ts +0 -13
- package/backup/recursive-type/src/data-structures/types/priority-queue.ts +0 -9
- package/backup/recursive-type/src/data-structures/types/segment-tree.ts +0 -1
- package/backup/recursive-type/src/data-structures/types/singly-linked-list.ts +0 -1
- package/backup/recursive-type/src/data-structures/types/tree-multiset.ts +0 -1
- package/backup/recursive-type/src/index.ts +0 -1
- package/backup/recursive-type/src/utils/index.ts +0 -2
- package/backup/recursive-type/src/utils/types/index.ts +0 -1
- package/backup/recursive-type/src/utils/types/utils.ts +0 -6
- package/backup/recursive-type/src/utils/utils.ts +0 -78
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -92
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1367
- package/docs/classes/AVLTree.html +0 -2339
- package/docs/classes/AVLTreeNode.html +0 -450
- package/docs/classes/AaTree.html +0 -166
- package/docs/classes/AbstractBinaryTree.html +0 -2023
- package/docs/classes/AbstractBinaryTreeNode.html +0 -491
- package/docs/classes/AbstractEdge.html +0 -289
- package/docs/classes/AbstractGraph.html +0 -1046
- package/docs/classes/AbstractVertex.html +0 -252
- package/docs/classes/ArrayDeque.html +0 -433
- package/docs/classes/BST.html +0 -2196
- package/docs/classes/BSTNode.html +0 -453
- package/docs/classes/BTree.html +0 -166
- package/docs/classes/BinaryIndexedTree.html +0 -335
- package/docs/classes/BinaryTree.html +0 -2037
- package/docs/classes/BinaryTreeNode.html +0 -452
- package/docs/classes/Character.html +0 -214
- package/docs/classes/CoordinateMap.html +0 -477
- package/docs/classes/CoordinateSet.html +0 -438
- package/docs/classes/Deque.html +0 -969
- package/docs/classes/DirectedEdge.html +0 -360
- package/docs/classes/DirectedGraph.html +0 -1408
- package/docs/classes/DirectedVertex.html +0 -248
- package/docs/classes/DoublyLinkedList.html +0 -962
- package/docs/classes/DoublyLinkedListNode.html +0 -291
- package/docs/classes/HashTable.html +0 -166
- package/docs/classes/Heap.html +0 -417
- package/docs/classes/HeapItem.html +0 -249
- package/docs/classes/Matrix2D.html +0 -496
- package/docs/classes/MatrixNTI2D.html +0 -234
- package/docs/classes/MaxHeap.html +0 -430
- package/docs/classes/MaxPriorityQueue.html +0 -830
- package/docs/classes/MinHeap.html +0 -431
- package/docs/classes/MinPriorityQueue.html +0 -832
- package/docs/classes/Navigator.html +0 -307
- package/docs/classes/ObjectDeque.html +0 -449
- package/docs/classes/Pair.html +0 -166
- package/docs/classes/PriorityQueue.html +0 -754
- package/docs/classes/Queue.html +0 -386
- package/docs/classes/SegmentTree.html +0 -428
- package/docs/classes/SegmentTreeNode.html +0 -351
- package/docs/classes/SinglyLinkedList.html +0 -782
- package/docs/classes/SinglyLinkedListNode.html +0 -264
- package/docs/classes/SkipLinkedList.html +0 -166
- package/docs/classes/SplayTree.html +0 -166
- package/docs/classes/Stack.html +0 -362
- package/docs/classes/TreeMap.html +0 -166
- package/docs/classes/TreeMultiSet.html +0 -2196
- package/docs/classes/TreeMultiSetNode.html +0 -450
- package/docs/classes/TreeNode.html +0 -337
- package/docs/classes/TreeSet.html +0 -166
- package/docs/classes/Trie.html +0 -366
- package/docs/classes/TrieNode.html +0 -274
- package/docs/classes/TwoThreeTree.html +0 -166
- package/docs/classes/UndirectedEdge.html +0 -331
- package/docs/classes/UndirectedGraph.html +0 -1196
- package/docs/classes/UndirectedVertex.html +0 -248
- package/docs/classes/Vector2D.html +0 -799
- package/docs/enums/CP.html +0 -175
- package/docs/enums/FamilyPosition.html +0 -175
- package/docs/enums/LoopType.html +0 -176
- package/docs/enums/RBColor.html +0 -168
- package/docs/enums/TopologicalProperty.html +0 -175
- package/docs/index.html +0 -639
- package/docs/interfaces/IBinaryTree.html +0 -189
- package/docs/interfaces/IBinaryTreeNode.html +0 -396
- package/docs/interfaces/IDirectedGraph.html +0 -259
- package/docs/interfaces/IGraph.html +0 -471
- package/docs/interfaces/IUNDirectedGraph.html +0 -151
- package/docs/modules.html +0 -250
- package/docs/types/AVLTreeOptions.html +0 -144
- package/docs/types/AbstractBinaryTreeOptions.html +0 -150
- package/docs/types/AbstractRecursiveBinaryTreeNode.html +0 -146
- package/docs/types/AbstractResultByProperty.html +0 -146
- package/docs/types/AbstractResultsByProperty.html +0 -146
- package/docs/types/BSTComparator.html +0 -156
- package/docs/types/BSTOptions.html +0 -146
- package/docs/types/BinaryTreeDeletedResult.html +0 -153
- package/docs/types/BinaryTreeNodeId.html +0 -141
- package/docs/types/BinaryTreeNodePropertyName.html +0 -141
- package/docs/types/BinaryTreeOptions.html +0 -144
- package/docs/types/DFSOrderPattern.html +0 -141
- package/docs/types/DijkstraResult.html +0 -161
- package/docs/types/Direction.html +0 -141
- package/docs/types/EdgeId.html +0 -141
- package/docs/types/HeapOptions.html +0 -162
- package/docs/types/IdObject.html +0 -151
- package/docs/types/KeyValObject.html +0 -146
- package/docs/types/NavigatorParams.html +0 -175
- package/docs/types/NodeOrPropertyName.html +0 -141
- package/docs/types/PriorityQueueComparator.html +0 -161
- package/docs/types/PriorityQueueDFSOrderPattern.html +0 -141
- package/docs/types/PriorityQueueOptions.html +0 -155
- package/docs/types/RBTreeOptions.html +0 -144
- package/docs/types/RecursiveAVLTreeNode.html +0 -146
- package/docs/types/RecursiveBSTNode.html +0 -146
- package/docs/types/RecursiveBinaryTreeNode.html +0 -146
- package/docs/types/RecursiveTreeMultiSetNode.html +0 -146
- package/docs/types/SegmentTreeNodeVal.html +0 -141
- package/docs/types/TopologicalStatus.html +0 -141
- package/docs/types/TreeMultiSetOptions.html +0 -146
- package/docs/types/Turning.html +0 -141
- package/docs/types/VertexId.html +0 -141
- package/notes/bst.test.ts +0 -181
- package/notes/note.md +0 -34
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* data-structure-typed
|
|
3
|
-
*
|
|
4
|
-
* @author Tyler Zeng
|
|
5
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
|
-
* @license MIT License
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import {Heap, HeapItem} from './heap';
|
|
10
|
-
import {PriorityQueue} from '../priority-queue';
|
|
11
|
-
import type {HeapOptions} from '../types';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @class MinHeap
|
|
15
|
-
* @extends Heap
|
|
16
|
-
*/
|
|
17
|
-
export class MinHeap<T = number> extends Heap<T> {
|
|
18
|
-
protected _pq: PriorityQueue<HeapItem<T>>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The constructor initializes a PriorityQueue with a comparator function that compares the priority of two HeapItem
|
|
22
|
-
* objects.
|
|
23
|
-
* @param [options] - The `options` parameter is an optional object that can be passed to the constructor. It is of
|
|
24
|
-
* type `HeapOptions<T>`, which is a generic type that represents the options for the heap.
|
|
25
|
-
*/
|
|
26
|
-
constructor(options?: HeapOptions<T>) {
|
|
27
|
-
super(options);
|
|
28
|
-
this._pq = new PriorityQueue<HeapItem<T>>({
|
|
29
|
-
comparator: (a, b) => a.priority - b.priority
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './hash';
|
|
2
|
-
export * from './linked-list';
|
|
3
|
-
export * from './stack';
|
|
4
|
-
export * from './queue';
|
|
5
|
-
export * from './graph';
|
|
6
|
-
export * from './binary-tree';
|
|
7
|
-
export * from './tree';
|
|
8
|
-
export * from './heap';
|
|
9
|
-
export * from './priority-queue';
|
|
10
|
-
export * from './matrix';
|
|
11
|
-
export * from './trie';
|
|
12
|
-
export * from './interfaces';
|
|
13
|
-
export * from './types';
|
|
14
|
-
|
|
15
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {VertexId} from '../types';
|
|
2
|
-
|
|
3
|
-
export interface IGraph<V, E> {
|
|
4
|
-
|
|
5
|
-
hasVertex(vertexOrId: V | VertexId): boolean;
|
|
6
|
-
|
|
7
|
-
_getVertex(vertexOrId: VertexId | V): V | null;
|
|
8
|
-
|
|
9
|
-
_getVertexId(vertexOrId: V | VertexId): VertexId;
|
|
10
|
-
|
|
11
|
-
createAddVertex(id: VertexId, val?: V): boolean;
|
|
12
|
-
|
|
13
|
-
addVertex(newVertex: V): boolean;
|
|
14
|
-
|
|
15
|
-
removeVertex(vertexOrId: V | VertexId): boolean;
|
|
16
|
-
|
|
17
|
-
removeAllVertices(vertices: V[] | VertexId[]): boolean;
|
|
18
|
-
|
|
19
|
-
degreeOf(vertexOrId: V | VertexId): number;
|
|
20
|
-
|
|
21
|
-
edgesOf(vertexOrId: V | VertexId): E[];
|
|
22
|
-
|
|
23
|
-
hasEdge(src: V | VertexId, dest: V | VertexId): boolean;
|
|
24
|
-
|
|
25
|
-
getEdge(srcOrId: V | VertexId, destOrId: V | VertexId): E | null;
|
|
26
|
-
|
|
27
|
-
edgeSet(): E[];
|
|
28
|
-
|
|
29
|
-
createAddEdge(src: V | VertexId, dest: V | VertexId, weight: number, val: E): boolean;
|
|
30
|
-
|
|
31
|
-
addEdge(edge: E): boolean;
|
|
32
|
-
|
|
33
|
-
removeEdgeBetween(src: V | VertexId, dest: V | VertexId): E | null;
|
|
34
|
-
|
|
35
|
-
removeEdge(edge: E): E | null;
|
|
36
|
-
|
|
37
|
-
setEdgeWeight(srcOrId: V | VertexId, destOrId: V | VertexId, weight: number): boolean;
|
|
38
|
-
|
|
39
|
-
getMinPathBetween(v1: V | VertexId, v2: V | VertexId, isWeight?: boolean): V[] | null;
|
|
40
|
-
|
|
41
|
-
getNeighbors(vertexOrId: V | VertexId): V[];
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {BinaryTreeNodeId} from '../types';
|
|
2
|
-
import {FamilyPosition} from '../binary-tree';
|
|
3
|
-
|
|
4
|
-
export interface IBinaryTreeNode<T, FAMILY extends IBinaryTreeNode<T, FAMILY>> {
|
|
5
|
-
_createNode(id: BinaryTreeNodeId, val: T | null, count?: number): FAMILY | null;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get id(): BinaryTreeNodeId
|
|
9
|
-
|
|
10
|
-
set id(v: BinaryTreeNodeId)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
get val(): T
|
|
14
|
-
|
|
15
|
-
set val(v: T)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get left(): FAMILY | null | undefined
|
|
19
|
-
|
|
20
|
-
set left(v: FAMILY | null | undefined)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get right(): FAMILY | null | undefined
|
|
24
|
-
|
|
25
|
-
set right(v: FAMILY | null | undefined)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
get parent(): FAMILY | null | undefined
|
|
29
|
-
|
|
30
|
-
set parent(v: FAMILY | null | undefined)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
get familyPosition(): FamilyPosition
|
|
34
|
-
|
|
35
|
-
set familyPosition(v: FamilyPosition)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
get count(): number
|
|
39
|
-
|
|
40
|
-
set count(v: number)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
get height(): number
|
|
44
|
-
|
|
45
|
-
set height(v: number)
|
|
46
|
-
|
|
47
|
-
_createNode(id: BinaryTreeNodeId, val: T | null, count?: number): FAMILY | null
|
|
48
|
-
|
|
49
|
-
swapLocation(swapNode: FAMILY): FAMILY
|
|
50
|
-
|
|
51
|
-
clone(): FAMILY | null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface IBinaryTree<N extends IBinaryTreeNode<N['val'], N>> {
|
|
55
|
-
_createNode(id: BinaryTreeNodeId, val: N['val'] | null, count?: number): N | null
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {VertexId} from '../types';
|
|
2
|
-
|
|
3
|
-
export interface IDirectedGraph<V, E> {
|
|
4
|
-
incomingEdgesOf(vertex: V): E[];
|
|
5
|
-
|
|
6
|
-
outgoingEdgesOf(vertex: V): E[];
|
|
7
|
-
|
|
8
|
-
inDegreeOf(vertexOrId: V | VertexId): number;
|
|
9
|
-
|
|
10
|
-
outDegreeOf(vertexOrId: V | VertexId): number;
|
|
11
|
-
|
|
12
|
-
getEdgeSrc(e: E): V | null;
|
|
13
|
-
|
|
14
|
-
getEdgeDest(e: E): V | null;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1,13 +0,0 @@
|
|
|
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';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|