@raikuxq/alg-ds 1.2.5 → 3.0.0
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 +27 -52
- package/lib/index.d.ts +1279 -3
- package/lib/index.mjs +1 -0
- package/package.json +79 -72
- package/lib/app/algorithms/binary-search.d.ts +0 -5
- package/lib/app/algorithms/binary-search.js +0 -27
- package/lib/app/algorithms/factorial.d.ts +0 -9
- package/lib/app/algorithms/factorial.js +0 -17
- package/lib/app/algorithms/fibonacci.d.ts +0 -9
- package/lib/app/algorithms/fibonacci.js +0 -17
- package/lib/app/algorithms/graph/iterator/AbstractGraphIterator.d.ts +0 -39
- package/lib/app/algorithms/graph/iterator/AbstractGraphIterator.js +0 -87
- package/lib/app/algorithms/graph/iterator/GraphIteratorBFS.d.ts +0 -28
- package/lib/app/algorithms/graph/iterator/GraphIteratorBFS.js +0 -70
- package/lib/app/algorithms/graph/iterator/GraphIteratorDFS.d.ts +0 -28
- package/lib/app/algorithms/graph/iterator/GraphIteratorDFS.js +0 -70
- package/lib/app/algorithms/graph/iterator/GraphIteratorDijkstra.d.ts +0 -32
- package/lib/app/algorithms/graph/iterator/GraphIteratorDijkstra.js +0 -97
- package/lib/app/algorithms/graph/iterator-strategy/BFSIterationStrategy.d.ts +0 -6
- package/lib/app/algorithms/graph/iterator-strategy/BFSIterationStrategy.js +0 -13
- package/lib/app/algorithms/graph/iterator-strategy/DFSIterationStrategy.d.ts +0 -6
- package/lib/app/algorithms/graph/iterator-strategy/DFSIterationStrategy.js +0 -13
- package/lib/app/algorithms/graph/iterator-strategy/DijkstraIterationStrategy.d.ts +0 -6
- package/lib/app/algorithms/graph/iterator-strategy/DijkstraIterationStrategy.js +0 -13
- package/lib/app/algorithms/graph/presenter/presenterAdjacencyLists.d.ts +0 -19
- package/lib/app/algorithms/graph/presenter/presenterAdjacencyLists.js +0 -28
- package/lib/app/algorithms/graph/presenter/presenterAdjacencyMatrix.d.ts +0 -32
- package/lib/app/algorithms/graph/presenter/presenterAdjacencyMatrix.js +0 -48
- package/lib/app/algorithms/graph/searching/hasPath.d.ts +0 -9
- package/lib/app/algorithms/graph/searching/hasPath.js +0 -30
- package/lib/app/algorithms/graph/searching/shortestPath.d.ts +0 -9
- package/lib/app/algorithms/graph/searching/shortestPath.js +0 -30
- package/lib/app/algorithms/graph/transposing/transposeDirectedGraph.d.ts +0 -2
- package/lib/app/algorithms/graph/transposing/transposeDirectedGraph.js +0 -14
- package/lib/app/algorithms/memoize.d.ts +0 -5
- package/lib/app/algorithms/memoize.js +0 -22
- package/lib/app/algorithms/sorts/bubble-sort.d.ts +0 -9
- package/lib/app/algorithms/sorts/bubble-sort.js +0 -23
- package/lib/app/algorithms/sorts/insertion-sort.d.ts +0 -9
- package/lib/app/algorithms/sorts/insertion-sort.js +0 -25
- package/lib/app/algorithms/sorts/merge-sort.d.ts +0 -9
- package/lib/app/algorithms/sorts/merge-sort.js +0 -61
- package/lib/app/algorithms/sorts/quick-sort.d.ts +0 -9
- package/lib/app/algorithms/sorts/quick-sort.js +0 -45
- package/lib/app/algorithms/sorts/select-sort.d.ts +0 -9
- package/lib/app/algorithms/sorts/select-sort.js +0 -20
- package/lib/app/algorithms/transpose-matrix.d.ts +0 -6
- package/lib/app/algorithms/transpose-matrix.js +0 -19
- package/lib/app/constants.d.ts +0 -2
- package/lib/app/constants.js +0 -6
- package/lib/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryNode.d.ts +0 -15
- package/lib/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryNode.js +0 -53
- package/lib/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryTree.d.ts +0 -60
- package/lib/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryTree.js +0 -35
- package/lib/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchNode.d.ts +0 -13
- package/lib/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchNode.js +0 -59
- package/lib/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchTree.d.ts +0 -75
- package/lib/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchTree.js +0 -276
- package/lib/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchNode.d.ts +0 -16
- package/lib/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchNode.js +0 -70
- package/lib/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchTree.d.ts +0 -58
- package/lib/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchTree.js +0 -236
- package/lib/app/data-structures/BinaryTree/_helpers/createBinaryTree.d.ts +0 -6
- package/lib/app/data-structures/BinaryTree/_helpers/createBinaryTree.js +0 -22
- package/lib/app/data-structures/Graph/AbstractGraph.d.ts +0 -84
- package/lib/app/data-structures/Graph/AbstractGraph.js +0 -143
- package/lib/app/data-structures/Graph/DirectedGraph.d.ts +0 -27
- package/lib/app/data-structures/Graph/DirectedGraph.js +0 -89
- package/lib/app/data-structures/Graph/GraphEdge.d.ts +0 -16
- package/lib/app/data-structures/Graph/GraphEdge.js +0 -43
- package/lib/app/data-structures/Graph/UndirectedGraph.d.ts +0 -31
- package/lib/app/data-structures/Graph/UndirectedGraph.js +0 -106
- package/lib/app/data-structures/Graph/_helpers/createGraph.d.ts +0 -6
- package/lib/app/data-structures/Graph/_helpers/createGraph.js +0 -22
- package/lib/app/data-structures/Graph/_helpers/createGraphFromMatrix.d.ts +0 -7
- package/lib/app/data-structures/Graph/_helpers/createGraphFromMatrix.js +0 -42
- package/lib/app/data-structures/Graph/_helpers/generateRandomGraph.d.ts +0 -4
- package/lib/app/data-structures/Graph/_helpers/generateRandomGraph.js +0 -67
- package/lib/app/data-structures/HashTable/HashTable.d.ts +0 -73
- package/lib/app/data-structures/HashTable/HashTable.js +0 -171
- package/lib/app/data-structures/HashTable/HashTableNode.d.ts +0 -11
- package/lib/app/data-structures/HashTable/HashTableNode.js +0 -39
- package/lib/app/data-structures/LinkedList/AbstractLinkedList/AbstractLinkedList.d.ts +0 -134
- package/lib/app/data-structures/LinkedList/AbstractLinkedList/AbstractLinkedList.js +0 -247
- package/lib/app/data-structures/LinkedList/AbstractLinkedList/AbstractLinkedNode.d.ts +0 -20
- package/lib/app/data-structures/LinkedList/AbstractLinkedList/AbstractLinkedNode.js +0 -41
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/DoubleLinkedList.d.ts +0 -42
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/DoubleLinkedList.js +0 -98
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/DoubleLinkedNode.d.ts +0 -25
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/DoubleLinkedNode.js +0 -65
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/IterableDoubleLinkedList.d.ts +0 -18
- package/lib/app/data-structures/LinkedList/DoubleLinkedList/IterableDoubleLinkedList.js +0 -86
- package/lib/app/data-structures/LinkedList/SingleLinkedList/IterableSingleLinkedList.d.ts +0 -18
- package/lib/app/data-structures/LinkedList/SingleLinkedList/IterableSingleLinkedList.js +0 -68
- package/lib/app/data-structures/LinkedList/SingleLinkedList/SingleLinkedList.d.ts +0 -46
- package/lib/app/data-structures/LinkedList/SingleLinkedList/SingleLinkedList.js +0 -103
- package/lib/app/data-structures/LinkedList/SingleLinkedList/SingleLinkedNode.d.ts +0 -7
- package/lib/app/data-structures/LinkedList/SingleLinkedList/SingleLinkedNode.js +0 -29
- package/lib/app/data-structures/LinkedList/_helpers/createLinkedList.d.ts +0 -3
- package/lib/app/data-structures/LinkedList/_helpers/createLinkedList.js +0 -34
- package/lib/app/data-structures/LoopedArray/LoopedArray.d.ts +0 -86
- package/lib/app/data-structures/LoopedArray/LoopedArray.js +0 -165
- package/lib/app/data-structures/Queue/Queue.d.ts +0 -50
- package/lib/app/data-structures/Queue/Queue.js +0 -85
- package/lib/app/data-structures/Stack/Stack.d.ts +0 -50
- package/lib/app/data-structures/Stack/Stack.js +0 -85
- package/lib/app/exceptions/CollectionIsEmptyException.d.ts +0 -4
- package/lib/app/exceptions/CollectionIsEmptyException.js +0 -28
- package/lib/app/exceptions/CollectionIsFullException.d.ts +0 -4
- package/lib/app/exceptions/CollectionIsFullException.js +0 -28
- package/lib/app/exceptions/IndexOutOfBoundsException.d.ts +0 -4
- package/lib/app/exceptions/IndexOutOfBoundsException.js +0 -28
- package/lib/app/exceptions/IsAlreadyExistsException.d.ts +0 -4
- package/lib/app/exceptions/IsAlreadyExistsException.js +0 -28
- package/lib/app/exceptions/IsNotFoundException.d.ts +0 -4
- package/lib/app/exceptions/IsNotFoundException.js +0 -28
- package/lib/app/exceptions/ValueOutOfRangeException.d.ts +0 -4
- package/lib/app/exceptions/ValueOutOfRangeException.js +0 -28
- package/lib/app/exceptions/base/IllegalArgumentException.d.ts +0 -3
- package/lib/app/exceptions/base/IllegalArgumentException.js +0 -27
- package/lib/app/exceptions/base/IllegalStateException.d.ts +0 -3
- package/lib/app/exceptions/base/IllegalStateException.js +0 -27
- package/lib/app/types/EnumBinarySearchTreeType.d.ts +0 -4
- package/lib/app/types/EnumBinarySearchTreeType.js +0 -9
- package/lib/app/types/EnumGraphTraversalType.d.ts +0 -5
- package/lib/app/types/EnumGraphTraversalType.js +0 -10
- package/lib/app/types/EnumGraphType.d.ts +0 -4
- package/lib/app/types/EnumGraphType.js +0 -9
- package/lib/app/types/EnumLinkedListType.d.ts +0 -4
- package/lib/app/types/EnumLinkedListType.js +0 -9
- package/lib/app/types/EnumRandomGenerationFormat.d.ts +0 -4
- package/lib/app/types/EnumRandomGenerationFormat.js +0 -9
- package/lib/app/types/EnumSortType.d.ts +0 -7
- package/lib/app/types/EnumSortType.js +0 -12
- package/lib/app/types/EnumTreeTraversalType.d.ts +0 -5
- package/lib/app/types/EnumTreeTraversalType.js +0 -10
- package/lib/app/types/FnCompareTwo.d.ts +0 -1
- package/lib/app/types/FnCompareTwo.js +0 -3
- package/lib/app/types/FnToMemoize.d.ts +0 -1
- package/lib/app/types/FnToMemoize.js +0 -3
- package/lib/app/types/IArrayFacade.d.ts +0 -4
- package/lib/app/types/IArrayFacade.js +0 -3
- package/lib/app/types/IBiDirectIterable.d.ts +0 -5
- package/lib/app/types/IBiDirectIterable.js +0 -3
- package/lib/app/types/IBiDirectIterator.d.ts +0 -11
- package/lib/app/types/IBiDirectIterator.js +0 -3
- package/lib/app/types/IBinaryTree.d.ts +0 -12
- package/lib/app/types/IBinaryTree.js +0 -3
- package/lib/app/types/IConvertableToArray.d.ts +0 -4
- package/lib/app/types/IConvertableToArray.js +0 -3
- package/lib/app/types/IGraph.d.ts +0 -14
- package/lib/app/types/IGraph.js +0 -3
- package/lib/app/types/IGraphIterationStrategy.d.ts +0 -5
- package/lib/app/types/IGraphIterationStrategy.js +0 -3
- package/lib/app/types/IGraphIterator.d.ts +0 -11
- package/lib/app/types/IGraphIterator.js +0 -3
- package/lib/app/types/IIterable.d.ts +0 -4
- package/lib/app/types/IIterable.js +0 -3
- package/lib/app/types/IIterator.d.ts +0 -14
- package/lib/app/types/IIterator.js +0 -3
- package/lib/app/types/IKeyValueStorage.d.ts +0 -8
- package/lib/app/types/IKeyValueStorage.js +0 -3
- package/lib/app/types/ILinearStorage.d.ts +0 -11
- package/lib/app/types/ILinearStorage.js +0 -3
- package/lib/app/types/ILinearStorageRA.d.ts +0 -13
- package/lib/app/types/ILinearStorageRA.js +0 -3
- package/lib/app/types/ILinkedList.d.ts +0 -4
- package/lib/app/types/ILinkedList.js +0 -3
- package/lib/app/types/TypeArrayMatrix.d.ts +0 -1
- package/lib/app/types/TypeArrayMatrix.js +0 -3
- package/lib/app/utils.d.ts +0 -29
- package/lib/app/utils.js +0 -61
- package/lib/exports/algorithms.d.ts +0 -16
- package/lib/exports/algorithms.js +0 -36
- package/lib/exports/constants.d.ts +0 -2
- package/lib/exports/constants.js +0 -7
- package/lib/exports/data-structures.d.ts +0 -13
- package/lib/exports/data-structures.js +0 -28
- package/lib/exports/helpers.d.ts +0 -6
- package/lib/exports/helpers.js +0 -14
- package/lib/exports/sorts.d.ts +0 -6
- package/lib/exports/sorts.js +0 -14
- package/lib/exports/types.d.ts +0 -16
- package/lib/exports/types.js +0 -34
- package/lib/exports/utils.d.ts +0 -3
- package/lib/exports/utils.js +0 -12
- package/lib/exports.d.ts +0 -55
- package/lib/exports.js +0 -107
- package/lib/index.js +0 -5
package/README.md
CHANGED
|
@@ -30,11 +30,9 @@ Clone this repository and install dependencies by using `yarn` command.
|
|
|
30
30
|
+ [Sorting algorithms](#sorting-algorithms)
|
|
31
31
|
+ [Linear data structures](#linear-data-structures)
|
|
32
32
|
+ [Linked list](#linked-list)
|
|
33
|
-
+ [Looped array](#looped-array)
|
|
34
33
|
+ [Stack](#stack)
|
|
35
34
|
+ [Queue](#queue)
|
|
36
35
|
+ [Non-linear data structures](#non-linear-data-structures)
|
|
37
|
-
+ [HASH table](#hash-table)
|
|
38
36
|
+ [Graph](#graph)
|
|
39
37
|
+ [Binary tree](#binary-trees)
|
|
40
38
|
|
|
@@ -88,39 +86,27 @@ Extends [ILinearStorage](src/app/types/ILinearStorage.ts) interface.
|
|
|
88
86
|
Extends [ILinearStorageRA](src/app/types/ILinearStorageRA.ts) and [IConvertableToArray](src/app/types/IConvertableToArray.ts) interface.
|
|
89
87
|
|
|
90
88
|
### Implementation
|
|
91
|
-
[AbstractLinkedList](src/app/data-structures/LinkedList/AbstractLinkedList/AbstractLinkedList.ts) — Common logic for both single and double linked lists.
|
|
89
|
+
[AbstractLinkedList](src/app/data-structures/LinkedList/core/AbstractLinkedList/AbstractLinkedList.ts) — Common logic for both single and double linked lists.
|
|
92
90
|
Implements [ILinearStorageRA](src/app/types/ILinearStorageRA.ts) interface.
|
|
93
91
|
|
|
94
|
-
[SingleLinkedList](src/app/data-structures/LinkedList/SingleLinkedList/SingleLinkedList.ts)
|
|
92
|
+
[SingleLinkedList](src/app/data-structures/LinkedList/core/SingleLinkedList/SingleLinkedList.ts)
|
|
95
93
|
[ [ tests ] ](test/unit/data-structures/linked-list/linked-list.test.ts)
|
|
96
94
|
— Extends abstract linked list with implementation of one-way linking.
|
|
97
95
|
|
|
98
|
-
[DoubleLinkedList](src/app/data-structures/LinkedList/DoubleLinkedList/DoubleLinkedList.ts)
|
|
96
|
+
[DoubleLinkedList](src/app/data-structures/LinkedList/core/DoubleLinkedList/DoubleLinkedList.ts)
|
|
99
97
|
[ [ tests ] ](test/unit/data-structures/linked-list/linked-list.test.ts)
|
|
100
98
|
— Extends abstract linked list with implementation of two-way linking.
|
|
101
99
|
|
|
102
|
-
[IterableSingleLinkedList](src/app/data-structures/LinkedList/SingleLinkedList/IterableSingleLinkedList.ts)
|
|
100
|
+
[IterableSingleLinkedList](src/app/data-structures/LinkedList/core/SingleLinkedList/IterableSingleLinkedList.ts)
|
|
103
101
|
[ [ tests ] ](test/unit/data-structures/linked-list/linked-list-iterable.test.ts)
|
|
104
102
|
— Extends single linked list with iterator implementation.
|
|
105
103
|
Implements [IIterable](src/app/types/IIterable.ts) interface.
|
|
106
104
|
|
|
107
|
-
[IterableDoubleLinkedList](src/app/data-structures/LinkedList/DoubleLinkedList/IterableDoubleLinkedList.ts)
|
|
105
|
+
[IterableDoubleLinkedList](src/app/data-structures/LinkedList/core/DoubleLinkedList/IterableDoubleLinkedList.ts)
|
|
108
106
|
[ [ tests ] ](test/unit/data-structures/linked-list/linked-list-iterable.test.ts)
|
|
109
107
|
— Extends double linked list with implementation of two-way linking.
|
|
110
108
|
Implements [IBiDirectIterable](src/app/types/IBiDirectIterable.ts) interface.
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
## Looped Array
|
|
114
|
-
|
|
115
|
-
### Interfaces
|
|
116
|
-
[IArrayFacade](src/app/types/IArrayFacade.ts) — Contains basic array operations.
|
|
117
|
-
Extends [ILinearStorageRA](src/app/types/ILinearStorageRA.ts) interface.
|
|
118
|
-
Extends [IConvertableToArray](src/app/types/IConvertableToArray.ts) interface.
|
|
119
|
-
|
|
120
|
-
### Implementation
|
|
121
|
-
[LoopedArray](src/app/data-structures/LoopedArray/LoopedArray.ts)[ [ tests ]](test/unit/data-structures/looped-array/looped-array.test.ts)
|
|
122
|
-
— Overwrites data on capacity overflow.
|
|
123
|
-
|
|
124
110
|
## Stack
|
|
125
111
|
|
|
126
112
|
### Implementation
|
|
@@ -137,17 +123,6 @@ Extends [IConvertableToArray](src/app/types/IConvertableToArray.ts) interface.
|
|
|
137
123
|
|
|
138
124
|
# Non linear data structures
|
|
139
125
|
|
|
140
|
-
## HASH Table
|
|
141
|
-
### Interfaces
|
|
142
|
-
[IKeyValueStorage](src/app/types/IKeyValueStorage.ts) — Contains basic key-value storages operations.
|
|
143
|
-
|
|
144
|
-
### Implementation
|
|
145
|
-
[HashTableNode](src/app/data-structures/HashTable/HashTableNode.ts) — Contains key, data and isDeleted properties.
|
|
146
|
-
|
|
147
|
-
[HashTable](src/app/data-structures/HashTable/HashTable.ts) [ [ tests ] ](test/unit/data-structures/hash-table/hash-table.test.ts) — Implementation of open addressing hash table using quadratic probing
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
126
|
## Graph
|
|
152
127
|
### Interfaces
|
|
153
128
|
[IGraph](src/app/types/IGraph.ts) — Contains basic graph operations.
|
|
@@ -157,52 +132,52 @@ Extends [IConvertableToArray](src/app/types/IConvertableToArray.ts) interface.
|
|
|
157
132
|
[IGraphIterationStrategy](src/app/types/IGraphIterationStrategy.ts) — Iteration strategies which are used in shortest-path, has-path.
|
|
158
133
|
|
|
159
134
|
### Implementation
|
|
160
|
-
[GraphEdge](src/app/data-structures/Graph/GraphEdge.ts) — Contains from/to links and edge weight.
|
|
135
|
+
[GraphEdge](src/app/data-structures/Graph/core/GraphEdge.ts) — Contains from/to links and edge weight.
|
|
161
136
|
|
|
162
|
-
[AbstractGraph](src/app/data-structures/Graph/AbstractGraph.ts) — Common logic for both directed and undirected graphs.
|
|
137
|
+
[AbstractGraph](src/app/data-structures/Graph/core/AbstractGraph.ts) — Common logic for both directed and undirected graphs.
|
|
163
138
|
|
|
164
139
|
|
|
165
|
-
[DirectedGraph](src/app/data-structures/Graph/DirectedGraph.ts) [ [ tests ] ](test/unit/data-structures/graph/graph.test.ts)
|
|
140
|
+
[DirectedGraph](src/app/data-structures/Graph/core/DirectedGraph.ts) [ [ tests ] ](test/unit/data-structures/graph/graph.test.ts)
|
|
166
141
|
— In case of directed graph A->B and B->A edges are not the same.
|
|
167
142
|
|
|
168
|
-
[UndirectedGraph](src/app/data-structures/Graph/UndirectedGraph.ts) [ [ tests ] ](test/unit/data-structures/graph/graph.test.ts)
|
|
143
|
+
[UndirectedGraph](src/app/data-structures/Graph/core/UndirectedGraph.ts) [ [ tests ] ](test/unit/data-structures/graph/graph.test.ts)
|
|
169
144
|
— In case of undirected graph A->B and B->A are equal.
|
|
170
145
|
|
|
171
146
|
|
|
172
147
|
### Graph Iterators
|
|
173
148
|
|
|
174
|
-
[BreadthFirstSearchIterator](src/app/
|
|
149
|
+
[BreadthFirstSearchIterator](src/app/data-structures/Graph/iterator/GraphIteratorBFS.ts)
|
|
175
150
|
— Traversal method for unweighted graphs, built on queue.
|
|
176
151
|
|
|
177
|
-
[DepthFirstSearchIterator](src/app/
|
|
152
|
+
[DepthFirstSearchIterator](src/app/data-structures/Graph/iterator/GraphIteratorDFS.ts)
|
|
178
153
|
— Traversal method for unweighted graphs, built on stack.
|
|
179
154
|
|
|
180
|
-
[DijkstraMethodIterator](src/app/
|
|
155
|
+
[DijkstraMethodIterator](src/app/data-structures/Graph/iterator/GraphIteratorDijkstra.ts)
|
|
181
156
|
— Traversal method for weighted graphs, built on finding the minimal cost.
|
|
182
157
|
|
|
183
158
|
|
|
184
159
|
### Graph Presenter
|
|
185
|
-
[presenter-adjacency-lists](src/app/
|
|
160
|
+
[presenter-adjacency-lists](src/app/data-structures/Graph/presenter/presenterAdjacencyLists.ts) [[ tests ](test/unit/data-structures/graph/graph.presenter.lists.test.ts)]
|
|
186
161
|
— Representation of graph as an adjacency list (using Map).
|
|
187
162
|
|
|
188
|
-
[presenter-adjacency-matrix](src/app/
|
|
163
|
+
[presenter-adjacency-matrix](src/app/data-structures/Graph/presenter/presenterAdjacencyMatrix.ts) [[ tests ](test/unit/data-structures/graph/graph.presenter.matrix.test.ts)]
|
|
189
164
|
— Representation of graph as an adjacency matrix (using Array N*N).
|
|
190
165
|
|
|
191
166
|
|
|
192
167
|
### Graph Searching
|
|
193
|
-
[has-path (BFS/DFS)](src/app/
|
|
168
|
+
[has-path (BFS/DFS)](src/app/data-structures/Graph/searching/hasPath.ts) [[ tests ](test/unit/data-structures/graph/graph.has-path.test.ts)]
|
|
194
169
|
— Search for the existence of a path between two vertices.
|
|
195
170
|
|
|
196
|
-
[shortest-path (BFS/Dijkstra)](src/app/
|
|
171
|
+
[shortest-path (BFS/Dijkstra)](src/app/data-structures/Graph/searching/shortestPath.ts) [[ tests ](test/unit/data-structures/graph/graph.shortest-path.test.ts)]
|
|
197
172
|
— Search for one of several shortest paths between two vertices.
|
|
198
173
|
|
|
199
174
|
### Graph Creators
|
|
200
|
-
[create-graph-from-matrix](src/app/data-structures/Graph/
|
|
175
|
+
[create-graph-from-matrix](src/app/data-structures/Graph/factories/createGraphFromMatrix.ts) [[ tests ](test/unit/data-structures/graph/graph.create-from-matrix.test.ts)]
|
|
201
176
|
— Convert a matrix N*N into a graph instance.
|
|
202
177
|
|
|
203
178
|
|
|
204
179
|
### Graph Transposing
|
|
205
|
-
[transpose-directed-graph](src/app/
|
|
180
|
+
[transpose-directed-graph](src/app/data-structures/Graph/transposing/transposeDirectedGraph.ts) [ [ tests ](test/unit/data-structures/graph/graph.transpose.test.ts)]
|
|
206
181
|
— Transpose a directed graph (undirected graphs are symmetrical already).
|
|
207
182
|
|
|
208
183
|
|
|
@@ -212,23 +187,23 @@ Extends [IConvertableToArray](src/app/types/IConvertableToArray.ts) interface.
|
|
|
212
187
|
|
|
213
188
|
### Implementation
|
|
214
189
|
|
|
215
|
-
[AbstractBinaryNode](src/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryNode.ts) — Contains left/right/parent links and node data.
|
|
190
|
+
[AbstractBinaryNode](src/app/data-structures/BinaryTree/core/AbstractBinaryTree/AbstractBinaryNode.ts) — Contains left/right/parent links and node data.
|
|
216
191
|
|
|
217
|
-
[AbstractBinaryTree](src/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryTree.ts) — Common logic for all types of binary trees.
|
|
192
|
+
[AbstractBinaryTree](src/app/data-structures/BinaryTree/core/AbstractBinaryTree/AbstractBinaryTree.ts) — Common logic for all types of binary trees.
|
|
218
193
|
|
|
219
194
|
|
|
220
|
-
[BinarySearchNode](src/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchNode.ts) — Same as abstract binary node.
|
|
195
|
+
[BinarySearchNode](src/app/data-structures/BinaryTree/core/BinarySearchTree/BinarySearchNode.ts) — Same as abstract binary node.
|
|
221
196
|
|
|
222
|
-
[BinarySearchTree](src/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchTree.ts) — Implementation of unbalanced binary search tree.
|
|
197
|
+
[BinarySearchTree](src/app/data-structures/BinaryTree/core/BinarySearchTree/BinarySearchTree.ts) — Implementation of unbalanced binary search tree.
|
|
223
198
|
Each node in left subtree is smaller and each node in right subtree is larger than the node data.
|
|
224
|
-
Extends [AbstractSearchTree](src/app/data-structures/BinaryTree/AbstractBinaryTree/AbstractBinaryTree.ts).
|
|
199
|
+
Extends [AbstractSearchTree](src/app/data-structures/BinaryTree/core/AbstractBinaryTree/AbstractBinaryTree.ts).
|
|
225
200
|
|
|
226
201
|
|
|
227
202
|
|
|
228
|
-
[RandBinarySearchNode](src/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchNode.ts) — Have a rank attribute.
|
|
229
|
-
Extends [BinarySearchNode](src/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchNode.ts).
|
|
203
|
+
[RandBinarySearchNode](src/app/data-structures/BinaryTree/core/RandBinarySearchTree/RandBinarySearchNode.ts) — Have a rank attribute.
|
|
204
|
+
Extends [BinarySearchNode](src/app/data-structures/BinaryTree/core/BinarySearchTree/BinarySearchNode.ts).
|
|
230
205
|
|
|
231
|
-
[RandBinarySearchTree](src/app/data-structures/BinaryTree/RandBinarySearchTree/RandBinarySearchTree.ts)
|
|
206
|
+
[RandBinarySearchTree](src/app/data-structures/BinaryTree/core/RandBinarySearchTree/RandBinarySearchTree.ts)
|
|
232
207
|
— Implementation of randomized binary search tree, which gives expected log(N) height.
|
|
233
208
|
INSERTION have a 1/N+1 probability of inserting into root.
|
|
234
|
-
Extends [BinarySearchTree](src/app/data-structures/BinaryTree/BinarySearchTree/BinarySearchTree.ts).
|
|
209
|
+
Extends [BinarySearchTree](src/app/data-structures/BinaryTree/core/BinarySearchTree/BinarySearchTree.ts).
|