data-structure-typed 1.31.0 → 1.32.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.
Files changed (246) hide show
  1. package/.gitattributes +112 -0
  2. package/CHANGELOG.md +1 -1
  3. package/CODE-OF-CONDUCT.md +80 -0
  4. package/COMMANDS.md +28 -0
  5. package/SECURITY.md +15 -0
  6. package/coverage/clover.xml +3393 -0
  7. package/coverage/coverage-final.json +67 -0
  8. package/coverage/lcov-report/base.css +224 -0
  9. package/coverage/lcov-report/block-navigation.js +87 -0
  10. package/coverage/lcov-report/favicon.png +0 -0
  11. package/coverage/lcov-report/index.html +386 -0
  12. package/coverage/lcov-report/prettify.css +1 -0
  13. package/coverage/lcov-report/prettify.js +2 -0
  14. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  15. package/coverage/lcov-report/sorter.js +196 -0
  16. package/coverage/lcov-report/src/data-structures/binary-tree/aa-tree.ts.html +88 -0
  17. package/coverage/lcov-report/src/data-structures/binary-tree/abstract-binary-tree.ts.html +4966 -0
  18. package/coverage/lcov-report/src/data-structures/binary-tree/avl-tree.ts.html +1015 -0
  19. package/coverage/lcov-report/src/data-structures/binary-tree/b-tree.ts.html +88 -0
  20. package/coverage/lcov-report/src/data-structures/binary-tree/binary-indexed-tree.ts.html +313 -0
  21. package/coverage/lcov-report/src/data-structures/binary-tree/binary-tree.ts.html +226 -0
  22. package/coverage/lcov-report/src/data-structures/binary-tree/bst.ts.html +1714 -0
  23. package/coverage/lcov-report/src/data-structures/binary-tree/index.html +296 -0
  24. package/coverage/lcov-report/src/data-structures/binary-tree/index.ts.html +121 -0
  25. package/coverage/lcov-report/src/data-structures/binary-tree/rb-tree.ts.html +388 -0
  26. package/coverage/lcov-report/src/data-structures/binary-tree/segment-tree.ts.html +811 -0
  27. package/coverage/lcov-report/src/data-structures/binary-tree/splay-tree.ts.html +88 -0
  28. package/coverage/lcov-report/src/data-structures/binary-tree/tree-multiset.ts.html +2185 -0
  29. package/coverage/lcov-report/src/data-structures/binary-tree/two-three-tree.ts.html +88 -0
  30. package/coverage/lcov-report/src/data-structures/graph/abstract-graph.ts.html +3205 -0
  31. package/coverage/lcov-report/src/data-structures/graph/directed-graph.ts.html +1495 -0
  32. package/coverage/lcov-report/src/data-structures/graph/index.html +176 -0
  33. package/coverage/lcov-report/src/data-structures/graph/index.ts.html +97 -0
  34. package/coverage/lcov-report/src/data-structures/graph/map-graph.ts.html +472 -0
  35. package/coverage/lcov-report/src/data-structures/graph/undirected-graph.ts.html +907 -0
  36. package/coverage/lcov-report/src/data-structures/hash/coordinate-map.ts.html +286 -0
  37. package/coverage/lcov-report/src/data-structures/hash/coordinate-set.ts.html +253 -0
  38. package/coverage/lcov-report/src/data-structures/hash/hash-table.ts.html +88 -0
  39. package/coverage/lcov-report/src/data-structures/hash/index.html +206 -0
  40. package/coverage/lcov-report/src/data-structures/hash/index.ts.html +103 -0
  41. package/coverage/lcov-report/src/data-structures/hash/pair.ts.html +88 -0
  42. package/coverage/lcov-report/src/data-structures/hash/tree-map.ts.html +88 -0
  43. package/coverage/lcov-report/src/data-structures/hash/tree-set.ts.html +88 -0
  44. package/coverage/lcov-report/src/data-structures/heap/heap.ts.html +721 -0
  45. package/coverage/lcov-report/src/data-structures/heap/index.html +161 -0
  46. package/coverage/lcov-report/src/data-structures/heap/index.ts.html +94 -0
  47. package/coverage/lcov-report/src/data-structures/heap/max-heap.ts.html +178 -0
  48. package/coverage/lcov-report/src/data-structures/heap/min-heap.ts.html +181 -0
  49. package/coverage/lcov-report/src/data-structures/index.html +116 -0
  50. package/coverage/lcov-report/src/data-structures/index.ts.html +118 -0
  51. package/coverage/lcov-report/src/data-structures/linked-list/doubly-linked-list.ts.html +1804 -0
  52. package/coverage/lcov-report/src/data-structures/linked-list/index.html +161 -0
  53. package/coverage/lcov-report/src/data-structures/linked-list/index.ts.html +94 -0
  54. package/coverage/lcov-report/src/data-structures/linked-list/singly-linked-list.ts.html +1588 -0
  55. package/coverage/lcov-report/src/data-structures/linked-list/skip-linked-list.ts.html +88 -0
  56. package/coverage/lcov-report/src/data-structures/matrix/index.html +176 -0
  57. package/coverage/lcov-report/src/data-structures/matrix/index.ts.html +97 -0
  58. package/coverage/lcov-report/src/data-structures/matrix/matrix.ts.html +166 -0
  59. package/coverage/lcov-report/src/data-structures/matrix/matrix2d.ts.html +721 -0
  60. package/coverage/lcov-report/src/data-structures/matrix/navigator.ts.html +448 -0
  61. package/coverage/lcov-report/src/data-structures/matrix/vector2d.ts.html +1033 -0
  62. package/coverage/lcov-report/src/data-structures/priority-queue/index.html +161 -0
  63. package/coverage/lcov-report/src/data-structures/priority-queue/index.ts.html +94 -0
  64. package/coverage/lcov-report/src/data-structures/priority-queue/max-priority-queue.ts.html +253 -0
  65. package/coverage/lcov-report/src/data-structures/priority-queue/min-priority-queue.ts.html +256 -0
  66. package/coverage/lcov-report/src/data-structures/priority-queue/priority-queue.ts.html +1162 -0
  67. package/coverage/lcov-report/src/data-structures/queue/deque.ts.html +976 -0
  68. package/coverage/lcov-report/src/data-structures/queue/index.html +146 -0
  69. package/coverage/lcov-report/src/data-structures/queue/index.ts.html +91 -0
  70. package/coverage/lcov-report/src/data-structures/queue/queue.ts.html +658 -0
  71. package/coverage/lcov-report/src/data-structures/stack/index.html +131 -0
  72. package/coverage/lcov-report/src/data-structures/stack/index.ts.html +88 -0
  73. package/coverage/lcov-report/src/data-structures/stack/stack.ts.html +379 -0
  74. package/coverage/lcov-report/src/data-structures/tree/index.html +131 -0
  75. package/coverage/lcov-report/src/data-structures/tree/index.ts.html +88 -0
  76. package/coverage/lcov-report/src/data-structures/tree/tree.ts.html +292 -0
  77. package/coverage/lcov-report/src/data-structures/trie/index.html +131 -0
  78. package/coverage/lcov-report/src/data-structures/trie/index.ts.html +88 -0
  79. package/coverage/lcov-report/src/data-structures/trie/trie.ts.html +760 -0
  80. package/coverage/lcov-report/src/index.html +116 -0
  81. package/coverage/lcov-report/src/index.ts.html +97 -0
  82. package/coverage/lcov-report/src/interfaces/index.html +116 -0
  83. package/coverage/lcov-report/src/interfaces/index.ts.html +130 -0
  84. package/coverage/lcov-report/src/types/data-structures/abstract-binary-tree.ts.html +235 -0
  85. package/coverage/lcov-report/src/types/data-structures/bst.ts.html +124 -0
  86. package/coverage/lcov-report/src/types/data-structures/directed-graph.ts.html +109 -0
  87. package/coverage/lcov-report/src/types/data-structures/index.html +176 -0
  88. package/coverage/lcov-report/src/types/data-structures/index.ts.html +130 -0
  89. package/coverage/lcov-report/src/types/data-structures/rb-tree.ts.html +106 -0
  90. package/coverage/lcov-report/src/types/index.html +116 -0
  91. package/coverage/lcov-report/src/types/index.ts.html +94 -0
  92. package/coverage/lcov-report/src/types/utils/index.html +116 -0
  93. package/coverage/lcov-report/src/types/utils/index.ts.html +91 -0
  94. package/coverage/lcov-report/src/utils/index.html +131 -0
  95. package/coverage/lcov-report/src/utils/index.ts.html +88 -0
  96. package/coverage/lcov-report/src/utils/utils.ts.html +322 -0
  97. package/coverage/lcov-report/test/utils/index.html +146 -0
  98. package/coverage/lcov-report/test/utils/index.ts.html +91 -0
  99. package/coverage/lcov-report/test/utils/magnitude.ts.html +148 -0
  100. package/coverage/lcov-report/test/utils/number.ts.html +94 -0
  101. package/coverage/lcov.info +6676 -0
  102. package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
  103. package/docs/classes/AVLTree.html +205 -282
  104. package/docs/classes/AVLTreeNode.html +15 -15
  105. package/docs/classes/AaTree.html +1 -1
  106. package/docs/classes/AbstractBinaryTree.html +198 -275
  107. package/docs/classes/AbstractBinaryTreeNode.html +21 -21
  108. package/docs/classes/AbstractEdge.html +11 -11
  109. package/docs/classes/AbstractGraph.html +36 -36
  110. package/docs/classes/AbstractVertex.html +8 -8
  111. package/docs/classes/ArrayDeque.html +14 -14
  112. package/docs/classes/BST.html +198 -275
  113. package/docs/classes/BSTNode.html +15 -15
  114. package/docs/classes/BTree.html +1 -1
  115. package/docs/classes/BinaryIndexedTree.html +9 -9
  116. package/docs/classes/BinaryTree.html +191 -268
  117. package/docs/classes/BinaryTreeNode.html +15 -15
  118. package/docs/classes/Character.html +4 -4
  119. package/docs/classes/CoordinateMap.html +9 -9
  120. package/docs/classes/CoordinateSet.html +8 -8
  121. package/docs/classes/Deque.html +34 -34
  122. package/docs/classes/DirectedEdge.html +15 -15
  123. package/docs/classes/DirectedGraph.html +52 -52
  124. package/docs/classes/DirectedVertex.html +6 -6
  125. package/docs/classes/DoublyLinkedList.html +37 -37
  126. package/docs/classes/DoublyLinkedListNode.html +11 -11
  127. package/docs/classes/HashTable.html +1 -1
  128. package/docs/classes/Heap.html +26 -26
  129. package/docs/classes/HeapItem.html +8 -8
  130. package/docs/classes/LinkedListQueue.html +35 -35
  131. package/docs/classes/MapEdge.html +13 -13
  132. package/docs/classes/MapGraph.html +56 -56
  133. package/docs/classes/MapVertex.html +12 -12
  134. package/docs/classes/Matrix2D.html +16 -16
  135. package/docs/classes/MatrixNTI2D.html +4 -4
  136. package/docs/classes/MaxHeap.html +26 -26
  137. package/docs/classes/MaxPriorityQueue.html +34 -34
  138. package/docs/classes/MinHeap.html +26 -26
  139. package/docs/classes/MinPriorityQueue.html +34 -34
  140. package/docs/classes/Navigator.html +10 -10
  141. package/docs/classes/ObjectDeque.html +25 -25
  142. package/docs/classes/Pair.html +1 -1
  143. package/docs/classes/PriorityQueue.html +32 -32
  144. package/docs/classes/Queue.html +22 -22
  145. package/docs/classes/RBTree.html +198 -275
  146. package/docs/classes/RBTreeNode.html +18 -18
  147. package/docs/classes/SegmentTree.html +17 -17
  148. package/docs/classes/SegmentTreeNode.html +20 -20
  149. package/docs/classes/SinglyLinkedList.html +35 -35
  150. package/docs/classes/SinglyLinkedListNode.html +8 -8
  151. package/docs/classes/SkipLinkedList.html +1 -1
  152. package/docs/classes/SplayTree.html +1 -1
  153. package/docs/classes/Stack.html +12 -12
  154. package/docs/classes/TreeMap.html +1 -1
  155. package/docs/classes/TreeMultiset.html +219 -296
  156. package/docs/classes/TreeMultisetNode.html +18 -18
  157. package/docs/classes/TreeNode.html +13 -13
  158. package/docs/classes/TreeSet.html +1 -1
  159. package/docs/classes/Trie.html +13 -13
  160. package/docs/classes/TrieNode.html +11 -11
  161. package/docs/classes/TwoThreeTree.html +1 -1
  162. package/docs/classes/UndirectedEdge.html +12 -12
  163. package/docs/classes/UndirectedGraph.html +40 -40
  164. package/docs/classes/UndirectedVertex.html +6 -6
  165. package/docs/classes/Vector2D.html +28 -28
  166. package/docs/enums/CP.html +4 -4
  167. package/docs/enums/FamilyPosition.html +8 -8
  168. package/docs/enums/LoopType.html +3 -3
  169. package/docs/enums/RBColor.html +3 -3
  170. package/docs/enums/TopologicalProperty.html +4 -4
  171. package/docs/functions/arrayRemove.html +1 -1
  172. package/docs/functions/isThunk.html +1 -1
  173. package/docs/functions/toThunk.html +1 -1
  174. package/docs/functions/trampoline.html +1 -1
  175. package/docs/functions/trampolineAsync.html +1 -1
  176. package/docs/functions/uuidV4.html +1 -1
  177. package/docs/interfaces/IAVLTree.html +77 -77
  178. package/docs/interfaces/IAbstractBinaryTree.html +72 -72
  179. package/docs/interfaces/IAbstractBinaryTreeNode.html +14 -14
  180. package/docs/interfaces/IAbstractGraph.html +15 -15
  181. package/docs/interfaces/IBST.html +77 -77
  182. package/docs/interfaces/IDirectedGraph.html +23 -23
  183. package/docs/interfaces/IRBTree.html +77 -77
  184. package/docs/interfaces/IUNDirectedGraph.html +16 -16
  185. package/docs/types/AVLTreeNodeNested.html +1 -1
  186. package/docs/types/AVLTreeOptions.html +1 -1
  187. package/docs/types/AbstractBinaryTreeNodeNested.html +1 -1
  188. package/docs/types/AbstractBinaryTreeNodeProperties.html +1 -1
  189. package/docs/types/AbstractBinaryTreeNodeProperty.html +1 -1
  190. package/docs/types/AbstractBinaryTreeOptions.html +1 -1
  191. package/docs/types/BSTComparator.html +1 -1
  192. package/docs/types/BSTNodeNested.html +1 -1
  193. package/docs/types/BSTOptions.html +1 -1
  194. package/docs/types/BinaryTreeDeletedResult.html +1 -1
  195. package/docs/types/BinaryTreeNodeId.html +1 -1
  196. package/docs/types/BinaryTreeNodeNested.html +1 -1
  197. package/docs/types/BinaryTreeNodePropertyName.html +1 -1
  198. package/docs/types/BinaryTreeOptions.html +1 -1
  199. package/docs/types/DFSOrderPattern.html +1 -1
  200. package/docs/types/DijkstraResult.html +1 -1
  201. package/docs/types/Direction.html +1 -1
  202. package/docs/types/DummyAny.html +1 -1
  203. package/docs/types/EdgeId.html +1 -1
  204. package/docs/types/HeapOptions.html +1 -1
  205. package/docs/types/IAVLTreeNode.html +1 -1
  206. package/docs/types/IBSTNode.html +1 -1
  207. package/docs/types/IBinaryTree.html +1 -1
  208. package/docs/types/IBinaryTreeNode.html +1 -1
  209. package/docs/types/IRBTreeNode.html +1 -1
  210. package/docs/types/ITreeMultiset.html +1 -1
  211. package/docs/types/ITreeMultisetNode.html +1 -1
  212. package/docs/types/KeyValueObject.html +1 -1
  213. package/docs/types/KeyValueObjectWithId.html +1 -1
  214. package/docs/types/MapGraphCoordinate.html +1 -1
  215. package/docs/types/NavigatorParams.html +1 -1
  216. package/docs/types/NodeOrPropertyName.html +1 -1
  217. package/docs/types/NonNumberNonObjectButDefined.html +1 -1
  218. package/docs/types/ObjectWithNonNumberId.html +1 -1
  219. package/docs/types/ObjectWithNumberId.html +1 -1
  220. package/docs/types/ObjectWithoutId.html +1 -1
  221. package/docs/types/PriorityQueueComparator.html +1 -1
  222. package/docs/types/PriorityQueueDFSOrderPattern.html +1 -1
  223. package/docs/types/PriorityQueueOptions.html +1 -1
  224. package/docs/types/RBTreeNodeNested.html +1 -1
  225. package/docs/types/RBTreeOptions.html +1 -1
  226. package/docs/types/RestrictValById.html +1 -1
  227. package/docs/types/SegmentTreeNodeVal.html +1 -1
  228. package/docs/types/SpecifyOptional.html +1 -1
  229. package/docs/types/Thunk.html +1 -1
  230. package/docs/types/ToThunkFn.html +1 -1
  231. package/docs/types/TopologicalStatus.html +1 -1
  232. package/docs/types/TreeMultisetNodeNested.html +1 -1
  233. package/docs/types/TreeMultisetOptions.html +1 -1
  234. package/docs/types/TrlAsyncFn.html +1 -1
  235. package/docs/types/TrlFn.html +1 -1
  236. package/docs/types/Turning.html +1 -1
  237. package/docs/types/VertexId.html +1 -1
  238. package/docs/variables/THUNK_SYMBOL.html +1 -1
  239. package/jest.config.js +5 -3
  240. package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +169 -2
  241. package/lib/data-structures/binary-tree/abstract-binary-tree.js +31 -47
  242. package/package.json +26 -23
  243. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +1 -1
  244. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +3 -1
  245. package/tsconfig.json +1 -1
  246. package/umd/bundle.min.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-structure-typed",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "Data Structures of Javascript & TypeScript. AVLTree, Binary Search Tree, Binary Tree, Tree Multiset, Graph, Heap, Priority Queue, Linked List.",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -13,8 +13,8 @@
13
13
  "build:commonjs": "rm -rf dist && tsc --project tsconfig.build.json",
14
14
  "build:umd": "webpack",
15
15
  "build:docs": "typedoc --out docs ./src",
16
- "lint": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\"",
17
- "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
16
+ "lint": "eslint --fix \"src/**/*.{js,ts}\"",
17
+ "format": "prettier --write \"src/**/*.{js,ts}\"",
18
18
  "update:test-deps": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multiset-typed trie-typed undirected-graph-typed queue-typed --save-dev",
19
19
  "test": "jest",
20
20
  "deps:check": "dependency-cruiser src",
@@ -145,39 +145,42 @@
145
145
  "@typescript-eslint/eslint-plugin": "^5.6.0",
146
146
  "@typescript-eslint/parser": "^5.11.0",
147
147
  "auto-changelog": "^2.4.0",
148
- "avl-tree-typed": "^1.3.3",
149
- "binary-tree-typed": "^1.3.3",
150
- "bst-typed": "^1.3.3",
148
+ "avl-tree-typed": "^1.31.0",
149
+ "binary-tree-typed": "^1.31.0",
150
+ "bst-typed": "^1.31.0",
151
151
  "dependency-cruiser": "^13.1.2",
152
- "deque-typed": "^1.3.3",
153
- "directed-graph-typed": "^1.3.3",
154
- "doubly-linked-list-typed": "^1.3.3",
152
+ "deque-typed": "^1.31.0",
153
+ "directed-graph-typed": "^1.31.0",
154
+ "doubly-linked-list-typed": "^1.31.0",
155
155
  "eslint": "^7.32.0",
156
156
  "eslint-config-prettier": "^8.3.0",
157
157
  "eslint-import-resolver-alias": "^1.1.2",
158
158
  "eslint-import-resolver-typescript": "^2.5.0",
159
159
  "eslint-plugin-import": "^2.25.4",
160
- "graph-typed": "^1.3.3",
161
- "heap-typed": "^1.3.3",
160
+ "graph-typed": "^1.31.0",
161
+ "heap-typed": "^1.31.0",
162
162
  "jest": "^29.6.2",
163
- "linked-list-typed": "^1.3.3",
164
- "max-heap-typed": "^1.3.3",
165
- "max-priority-queue-typed": "^1.3.3",
166
- "min-heap-typed": "^1.3.3",
167
- "min-priority-queue-typed": "^1.3.3",
163
+ "linked-list-typed": "^1.31.0",
164
+ "max-heap-typed": "^1.31.0",
165
+ "max-priority-queue-typed": "^1.31.0",
166
+ "min-heap-typed": "^1.31.0",
167
+ "min-priority-queue-typed": "^1.31.0",
168
168
  "prettier": "^3.0.3",
169
- "priority-queue-typed": "^1.3.3",
170
- "queue-typed": "^1.3.3",
171
- "singly-linked-list-typed": "^1.3.3",
172
- "stack-typed": "^1.3.3",
173
- "tree-multiset-typed": "^1.3.3",
174
- "trie-typed": "^1.3.3",
169
+ "priority-queue-typed": "^1.31.0",
170
+ "queue-typed": "^1.31.0",
171
+ "singly-linked-list-typed": "^1.31.0",
172
+ "stack-typed": "^1.31.0",
173
+ "tree-multiset-typed": "^1.31.0",
174
+ "trie-typed": "^1.31.0",
175
175
  "ts-jest": "^29.1.1",
176
176
  "ts-loader": "^9.4.4",
177
177
  "typedoc": "^0.24.8",
178
178
  "typescript": "^4.9.5",
179
- "undirected-graph-typed": "^1.3.3",
179
+ "undirected-graph-typed": "^1.31.0",
180
180
  "webpack": "^5.88.2",
181
181
  "webpack-cli": "^5.1.4"
182
+ },
183
+ "dependencies": {
184
+ "data-structure-typed": "^1.31.0"
182
185
  }
183
186
  }
@@ -396,6 +396,6 @@ describe('SinglyLinkedList Performance Test', () => {
396
396
  }
397
397
 
398
398
  // expect(performance.now() - startPopTime).toBeLessThan(bigO.LINEAR);
399
- expect(performance.now() - startPopTime).toBeLessThan(bigO.LINEAR * 100);
399
+ expect(performance.now() - startPopTime).toBeLessThan(bigO.LINEAR * 300);
400
400
  });
401
401
  });
@@ -92,7 +92,9 @@ describe('MaxPriorityQueue Performance Test', () => {
92
92
  prev = polled;
93
93
  }
94
94
  }
95
- expect(performance.now() - startTime).toBeLessThan(bigO.LINEAR * 10);
95
+ expect(performance.now() - startTime).toBeLessThan(bigO.LINEAR * 50);
96
+ expect(prev).toBeGreaterThan(0);
97
+
96
98
  });
97
99
 
98
100
  it('should sorted.length to be the same as original data', () => {
package/tsconfig.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "outDir": "./lib",
4
4
  "declaration": true,
5
- "declarationDir": "./lib",
5
+ // "declarationDir": "./lib",
6
6
  "module": "ES6",
7
7
  "target": "ES6",
8
8
  "lib": [