data-structure-typed 1.21.2 → 1.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -13
- package/dist/bundle.js +1 -1
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +3 -3
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +1 -1
- package/dist/data-structures/binary-tree/avl-tree.d.ts +2 -2
- package/dist/data-structures/binary-tree/binary-tree.d.ts +2 -2
- package/dist/data-structures/binary-tree/bst.d.ts +3 -3
- package/dist/data-structures/binary-tree/bst.js +1 -1
- package/dist/data-structures/binary-tree/rb-tree.d.ts +2 -2
- package/dist/data-structures/binary-tree/rb-tree.js +1 -1
- package/dist/data-structures/binary-tree/segment-tree.d.ts +1 -1
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +3 -3
- package/dist/data-structures/binary-tree/tree-multiset.js +1 -1
- package/dist/data-structures/graph/abstract-graph.d.ts +8 -8
- package/dist/data-structures/graph/abstract-graph.js +6 -6
- package/dist/data-structures/graph/directed-graph.d.ts +2 -2
- package/dist/data-structures/graph/map-graph.d.ts +1 -1
- package/dist/data-structures/graph/undirected-graph.d.ts +2 -2
- package/dist/data-structures/heap/heap.d.ts +1 -1
- package/dist/data-structures/heap/heap.js +1 -1
- package/dist/data-structures/heap/max-heap.d.ts +1 -1
- package/dist/data-structures/heap/min-heap.d.ts +1 -1
- package/dist/data-structures/index.d.ts +0 -2
- package/dist/data-structures/index.js +0 -2
- package/dist/data-structures/matrix/navigator.d.ts +1 -1
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/{data-structures/interfaces → interfaces}/abstract-binary-tree.d.ts +1 -1
- package/dist/{data-structures/interfaces → interfaces}/avl-tree.d.ts +1 -1
- package/dist/{data-structures/interfaces → interfaces}/binary-tree.d.ts +1 -1
- package/dist/{data-structures/interfaces → interfaces}/bst.d.ts +1 -1
- package/dist/{data-structures/interfaces → interfaces}/rb-tree.d.ts +1 -1
- package/dist/{data-structures/interfaces → interfaces}/tree-multiset.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/abstract-binary-tree.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/avl-tree.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/binary-tree.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/bst.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/index.d.ts +0 -1
- package/dist/{data-structures/types → types/data-structures}/index.js +0 -1
- package/dist/{data-structures/types → types/data-structures}/rb-tree.d.ts +1 -1
- package/dist/{data-structures/types → types/data-structures}/tree-multiset.d.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +19 -0
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/utils.d.ts +1 -1
- package/package.json +21 -24
- package/.dependency-cruiser.js +0 -449
- package/dist/utils/validate-type.d.ts +0 -45
- package/dist/utils/validate-type.js +0 -58
- package/jest.config.js +0 -5
- package/rename_clear_files.sh +0 -29
- package/tsconfig.json +0 -38
- package/webpack.config.js +0 -27
- /package/dist/{data-structures/interfaces → interfaces}/abstract-binary-tree.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/abstract-graph.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/abstract-graph.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/avl-tree.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/binary-tree.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/bst.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/directed-graph.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/directed-graph.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/doubly-linked-list.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/doubly-linked-list.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/heap.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/heap.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/index.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/index.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/navigator.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/navigator.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/priority-queue.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/priority-queue.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/rb-tree.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/segment-tree.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/segment-tree.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/singly-linked-list.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/singly-linked-list.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/tree-multiset.js +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/undirected-graph.d.ts +0 -0
- /package/dist/{data-structures/interfaces → interfaces}/undirected-graph.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/abstract-binary-tree.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/abstract-graph.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/abstract-graph.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/avl-tree.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/binary-tree.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/bst.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/directed-graph.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/directed-graph.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/doubly-linked-list.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/doubly-linked-list.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/heap.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/heap.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/map-graph.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/map-graph.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/navigator.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/navigator.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/priority-queue.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/priority-queue.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/rb-tree.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/segment-tree.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/segment-tree.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/singly-linked-list.d.ts +0 -0
- /package/dist/{data-structures/types → types/data-structures}/singly-linked-list.js +0 -0
- /package/dist/{data-structures/types → types/data-structures}/tree-multiset.js +0 -0
- /package/dist/{data-structures/types → types}/helpers.d.ts +0 -0
- /package/dist/{data-structures/types → types}/helpers.js +0 -0
- /package/dist/{utils/types → types/utils}/index.d.ts +0 -0
- /package/dist/{utils/types → types/utils}/index.js +0 -0
- /package/dist/{utils/types → types/utils}/utils.d.ts +0 -0
- /package/dist/{utils/types → types/utils}/utils.js +0 -0
- /package/dist/{utils/types → types/utils}/validate-type.d.ts +0 -0
- /package/dist/{utils/types → types/utils}/validate-type.js +0 -0
package/README.md
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
## Brief
|
|
4
4
|
Javascript & TypeScript Data Structure collections.
|
|
5
5
|
|
|
6
|
-
## Algorithms
|
|
7
|
-
|
|
6
|
+
## Algorithms
|
|
8
7
|
DFS, DFSIterative, BFS, morris, Bellman-Ford Algorithm, Dijkstra's Algorithm, Floyd-Warshall Algorithm, Tarjan's Algorithm. Listed only a few out, you can discover more in API docs
|
|
9
8
|
|
|
10
9
|
## Code design
|
|
@@ -20,13 +19,13 @@ npm install data-structure-typed
|
|
|
20
19
|
```bash
|
|
21
20
|
yarn add data-structure-typed
|
|
22
21
|
```
|
|
23
|
-
###
|
|
22
|
+
### CDN
|
|
24
23
|
```html
|
|
25
24
|
<script src="https://cdn.jsdelivr.net/npm/data-structure-typed/dist/bundle.js"></script>
|
|
26
25
|
```
|
|
27
26
|
```javascript
|
|
28
|
-
const {AVLTree
|
|
29
|
-
const {MinHeap, SinglyLinkedList, DirectedVertex,
|
|
27
|
+
const {AVLTree} = dataStructureTyped;
|
|
28
|
+
const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedGraph, DirectedVertex, TreeMultiset} = dataStructureTyped;
|
|
30
29
|
```
|
|
31
30
|
|
|
32
31
|

|
|
@@ -74,7 +73,7 @@ const {MinHeap, SinglyLinkedList, DirectedVertex, Stack} = dataStructureTyped;
|
|
|
74
73
|
bst.get(6); // null
|
|
75
74
|
bst.isAVLBalanced(); // true or false
|
|
76
75
|
const bfsIDs = bst.BFS();
|
|
77
|
-
bfsIDs[0] === 11;
|
|
76
|
+
bfsIDs[0] === 11; // true
|
|
78
77
|
expect(bfsIDs[0]).toBe(11);
|
|
79
78
|
|
|
80
79
|
const objBST = new BST<BSTNode<{ id: number, keyA: number }>>();
|
|
@@ -118,7 +117,7 @@ const {MinHeap, SinglyLinkedList, DirectedVertex, Stack} = dataStructureTyped;
|
|
|
118
117
|
bst.get(6); // null
|
|
119
118
|
bst.isAVLBalanced(); // true or false
|
|
120
119
|
const bfsIDs = bst.BFS();
|
|
121
|
-
bfsIDs[0] === 11;
|
|
120
|
+
bfsIDs[0] === 11; // true
|
|
122
121
|
expect(bfsIDs[0]).toBe(11);
|
|
123
122
|
|
|
124
123
|
const objBST = new BST();
|
|
@@ -158,8 +157,8 @@ import {DirectedGraph} from 'data-structure-typed';
|
|
|
158
157
|
graph.hasVertex('C'); // false
|
|
159
158
|
|
|
160
159
|
graph.addEdge('A', 'B');
|
|
161
|
-
graph.hasEdge('A', 'B');
|
|
162
|
-
graph.hasEdge('B', 'A');
|
|
160
|
+
graph.hasEdge('A', 'B'); // true
|
|
161
|
+
graph.hasEdge('B', 'A'); // false
|
|
163
162
|
|
|
164
163
|
graph.removeEdgeSrcToDest('A', 'B');
|
|
165
164
|
graph.hasEdge('A', 'B'); // false
|
|
@@ -204,10 +203,8 @@ import {UndirectedGraph} from 'data-structure-typed';
|
|
|
204
203
|
<tbody>
|
|
205
204
|
<tr>
|
|
206
205
|
<td>Binary Tree</td>
|
|
207
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt="">
|
|
208
|
-
|
|
209
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt="">
|
|
210
|
-
</img></td>
|
|
206
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
207
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
211
208
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
212
209
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
213
210
|
</tr>
|