data-structure-typed 1.32.0 → 1.32.2

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.
Files changed (258) hide show
  1. package/.github/workflows/ci.yml +12 -1
  2. package/.prettierrc.js +1 -1
  3. package/CHANGELOG.md +1 -1
  4. package/README.md +63 -176
  5. package/coverage/clover.xml +717 -717
  6. package/coverage/coverage-final.json +21 -21
  7. package/coverage/coverage-summary.json +68 -0
  8. package/coverage/lcov-report/index.html +1 -1
  9. package/coverage/lcov-report/src/data-structures/binary-tree/aa-tree.ts.html +1 -1
  10. package/coverage/lcov-report/src/data-structures/binary-tree/abstract-binary-tree.ts.html +19 -7
  11. package/coverage/lcov-report/src/data-structures/binary-tree/avl-tree.ts.html +5 -5
  12. package/coverage/lcov-report/src/data-structures/binary-tree/b-tree.ts.html +1 -1
  13. package/coverage/lcov-report/src/data-structures/binary-tree/binary-indexed-tree.ts.html +1 -1
  14. package/coverage/lcov-report/src/data-structures/binary-tree/binary-tree.ts.html +4 -4
  15. package/coverage/lcov-report/src/data-structures/binary-tree/bst.ts.html +7 -25
  16. package/coverage/lcov-report/src/data-structures/binary-tree/index.html +1 -1
  17. package/coverage/lcov-report/src/data-structures/binary-tree/index.ts.html +1 -1
  18. package/coverage/lcov-report/src/data-structures/binary-tree/rb-tree.ts.html +4 -4
  19. package/coverage/lcov-report/src/data-structures/binary-tree/segment-tree.ts.html +2 -2
  20. package/coverage/lcov-report/src/data-structures/binary-tree/splay-tree.ts.html +1 -1
  21. package/coverage/lcov-report/src/data-structures/binary-tree/tree-multiset.ts.html +9 -9
  22. package/coverage/lcov-report/src/data-structures/binary-tree/two-three-tree.ts.html +1 -1
  23. package/coverage/lcov-report/src/data-structures/graph/abstract-graph.ts.html +17 -17
  24. package/coverage/lcov-report/src/data-structures/graph/directed-graph.ts.html +5 -5
  25. package/coverage/lcov-report/src/data-structures/graph/index.html +1 -1
  26. package/coverage/lcov-report/src/data-structures/graph/index.ts.html +1 -1
  27. package/coverage/lcov-report/src/data-structures/graph/map-graph.ts.html +3 -3
  28. package/coverage/lcov-report/src/data-structures/graph/undirected-graph.ts.html +5 -5
  29. package/coverage/lcov-report/src/data-structures/hash/coordinate-map.ts.html +1 -1
  30. package/coverage/lcov-report/src/data-structures/hash/coordinate-set.ts.html +1 -1
  31. package/coverage/lcov-report/src/data-structures/hash/hash-table.ts.html +1 -1
  32. package/coverage/lcov-report/src/data-structures/hash/index.html +1 -1
  33. package/coverage/lcov-report/src/data-structures/hash/index.ts.html +1 -1
  34. package/coverage/lcov-report/src/data-structures/hash/pair.ts.html +1 -1
  35. package/coverage/lcov-report/src/data-structures/hash/tree-map.ts.html +1 -1
  36. package/coverage/lcov-report/src/data-structures/hash/tree-set.ts.html +1 -1
  37. package/coverage/lcov-report/src/data-structures/heap/heap.ts.html +4 -4
  38. package/coverage/lcov-report/src/data-structures/heap/index.html +1 -1
  39. package/coverage/lcov-report/src/data-structures/heap/index.ts.html +1 -1
  40. package/coverage/lcov-report/src/data-structures/heap/max-heap.ts.html +4 -4
  41. package/coverage/lcov-report/src/data-structures/heap/min-heap.ts.html +4 -4
  42. package/coverage/lcov-report/src/data-structures/index.html +1 -1
  43. package/coverage/lcov-report/src/data-structures/index.ts.html +1 -1
  44. package/coverage/lcov-report/src/data-structures/linked-list/doubly-linked-list.ts.html +1 -1
  45. package/coverage/lcov-report/src/data-structures/linked-list/index.html +1 -1
  46. package/coverage/lcov-report/src/data-structures/linked-list/index.ts.html +1 -1
  47. package/coverage/lcov-report/src/data-structures/linked-list/singly-linked-list.ts.html +1 -1
  48. package/coverage/lcov-report/src/data-structures/linked-list/skip-linked-list.ts.html +1 -1
  49. package/coverage/lcov-report/src/data-structures/matrix/index.html +1 -1
  50. package/coverage/lcov-report/src/data-structures/matrix/index.ts.html +1 -1
  51. package/coverage/lcov-report/src/data-structures/matrix/matrix.ts.html +3 -3
  52. package/coverage/lcov-report/src/data-structures/matrix/matrix2d.ts.html +1 -1
  53. package/coverage/lcov-report/src/data-structures/matrix/navigator.ts.html +4 -4
  54. package/coverage/lcov-report/src/data-structures/matrix/vector2d.ts.html +1 -1
  55. package/coverage/lcov-report/src/data-structures/priority-queue/index.html +1 -1
  56. package/coverage/lcov-report/src/data-structures/priority-queue/index.ts.html +1 -1
  57. package/coverage/lcov-report/src/data-structures/priority-queue/max-priority-queue.ts.html +6 -6
  58. package/coverage/lcov-report/src/data-structures/priority-queue/min-priority-queue.ts.html +3 -3
  59. package/coverage/lcov-report/src/data-structures/priority-queue/priority-queue.ts.html +32 -32
  60. package/coverage/lcov-report/src/data-structures/queue/deque.ts.html +5 -5
  61. package/coverage/lcov-report/src/data-structures/queue/index.html +1 -1
  62. package/coverage/lcov-report/src/data-structures/queue/index.ts.html +1 -1
  63. package/coverage/lcov-report/src/data-structures/queue/queue.ts.html +2 -2
  64. package/coverage/lcov-report/src/data-structures/stack/index.html +1 -1
  65. package/coverage/lcov-report/src/data-structures/stack/index.ts.html +1 -1
  66. package/coverage/lcov-report/src/data-structures/stack/stack.ts.html +1 -1
  67. package/coverage/lcov-report/src/data-structures/tree/index.html +1 -1
  68. package/coverage/lcov-report/src/data-structures/tree/index.ts.html +1 -1
  69. package/coverage/lcov-report/src/data-structures/tree/tree.ts.html +2 -2
  70. package/coverage/lcov-report/src/data-structures/trie/index.html +1 -1
  71. package/coverage/lcov-report/src/data-structures/trie/index.ts.html +1 -1
  72. package/coverage/lcov-report/src/data-structures/trie/trie.ts.html +1 -1
  73. package/coverage/lcov-report/src/index.html +1 -1
  74. package/coverage/lcov-report/src/index.ts.html +1 -1
  75. package/coverage/lcov-report/src/interfaces/index.html +1 -1
  76. package/coverage/lcov-report/src/interfaces/index.ts.html +1 -1
  77. package/coverage/lcov-report/src/types/data-structures/abstract-binary-tree.ts.html +1 -1
  78. package/coverage/lcov-report/src/types/data-structures/bst.ts.html +1 -1
  79. package/coverage/lcov-report/src/types/data-structures/directed-graph.ts.html +1 -1
  80. package/coverage/lcov-report/src/types/data-structures/index.html +1 -1
  81. package/coverage/lcov-report/src/types/data-structures/index.ts.html +1 -1
  82. package/coverage/lcov-report/src/types/data-structures/rb-tree.ts.html +1 -1
  83. package/coverage/lcov-report/src/types/index.html +1 -1
  84. package/coverage/lcov-report/src/types/index.ts.html +1 -1
  85. package/coverage/lcov-report/src/types/utils/index.html +1 -1
  86. package/coverage/lcov-report/src/types/utils/index.ts.html +1 -1
  87. package/coverage/lcov-report/src/utils/index.html +1 -1
  88. package/coverage/lcov-report/src/utils/index.ts.html +1 -1
  89. package/coverage/lcov-report/src/utils/utils.ts.html +4 -4
  90. package/coverage/lcov-report/test/utils/index.html +1 -1
  91. package/coverage/lcov-report/test/utils/index.ts.html +1 -1
  92. package/coverage/lcov-report/test/utils/magnitude.ts.html +1 -1
  93. package/coverage/lcov-report/test/utils/number.ts.html +1 -1
  94. package/coverage/lcov.info +1329 -1329
  95. package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
  96. package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
  97. package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
  98. package/dist/data-structures/binary-tree/bst.js.map +1 -1
  99. package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
  100. package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
  101. package/dist/data-structures/graph/abstract-graph.js.map +1 -1
  102. package/dist/data-structures/graph/directed-graph.js.map +1 -1
  103. package/dist/data-structures/graph/map-graph.js.map +1 -1
  104. package/dist/data-structures/graph/undirected-graph.js.map +1 -1
  105. package/dist/data-structures/heap/heap.js.map +1 -1
  106. package/dist/data-structures/heap/max-heap.js.map +1 -1
  107. package/dist/data-structures/heap/min-heap.js.map +1 -1
  108. package/dist/data-structures/matrix/matrix.js.map +1 -1
  109. package/dist/data-structures/matrix/navigator.js.map +1 -1
  110. package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  111. package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  112. package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
  113. package/dist/data-structures/queue/deque.js.map +1 -1
  114. package/dist/data-structures/queue/queue.js.map +1 -1
  115. package/dist/data-structures/tree/tree.js.map +1 -1
  116. package/dist/utils/utils.js.map +1 -1
  117. package/docs/classes/AVLTree.html +85 -85
  118. package/docs/classes/AVLTreeNode.html +15 -15
  119. package/docs/classes/AaTree.html +1 -1
  120. package/docs/classes/AbstractBinaryTree.html +78 -78
  121. package/docs/classes/AbstractBinaryTreeNode.html +21 -21
  122. package/docs/classes/AbstractEdge.html +11 -11
  123. package/docs/classes/AbstractGraph.html +36 -36
  124. package/docs/classes/AbstractVertex.html +8 -8
  125. package/docs/classes/ArrayDeque.html +14 -14
  126. package/docs/classes/BST.html +78 -78
  127. package/docs/classes/BSTNode.html +15 -15
  128. package/docs/classes/BTree.html +1 -1
  129. package/docs/classes/BinaryIndexedTree.html +9 -9
  130. package/docs/classes/BinaryTree.html +71 -71
  131. package/docs/classes/BinaryTreeNode.html +15 -15
  132. package/docs/classes/Character.html +4 -4
  133. package/docs/classes/CoordinateMap.html +9 -9
  134. package/docs/classes/CoordinateSet.html +8 -8
  135. package/docs/classes/Deque.html +34 -34
  136. package/docs/classes/DirectedEdge.html +15 -15
  137. package/docs/classes/DirectedGraph.html +52 -52
  138. package/docs/classes/DirectedVertex.html +6 -6
  139. package/docs/classes/DoublyLinkedList.html +37 -37
  140. package/docs/classes/DoublyLinkedListNode.html +11 -11
  141. package/docs/classes/HashTable.html +1 -1
  142. package/docs/classes/Heap.html +26 -26
  143. package/docs/classes/HeapItem.html +8 -8
  144. package/docs/classes/LinkedListQueue.html +35 -35
  145. package/docs/classes/MapEdge.html +13 -13
  146. package/docs/classes/MapGraph.html +56 -56
  147. package/docs/classes/MapVertex.html +12 -12
  148. package/docs/classes/Matrix2D.html +16 -16
  149. package/docs/classes/MatrixNTI2D.html +4 -4
  150. package/docs/classes/MaxHeap.html +26 -26
  151. package/docs/classes/MaxPriorityQueue.html +34 -34
  152. package/docs/classes/MinHeap.html +26 -26
  153. package/docs/classes/MinPriorityQueue.html +34 -34
  154. package/docs/classes/Navigator.html +10 -10
  155. package/docs/classes/ObjectDeque.html +25 -25
  156. package/docs/classes/Pair.html +1 -1
  157. package/docs/classes/PriorityQueue.html +32 -32
  158. package/docs/classes/Queue.html +22 -22
  159. package/docs/classes/RBTree.html +78 -78
  160. package/docs/classes/RBTreeNode.html +18 -18
  161. package/docs/classes/SegmentTree.html +17 -17
  162. package/docs/classes/SegmentTreeNode.html +20 -20
  163. package/docs/classes/SinglyLinkedList.html +35 -35
  164. package/docs/classes/SinglyLinkedListNode.html +8 -8
  165. package/docs/classes/SkipLinkedList.html +1 -1
  166. package/docs/classes/SplayTree.html +1 -1
  167. package/docs/classes/Stack.html +12 -12
  168. package/docs/classes/TreeMap.html +1 -1
  169. package/docs/classes/TreeMultiset.html +99 -99
  170. package/docs/classes/TreeMultisetNode.html +18 -18
  171. package/docs/classes/TreeNode.html +13 -13
  172. package/docs/classes/TreeSet.html +1 -1
  173. package/docs/classes/Trie.html +13 -13
  174. package/docs/classes/TrieNode.html +11 -11
  175. package/docs/classes/TwoThreeTree.html +1 -1
  176. package/docs/classes/UndirectedEdge.html +12 -12
  177. package/docs/classes/UndirectedGraph.html +40 -40
  178. package/docs/classes/UndirectedVertex.html +6 -6
  179. package/docs/classes/Vector2D.html +28 -28
  180. package/docs/enums/CP.html +4 -4
  181. package/docs/enums/FamilyPosition.html +8 -8
  182. package/docs/enums/LoopType.html +3 -3
  183. package/docs/enums/RBColor.html +3 -3
  184. package/docs/enums/TopologicalProperty.html +4 -4
  185. package/docs/functions/arrayRemove.html +1 -1
  186. package/docs/functions/isThunk.html +1 -1
  187. package/docs/functions/toThunk.html +1 -1
  188. package/docs/functions/trampoline.html +1 -1
  189. package/docs/functions/trampolineAsync.html +1 -1
  190. package/docs/functions/uuidV4.html +1 -1
  191. package/docs/index.html +21 -26
  192. package/docs/interfaces/IAVLTree.html +77 -77
  193. package/docs/interfaces/IAbstractBinaryTree.html +72 -72
  194. package/docs/interfaces/IAbstractBinaryTreeNode.html +14 -14
  195. package/docs/interfaces/IAbstractGraph.html +15 -15
  196. package/docs/interfaces/IBST.html +77 -77
  197. package/docs/interfaces/IDirectedGraph.html +23 -23
  198. package/docs/interfaces/IRBTree.html +77 -77
  199. package/docs/interfaces/IUNDirectedGraph.html +16 -16
  200. package/docs/types/AVLTreeNodeNested.html +1 -1
  201. package/docs/types/AVLTreeOptions.html +1 -1
  202. package/docs/types/AbstractBinaryTreeNodeNested.html +1 -1
  203. package/docs/types/AbstractBinaryTreeNodeProperties.html +1 -1
  204. package/docs/types/AbstractBinaryTreeNodeProperty.html +1 -1
  205. package/docs/types/AbstractBinaryTreeOptions.html +1 -1
  206. package/docs/types/BSTComparator.html +1 -1
  207. package/docs/types/BSTNodeNested.html +1 -1
  208. package/docs/types/BSTOptions.html +1 -1
  209. package/docs/types/BinaryTreeDeletedResult.html +1 -1
  210. package/docs/types/BinaryTreeNodeId.html +1 -1
  211. package/docs/types/BinaryTreeNodeNested.html +1 -1
  212. package/docs/types/BinaryTreeNodePropertyName.html +1 -1
  213. package/docs/types/BinaryTreeOptions.html +1 -1
  214. package/docs/types/DFSOrderPattern.html +1 -1
  215. package/docs/types/DijkstraResult.html +1 -1
  216. package/docs/types/Direction.html +1 -1
  217. package/docs/types/DummyAny.html +1 -1
  218. package/docs/types/EdgeId.html +1 -1
  219. package/docs/types/HeapOptions.html +1 -1
  220. package/docs/types/IAVLTreeNode.html +1 -1
  221. package/docs/types/IBSTNode.html +1 -1
  222. package/docs/types/IBinaryTree.html +1 -1
  223. package/docs/types/IBinaryTreeNode.html +1 -1
  224. package/docs/types/IRBTreeNode.html +1 -1
  225. package/docs/types/ITreeMultiset.html +1 -1
  226. package/docs/types/ITreeMultisetNode.html +1 -1
  227. package/docs/types/KeyValueObject.html +1 -1
  228. package/docs/types/KeyValueObjectWithId.html +1 -1
  229. package/docs/types/MapGraphCoordinate.html +1 -1
  230. package/docs/types/NavigatorParams.html +1 -1
  231. package/docs/types/NodeOrPropertyName.html +1 -1
  232. package/docs/types/NonNumberNonObjectButDefined.html +1 -1
  233. package/docs/types/ObjectWithNonNumberId.html +1 -1
  234. package/docs/types/ObjectWithNumberId.html +1 -1
  235. package/docs/types/ObjectWithoutId.html +1 -1
  236. package/docs/types/PriorityQueueComparator.html +1 -1
  237. package/docs/types/PriorityQueueDFSOrderPattern.html +1 -1
  238. package/docs/types/PriorityQueueOptions.html +1 -1
  239. package/docs/types/RBTreeNodeNested.html +1 -1
  240. package/docs/types/RBTreeOptions.html +1 -1
  241. package/docs/types/RestrictValById.html +1 -1
  242. package/docs/types/SegmentTreeNodeVal.html +1 -1
  243. package/docs/types/SpecifyOptional.html +1 -1
  244. package/docs/types/Thunk.html +1 -1
  245. package/docs/types/ToThunkFn.html +1 -1
  246. package/docs/types/TopologicalStatus.html +1 -1
  247. package/docs/types/TreeMultisetNodeNested.html +1 -1
  248. package/docs/types/TreeMultisetOptions.html +1 -1
  249. package/docs/types/TrlAsyncFn.html +1 -1
  250. package/docs/types/TrlFn.html +1 -1
  251. package/docs/types/Turning.html +1 -1
  252. package/docs/types/VertexId.html +1 -1
  253. package/docs/variables/THUNK_SYMBOL.html +1 -1
  254. package/jest.config.js +1 -0
  255. package/package.json +18 -6
  256. package/.auto-changelog-template.hbs +0 -36
  257. package/rename_clear_files.sh +0 -29
  258. package/tsconfig.build.json +0 -33
@@ -4,6 +4,17 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - main
7
+ # Ignore changes in folders with generated contents or documentation.
8
+ # Need to match git add parameters below.
9
+ paths-ignore:
10
+ - 'lib/**'
11
+ - 'dist/**'
12
+ - 'docs/**'
13
+ - 'coverage/**'
14
+ - '**/*.md'
15
+ pull_request:
16
+ branches:
17
+ - main
7
18
 
8
19
  jobs:
9
20
  build:
@@ -26,5 +37,5 @@ jobs:
26
37
  - name: Build
27
38
  run: npm run build
28
39
 
29
- - name: Run tests
40
+ - name: Run tests and documentation
30
41
  run: npm test
package/.prettierrc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  arrowParens: 'avoid',
3
- bracketSpacing: true,
3
+ bracketSpacing: false,
4
4
  htmlWhitespaceSensitivity: 'css',
5
5
  insertPragma: false,
6
6
  bracketSameLine: false,
package/CHANGELOG.md CHANGED
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
8
8
  - [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
9
9
  - [`auto-changelog`](https://github.com/CookPete/auto-changelog)
10
10
 
11
- ## [v1.32.0](https://github.com/zrwusa/data-structure-typed/compare/v1.12.9...main) (upcoming)
11
+ ## [v1.32.2](https://github.com/zrwusa/data-structure-typed/compare/v1.12.9...main) (upcoming)
12
12
 
13
13
  ## [v1.12.9](https://github.com/zrwusa/data-structure-typed/compare/v1.12.8...v1.12.9) (14 August 2023)
14
14
 
package/README.md CHANGED
@@ -1,4 +1,11 @@
1
- # What
1
+ # Data Structure Typed
2
+
3
+ ![License](https://img.shields.io/badge/License-MIT-blue.svg)
4
+ ![Language](https://img.shields.io/github/languages/top/zrwusa/data-structure-typed)
5
+ ![GitHub release (latest by date)](https://img.shields.io/github/v/release/zrwusa/data-structure-typed)
6
+ ![Branches](https://img.shields.io/badge/branches-97.54%25-brightgreen.svg?style=flat)
7
+ ![npm](https://aleen42.github.io/badges/src/npm.svg)
8
+ ![eslint](https://aleen42.github.io/badges/src/eslint.svg)
2
9
 
3
10
  ## Brief
4
11
  Data Structures of Javascript & TypeScript.
@@ -8,8 +15,7 @@ DFS(Depth-First Search), DFSIterative, BFS(Breadth-First Search),
8
15
  morris, Bellman-Ford Algorithm, Dijkstra's Algorithm, Floyd-Warshall Algorithm,
9
16
  Tarjan's Algorithm.
10
17
 
11
- # How
12
- ## install
18
+ ## Installation and Usage
13
19
  ### npm
14
20
  ```bash
15
21
  npm install data-structure-typed --save
@@ -22,7 +28,7 @@ yarn add data-structure-typed
22
28
  ```html
23
29
  <script src="https://cdn.jsdelivr.net/npm/data-structure-typed/umd/bundle.min.js"></script>
24
30
  ```
25
- ```javascript
31
+ ```js
26
32
  const {AVLTree} = dataStructureTyped;
27
33
  const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedGraph, DirectedVertex, TreeMultiset} = dataStructureTyped;
28
34
  ```
@@ -46,7 +52,7 @@ const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedG
46
52
  ## Code Snippet
47
53
  ### Binary Search Tree (BST) snippet
48
54
  #### TS
49
- ```typescript
55
+ ```ts
50
56
  import {BST, BSTNode} from 'data-structure-typed';
51
57
 
52
58
  const bst = new BST();
@@ -66,7 +72,6 @@ const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedG
66
72
  bst.get(6); // null
67
73
  bst.isAVLBalanced(); // true
68
74
  bst.BFS()[0] === 11; // true
69
-
70
75
 
71
76
  const objBST = new BST<BSTNode<{ id: number, keyA: number }>>();
72
77
  objBST.add(11, {id: 11, keyA: 11});
@@ -81,7 +86,7 @@ const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedG
81
86
  objBST.remove(11);
82
87
  ```
83
88
  #### JS
84
- ```javascript
89
+ ```js
85
90
  const {BST, BSTNode} = require('data-structure-typed');
86
91
 
87
92
  const bst = new BST();
@@ -116,84 +121,80 @@ const {Heap, MinHeap, SinglyLinkedList, Stack, AVLTreeNode, BST, Trie, DirectedG
116
121
 
117
122
  objBST.remove(11);
118
123
 
119
-
120
124
  const avlTree = new AVLTree();
121
125
  avlTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
122
126
  avlTree.isAVLBalanced(); // true
123
127
  avlTree.remove(10);
124
128
  avlTree.isAVLBalanced(); // true
125
-
126
129
  ```
127
130
 
128
131
  ### AVLTree snippet
129
132
  #### TS
130
- ```typescript
131
- import {AVLTree} from 'data-structure-typed';
132
-
133
- const avlTree = new AVLTree();
134
- avlTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
135
- avlTree.isAVLBalanced(); // true
136
- avlTree.remove(10);
137
- avlTree.isAVLBalanced(); // true
138
-
133
+ ```ts
134
+ import {AVLTree} from 'data-structure-typed';
135
+
136
+ const avlTree = new AVLTree();
137
+ avlTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
138
+ avlTree.isAVLBalanced(); // true
139
+ avlTree.remove(10);
140
+ avlTree.isAVLBalanced(); // true
139
141
  ```
140
142
  #### JS
141
- ```javascript
142
- const {AVLTree} = require('data-structure-typed');
143
-
144
- const avlTree = new AVLTree();
145
- avlTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
146
- avlTree.isAVLBalanced(); // true
147
- avlTree.remove(10);
148
- avlTree.isAVLBalanced(); // true
149
-
143
+ ```js
144
+ const {AVLTree} = require('data-structure-typed');
145
+
146
+ const avlTree = new AVLTree();
147
+ avlTree.addMany([11, 3, 15, 1, 8, 13, 16, 2, 6, 9, 12, 14, 4, 7, 10, 5])
148
+ avlTree.isAVLBalanced(); // true
149
+ avlTree.remove(10);
150
+ avlTree.isAVLBalanced(); // true
150
151
  ```
151
152
 
152
153
  ### Directed Graph simple snippet
153
154
  #### TS or JS
154
- ```typescript
155
+ ```ts
155
156
  import {DirectedGraph} from 'data-structure-typed';
156
157
 
157
- const graph = new DirectedGraph();
158
-
159
- graph.addVertex('A');
160
- graph.addVertex('B');
161
-
162
- graph.hasVertex('A'); // true
163
- graph.hasVertex('B'); // true
164
- graph.hasVertex('C'); // false
165
-
166
- graph.addEdge('A', 'B');
167
- graph.hasEdge('A', 'B'); // true
168
- graph.hasEdge('B', 'A'); // false
169
-
170
- graph.removeEdgeSrcToDest('A', 'B');
171
- graph.hasEdge('A', 'B'); // false
172
-
173
- graph.addVertex('C');
174
-
175
- graph.addEdge('A', 'B');
176
- graph.addEdge('B', 'C');
177
-
178
- const topologicalOrderIds = graph.topologicalSort(); // ['A', 'B', 'C']
158
+ const graph = new DirectedGraph();
159
+
160
+ graph.addVertex('A');
161
+ graph.addVertex('B');
162
+
163
+ graph.hasVertex('A'); // true
164
+ graph.hasVertex('B'); // true
165
+ graph.hasVertex('C'); // false
166
+
167
+ graph.addEdge('A', 'B');
168
+ graph.hasEdge('A', 'B'); // true
169
+ graph.hasEdge('B', 'A'); // false
170
+
171
+ graph.removeEdgeSrcToDest('A', 'B');
172
+ graph.hasEdge('A', 'B'); // false
173
+
174
+ graph.addVertex('C');
175
+
176
+ graph.addEdge('A', 'B');
177
+ graph.addEdge('B', 'C');
178
+
179
+ const topologicalOrderIds = graph.topologicalSort(); // ['A', 'B', 'C']
179
180
  ```
180
181
 
181
182
  ### Undirected Graph snippet
182
183
  #### TS or JS
183
- ```typescript
184
+ ```ts
184
185
  import {UndirectedGraph} from 'data-structure-typed';
185
186
 
186
- const graph = new UndirectedGraph();
187
- graph.addVertex('A');
188
- graph.addVertex('B');
189
- graph.addVertex('C');
190
- graph.addVertex('D');
191
- graph.removeVertex('C');
192
- graph.addEdge('A', 'B');
193
- graph.addEdge('B', 'D');
194
-
195
- const dijkstraResult = graph.dijkstra('A');
196
- Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D']
187
+ const graph = new UndirectedGraph();
188
+ graph.addVertex('A');
189
+ graph.addVertex('B');
190
+ graph.addVertex('C');
191
+ graph.addVertex('D');
192
+ graph.removeVertex('C');
193
+ graph.addEdge('A', 'B');
194
+ graph.addEdge('B', 'D');
195
+
196
+ const dijkstraResult = graph.dijkstra('A');
197
+ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D']
197
198
  ```
198
199
 
199
200
  ## Data Structures
@@ -320,20 +321,6 @@ import {UndirectedGraph} from 'data-structure-typed';
320
321
  <td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
321
322
  <td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
322
323
  </tr>
323
-
324
- [//]: # (<tr>)
325
-
326
- [//]: # (<td>Hash</td>)
327
-
328
- [//]: # (<td></td>)
329
-
330
- [//]: # (<td></td>)
331
-
332
- [//]: # (<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashTable.html"><span>HashTable</span></a></td>)
333
-
334
- [//]: # (<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>)
335
-
336
- [//]: # (</tr>)
337
324
  <tr>
338
325
  <td>Coordinate Set</td>
339
326
  <td></td>
@@ -386,100 +373,6 @@ import {UndirectedGraph} from 'data-structure-typed';
386
373
  </tbody>
387
374
  </table>
388
375
 
389
- [//]: # (## API docs)
390
-
391
- [//]: # (<ul>)
392
-
393
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html" rel="nofollow"><span>AVLTree</span></a></li>)
394
-
395
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTreeNode.html" rel="nofollow"><span>AVLTreeNode</span></a></li>)
396
-
397
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractEdge.html" rel="nofollow"><span>AbstractEdge</span></a></li>)
398
-
399
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html" rel="nofollow"><span>AbstractGraph</span></a></li>)
400
-
401
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractVertex.html" rel="nofollow"><span>AbstractVertex</span></a></li>)
402
-
403
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/ArrayDeque.html" rel="nofollow"><span>ArrayDeque</span></a></li>)
404
-
405
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html" rel="nofollow"><span>BST</span></a></li>)
406
-
407
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/BSTNode.html" rel="nofollow"><span>BSTNode</span></a></li>)
408
-
409
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html" rel="nofollow"><span>BinaryIndexedTree</span></a></li>)
410
-
411
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html" rel="nofollow"><span>BinaryTree</span></a></li>)
412
-
413
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTreeNode.html" rel="nofollow"><span>BinaryTreeNode</span></a></li>)
414
-
415
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Character.html" rel="nofollow"><span>Character</span></a></li>)
416
-
417
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateMap.html" rel="nofollow"><span>CoordinateMap</span></a></li>)
418
-
419
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateSet.html" rel="nofollow"><span>CoordinateSet</span></a></li>)
420
-
421
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Deque.html" rel="nofollow"><span>Deque</span></a></li>)
422
-
423
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedEdge.html" rel="nofollow"><span>DirectedEdge</span></a></li>)
424
-
425
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html" rel="nofollow"><span>DirectedGraph</span></a></li>)
426
-
427
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedVertex.html" rel="nofollow"><span>DirectedVertex</span></a></li>)
428
-
429
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html" rel="nofollow"><span>DoublyLinkedList</span></a></li>)
430
-
431
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedListNode.html" rel="nofollow"><span>DoublyLinkedListNode</span></a></li>)
432
-
433
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html" rel="nofollow"><span>Heap</span></a></li>)
434
-
435
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Matrix2D.html" rel="nofollow"><span>Matrix2D</span></a></li>)
436
-
437
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/MatrixNTI2D.html" rel="nofollow"><span>MatrixNTI2D</span></a></li>)
438
-
439
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/MaxHeap.html" rel="nofollow"><span>MaxHeap</span></a></li>)
440
-
441
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html" rel="nofollow"><span>MaxPriorityQueue</span></a></li>)
442
-
443
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/MinHeap.html" rel="nofollow"><span>MinHeap</span></a></li>)
444
-
445
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html" rel="nofollow"><span>MinPriorityQueue</span></a></li>)
446
-
447
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Navigator.html" rel="nofollow"><span>Navigator</span></a></li>)
448
-
449
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/ObjectDeque.html" rel="nofollow"><span>ObjectDeque</span></a></li>)
450
-
451
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html" rel="nofollow"><span>PriorityQueue</span></a></li>)
452
-
453
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html" rel="nofollow"><span>Queue</span></a></li>)
454
-
455
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html" rel="nofollow"><span>SegmentTree</span></a></li>)
456
-
457
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTreeNode.html" rel="nofollow"><span>SegmentTreeNode</span></a></li>)
458
-
459
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html" rel="nofollow"><span>SinglyLinkedList</span></a></li>)
460
-
461
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedListNode.html" rel="nofollow"><span>SinglyLinkedListNode</span></a></li>)
462
-
463
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html" rel="nofollow"><span>Stack</span></a></li>)
464
-
465
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultiSet.html" rel="nofollow"><span>TreeMultiSet</span></a></li>)
466
-
467
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html" rel="nofollow"><span>Trie</span></a></li>)
468
-
469
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/TrieNode.html" rel="nofollow"><span>TrieNode</span></a></li>)
470
-
471
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedEdge.html" rel="nofollow"><span>UndirectedEdge</span></a></li>)
472
-
473
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html" rel="nofollow"><span>UndirectedGraph</span></a></li>)
474
-
475
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedVertex.html" rel="nofollow"><span>UndirectedVertex</span></a></li>)
476
-
477
- [//]: # (<li><a href="https://data-structure-typed-docs.vercel.app/classes/Vector2D.html" rel="nofollow"><span>Vector2D</span></a></li>)
478
-
479
- [//]: # (</ul>)
480
-
481
- # Why
482
-
483
376
  ## Code design
484
377
  By strictly adhering to object-oriented design (BinaryTree -> BST -> AVLTree -> TreeMultiset), you can seamlessly inherit the existing data structures to implement the customized ones you need. Object-oriented design stands as the optimal approach to data structure design.
485
378
 
@@ -742,9 +635,3 @@ By strictly adhering to object-oriented design (BinaryTree -> BST -> AVLTree ->
742
635
  </tr>
743
636
  </tbody>
744
637
  </table>
745
-
746
- [//]: # (![overview diagram]&#40;https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/assets/overview-diagram-of-data-structures.png?raw=true&#41;)
747
-
748
- ![complexities](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/assets/complexities-diff.jpg?raw=true)
749
-
750
- ![complexities of data structures](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/assets/data-structure-complexities.jpg?raw=true)