data-structure-typed 1.31.0 → 1.32.1

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 (365) hide show
  1. package/.gitattributes +112 -0
  2. package/.github/workflows/ci.yml +12 -1
  3. package/.prettierrc.js +1 -1
  4. package/CHANGELOG.md +1 -1
  5. package/CODE-OF-CONDUCT.md +80 -0
  6. package/COMMANDS.md +28 -0
  7. package/README.md +20 -3
  8. package/SECURITY.md +15 -0
  9. package/coverage/clover.xml +3393 -0
  10. package/coverage/coverage-final.json +67 -0
  11. package/coverage/coverage-summary.json +68 -0
  12. package/coverage/lcov-report/base.css +224 -0
  13. package/coverage/lcov-report/block-navigation.js +87 -0
  14. package/coverage/lcov-report/favicon.png +0 -0
  15. package/coverage/lcov-report/index.html +386 -0
  16. package/coverage/lcov-report/prettify.css +1 -0
  17. package/coverage/lcov-report/prettify.js +2 -0
  18. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  19. package/coverage/lcov-report/sorter.js +196 -0
  20. package/coverage/lcov-report/src/data-structures/binary-tree/aa-tree.ts.html +88 -0
  21. package/coverage/lcov-report/src/data-structures/binary-tree/abstract-binary-tree.ts.html +4978 -0
  22. package/coverage/lcov-report/src/data-structures/binary-tree/avl-tree.ts.html +1015 -0
  23. package/coverage/lcov-report/src/data-structures/binary-tree/b-tree.ts.html +88 -0
  24. package/coverage/lcov-report/src/data-structures/binary-tree/binary-indexed-tree.ts.html +313 -0
  25. package/coverage/lcov-report/src/data-structures/binary-tree/binary-tree.ts.html +226 -0
  26. package/coverage/lcov-report/src/data-structures/binary-tree/bst.ts.html +1696 -0
  27. package/coverage/lcov-report/src/data-structures/binary-tree/index.html +296 -0
  28. package/coverage/lcov-report/src/data-structures/binary-tree/index.ts.html +121 -0
  29. package/coverage/lcov-report/src/data-structures/binary-tree/rb-tree.ts.html +388 -0
  30. package/coverage/lcov-report/src/data-structures/binary-tree/segment-tree.ts.html +811 -0
  31. package/coverage/lcov-report/src/data-structures/binary-tree/splay-tree.ts.html +88 -0
  32. package/coverage/lcov-report/src/data-structures/binary-tree/tree-multiset.ts.html +2185 -0
  33. package/coverage/lcov-report/src/data-structures/binary-tree/two-three-tree.ts.html +88 -0
  34. package/coverage/lcov-report/src/data-structures/graph/abstract-graph.ts.html +3205 -0
  35. package/coverage/lcov-report/src/data-structures/graph/directed-graph.ts.html +1495 -0
  36. package/coverage/lcov-report/src/data-structures/graph/index.html +176 -0
  37. package/coverage/lcov-report/src/data-structures/graph/index.ts.html +97 -0
  38. package/coverage/lcov-report/src/data-structures/graph/map-graph.ts.html +472 -0
  39. package/coverage/lcov-report/src/data-structures/graph/undirected-graph.ts.html +907 -0
  40. package/coverage/lcov-report/src/data-structures/hash/coordinate-map.ts.html +286 -0
  41. package/coverage/lcov-report/src/data-structures/hash/coordinate-set.ts.html +253 -0
  42. package/coverage/lcov-report/src/data-structures/hash/hash-table.ts.html +88 -0
  43. package/coverage/lcov-report/src/data-structures/hash/index.html +206 -0
  44. package/coverage/lcov-report/src/data-structures/hash/index.ts.html +103 -0
  45. package/coverage/lcov-report/src/data-structures/hash/pair.ts.html +88 -0
  46. package/coverage/lcov-report/src/data-structures/hash/tree-map.ts.html +88 -0
  47. package/coverage/lcov-report/src/data-structures/hash/tree-set.ts.html +88 -0
  48. package/coverage/lcov-report/src/data-structures/heap/heap.ts.html +721 -0
  49. package/coverage/lcov-report/src/data-structures/heap/index.html +161 -0
  50. package/coverage/lcov-report/src/data-structures/heap/index.ts.html +94 -0
  51. package/coverage/lcov-report/src/data-structures/heap/max-heap.ts.html +178 -0
  52. package/coverage/lcov-report/src/data-structures/heap/min-heap.ts.html +181 -0
  53. package/coverage/lcov-report/src/data-structures/index.html +116 -0
  54. package/coverage/lcov-report/src/data-structures/index.ts.html +118 -0
  55. package/coverage/lcov-report/src/data-structures/linked-list/doubly-linked-list.ts.html +1804 -0
  56. package/coverage/lcov-report/src/data-structures/linked-list/index.html +161 -0
  57. package/coverage/lcov-report/src/data-structures/linked-list/index.ts.html +94 -0
  58. package/coverage/lcov-report/src/data-structures/linked-list/singly-linked-list.ts.html +1588 -0
  59. package/coverage/lcov-report/src/data-structures/linked-list/skip-linked-list.ts.html +88 -0
  60. package/coverage/lcov-report/src/data-structures/matrix/index.html +176 -0
  61. package/coverage/lcov-report/src/data-structures/matrix/index.ts.html +97 -0
  62. package/coverage/lcov-report/src/data-structures/matrix/matrix.ts.html +166 -0
  63. package/coverage/lcov-report/src/data-structures/matrix/matrix2d.ts.html +721 -0
  64. package/coverage/lcov-report/src/data-structures/matrix/navigator.ts.html +448 -0
  65. package/coverage/lcov-report/src/data-structures/matrix/vector2d.ts.html +1033 -0
  66. package/coverage/lcov-report/src/data-structures/priority-queue/index.html +161 -0
  67. package/coverage/lcov-report/src/data-structures/priority-queue/index.ts.html +94 -0
  68. package/coverage/lcov-report/src/data-structures/priority-queue/max-priority-queue.ts.html +253 -0
  69. package/coverage/lcov-report/src/data-structures/priority-queue/min-priority-queue.ts.html +256 -0
  70. package/coverage/lcov-report/src/data-structures/priority-queue/priority-queue.ts.html +1162 -0
  71. package/coverage/lcov-report/src/data-structures/queue/deque.ts.html +976 -0
  72. package/coverage/lcov-report/src/data-structures/queue/index.html +146 -0
  73. package/coverage/lcov-report/src/data-structures/queue/index.ts.html +91 -0
  74. package/coverage/lcov-report/src/data-structures/queue/queue.ts.html +658 -0
  75. package/coverage/lcov-report/src/data-structures/stack/index.html +131 -0
  76. package/coverage/lcov-report/src/data-structures/stack/index.ts.html +88 -0
  77. package/coverage/lcov-report/src/data-structures/stack/stack.ts.html +379 -0
  78. package/coverage/lcov-report/src/data-structures/tree/index.html +131 -0
  79. package/coverage/lcov-report/src/data-structures/tree/index.ts.html +88 -0
  80. package/coverage/lcov-report/src/data-structures/tree/tree.ts.html +292 -0
  81. package/coverage/lcov-report/src/data-structures/trie/index.html +131 -0
  82. package/coverage/lcov-report/src/data-structures/trie/index.ts.html +88 -0
  83. package/coverage/lcov-report/src/data-structures/trie/trie.ts.html +760 -0
  84. package/coverage/lcov-report/src/index.html +116 -0
  85. package/coverage/lcov-report/src/index.ts.html +97 -0
  86. package/coverage/lcov-report/src/interfaces/index.html +116 -0
  87. package/coverage/lcov-report/src/interfaces/index.ts.html +130 -0
  88. package/coverage/lcov-report/src/types/data-structures/abstract-binary-tree.ts.html +235 -0
  89. package/coverage/lcov-report/src/types/data-structures/bst.ts.html +124 -0
  90. package/coverage/lcov-report/src/types/data-structures/directed-graph.ts.html +109 -0
  91. package/coverage/lcov-report/src/types/data-structures/index.html +176 -0
  92. package/coverage/lcov-report/src/types/data-structures/index.ts.html +130 -0
  93. package/coverage/lcov-report/src/types/data-structures/rb-tree.ts.html +106 -0
  94. package/coverage/lcov-report/src/types/index.html +116 -0
  95. package/coverage/lcov-report/src/types/index.ts.html +94 -0
  96. package/coverage/lcov-report/src/types/utils/index.html +116 -0
  97. package/coverage/lcov-report/src/types/utils/index.ts.html +91 -0
  98. package/coverage/lcov-report/src/utils/index.html +131 -0
  99. package/coverage/lcov-report/src/utils/index.ts.html +88 -0
  100. package/coverage/lcov-report/src/utils/utils.ts.html +322 -0
  101. package/coverage/lcov-report/test/utils/index.html +146 -0
  102. package/coverage/lcov-report/test/utils/index.ts.html +91 -0
  103. package/coverage/lcov-report/test/utils/magnitude.ts.html +148 -0
  104. package/coverage/lcov-report/test/utils/number.ts.html +94 -0
  105. package/coverage/lcov.info +6676 -0
  106. package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
  107. package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
  108. package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
  109. package/dist/data-structures/binary-tree/bst.js.map +1 -1
  110. package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
  111. package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
  112. package/dist/data-structures/graph/abstract-graph.js.map +1 -1
  113. package/dist/data-structures/graph/directed-graph.js.map +1 -1
  114. package/dist/data-structures/graph/map-graph.js.map +1 -1
  115. package/dist/data-structures/graph/undirected-graph.js.map +1 -1
  116. package/dist/data-structures/heap/heap.js.map +1 -1
  117. package/dist/data-structures/heap/max-heap.js.map +1 -1
  118. package/dist/data-structures/heap/min-heap.js.map +1 -1
  119. package/dist/data-structures/matrix/matrix.js.map +1 -1
  120. package/dist/data-structures/matrix/navigator.js.map +1 -1
  121. package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  122. package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  123. package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
  124. package/dist/data-structures/queue/deque.js.map +1 -1
  125. package/dist/data-structures/queue/queue.js.map +1 -1
  126. package/dist/data-structures/tree/tree.js.map +1 -1
  127. package/dist/utils/utils.js.map +1 -1
  128. package/docs/classes/AVLTree.html +205 -282
  129. package/docs/classes/AVLTreeNode.html +15 -15
  130. package/docs/classes/AaTree.html +1 -1
  131. package/docs/classes/AbstractBinaryTree.html +198 -275
  132. package/docs/classes/AbstractBinaryTreeNode.html +21 -21
  133. package/docs/classes/AbstractEdge.html +11 -11
  134. package/docs/classes/AbstractGraph.html +36 -36
  135. package/docs/classes/AbstractVertex.html +8 -8
  136. package/docs/classes/ArrayDeque.html +14 -14
  137. package/docs/classes/BST.html +198 -275
  138. package/docs/classes/BSTNode.html +15 -15
  139. package/docs/classes/BTree.html +1 -1
  140. package/docs/classes/BinaryIndexedTree.html +9 -9
  141. package/docs/classes/BinaryTree.html +191 -268
  142. package/docs/classes/BinaryTreeNode.html +15 -15
  143. package/docs/classes/Character.html +4 -4
  144. package/docs/classes/CoordinateMap.html +9 -9
  145. package/docs/classes/CoordinateSet.html +8 -8
  146. package/docs/classes/Deque.html +34 -34
  147. package/docs/classes/DirectedEdge.html +15 -15
  148. package/docs/classes/DirectedGraph.html +52 -52
  149. package/docs/classes/DirectedVertex.html +6 -6
  150. package/docs/classes/DoublyLinkedList.html +37 -37
  151. package/docs/classes/DoublyLinkedListNode.html +11 -11
  152. package/docs/classes/HashTable.html +1 -1
  153. package/docs/classes/Heap.html +26 -26
  154. package/docs/classes/HeapItem.html +8 -8
  155. package/docs/classes/LinkedListQueue.html +35 -35
  156. package/docs/classes/MapEdge.html +13 -13
  157. package/docs/classes/MapGraph.html +56 -56
  158. package/docs/classes/MapVertex.html +12 -12
  159. package/docs/classes/Matrix2D.html +16 -16
  160. package/docs/classes/MatrixNTI2D.html +4 -4
  161. package/docs/classes/MaxHeap.html +26 -26
  162. package/docs/classes/MaxPriorityQueue.html +34 -34
  163. package/docs/classes/MinHeap.html +26 -26
  164. package/docs/classes/MinPriorityQueue.html +34 -34
  165. package/docs/classes/Navigator.html +10 -10
  166. package/docs/classes/ObjectDeque.html +25 -25
  167. package/docs/classes/Pair.html +1 -1
  168. package/docs/classes/PriorityQueue.html +32 -32
  169. package/docs/classes/Queue.html +22 -22
  170. package/docs/classes/RBTree.html +198 -275
  171. package/docs/classes/RBTreeNode.html +18 -18
  172. package/docs/classes/SegmentTree.html +17 -17
  173. package/docs/classes/SegmentTreeNode.html +20 -20
  174. package/docs/classes/SinglyLinkedList.html +35 -35
  175. package/docs/classes/SinglyLinkedListNode.html +8 -8
  176. package/docs/classes/SkipLinkedList.html +1 -1
  177. package/docs/classes/SplayTree.html +1 -1
  178. package/docs/classes/Stack.html +12 -12
  179. package/docs/classes/TreeMap.html +1 -1
  180. package/docs/classes/TreeMultiset.html +219 -296
  181. package/docs/classes/TreeMultisetNode.html +18 -18
  182. package/docs/classes/TreeNode.html +13 -13
  183. package/docs/classes/TreeSet.html +1 -1
  184. package/docs/classes/Trie.html +13 -13
  185. package/docs/classes/TrieNode.html +11 -11
  186. package/docs/classes/TwoThreeTree.html +1 -1
  187. package/docs/classes/UndirectedEdge.html +12 -12
  188. package/docs/classes/UndirectedGraph.html +40 -40
  189. package/docs/classes/UndirectedVertex.html +6 -6
  190. package/docs/classes/Vector2D.html +28 -28
  191. package/docs/enums/CP.html +4 -4
  192. package/docs/enums/FamilyPosition.html +8 -8
  193. package/docs/enums/LoopType.html +3 -3
  194. package/docs/enums/RBColor.html +3 -3
  195. package/docs/enums/TopologicalProperty.html +4 -4
  196. package/docs/functions/arrayRemove.html +1 -1
  197. package/docs/functions/isThunk.html +1 -1
  198. package/docs/functions/toThunk.html +1 -1
  199. package/docs/functions/trampoline.html +1 -1
  200. package/docs/functions/trampolineAsync.html +1 -1
  201. package/docs/functions/uuidV4.html +1 -1
  202. package/docs/index.html +11 -12
  203. package/docs/interfaces/IAVLTree.html +77 -77
  204. package/docs/interfaces/IAbstractBinaryTree.html +72 -72
  205. package/docs/interfaces/IAbstractBinaryTreeNode.html +14 -14
  206. package/docs/interfaces/IAbstractGraph.html +15 -15
  207. package/docs/interfaces/IBST.html +77 -77
  208. package/docs/interfaces/IDirectedGraph.html +23 -23
  209. package/docs/interfaces/IRBTree.html +77 -77
  210. package/docs/interfaces/IUNDirectedGraph.html +16 -16
  211. package/docs/types/AVLTreeNodeNested.html +1 -1
  212. package/docs/types/AVLTreeOptions.html +1 -1
  213. package/docs/types/AbstractBinaryTreeNodeNested.html +1 -1
  214. package/docs/types/AbstractBinaryTreeNodeProperties.html +1 -1
  215. package/docs/types/AbstractBinaryTreeNodeProperty.html +1 -1
  216. package/docs/types/AbstractBinaryTreeOptions.html +1 -1
  217. package/docs/types/BSTComparator.html +1 -1
  218. package/docs/types/BSTNodeNested.html +1 -1
  219. package/docs/types/BSTOptions.html +1 -1
  220. package/docs/types/BinaryTreeDeletedResult.html +1 -1
  221. package/docs/types/BinaryTreeNodeId.html +1 -1
  222. package/docs/types/BinaryTreeNodeNested.html +1 -1
  223. package/docs/types/BinaryTreeNodePropertyName.html +1 -1
  224. package/docs/types/BinaryTreeOptions.html +1 -1
  225. package/docs/types/DFSOrderPattern.html +1 -1
  226. package/docs/types/DijkstraResult.html +1 -1
  227. package/docs/types/Direction.html +1 -1
  228. package/docs/types/DummyAny.html +1 -1
  229. package/docs/types/EdgeId.html +1 -1
  230. package/docs/types/HeapOptions.html +1 -1
  231. package/docs/types/IAVLTreeNode.html +1 -1
  232. package/docs/types/IBSTNode.html +1 -1
  233. package/docs/types/IBinaryTree.html +1 -1
  234. package/docs/types/IBinaryTreeNode.html +1 -1
  235. package/docs/types/IRBTreeNode.html +1 -1
  236. package/docs/types/ITreeMultiset.html +1 -1
  237. package/docs/types/ITreeMultisetNode.html +1 -1
  238. package/docs/types/KeyValueObject.html +1 -1
  239. package/docs/types/KeyValueObjectWithId.html +1 -1
  240. package/docs/types/MapGraphCoordinate.html +1 -1
  241. package/docs/types/NavigatorParams.html +1 -1
  242. package/docs/types/NodeOrPropertyName.html +1 -1
  243. package/docs/types/NonNumberNonObjectButDefined.html +1 -1
  244. package/docs/types/ObjectWithNonNumberId.html +1 -1
  245. package/docs/types/ObjectWithNumberId.html +1 -1
  246. package/docs/types/ObjectWithoutId.html +1 -1
  247. package/docs/types/PriorityQueueComparator.html +1 -1
  248. package/docs/types/PriorityQueueDFSOrderPattern.html +1 -1
  249. package/docs/types/PriorityQueueOptions.html +1 -1
  250. package/docs/types/RBTreeNodeNested.html +1 -1
  251. package/docs/types/RBTreeOptions.html +1 -1
  252. package/docs/types/RestrictValById.html +1 -1
  253. package/docs/types/SegmentTreeNodeVal.html +1 -1
  254. package/docs/types/SpecifyOptional.html +1 -1
  255. package/docs/types/Thunk.html +1 -1
  256. package/docs/types/ToThunkFn.html +1 -1
  257. package/docs/types/TopologicalStatus.html +1 -1
  258. package/docs/types/TreeMultisetNodeNested.html +1 -1
  259. package/docs/types/TreeMultisetOptions.html +1 -1
  260. package/docs/types/TrlAsyncFn.html +1 -1
  261. package/docs/types/TrlFn.html +1 -1
  262. package/docs/types/Turning.html +1 -1
  263. package/docs/types/VertexId.html +1 -1
  264. package/docs/variables/THUNK_SYMBOL.html +1 -1
  265. package/jest.config.js +6 -3
  266. package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +169 -2
  267. package/lib/data-structures/binary-tree/abstract-binary-tree.js +31 -47
  268. package/package.json +40 -25
  269. package/src/data-structures/binary-tree/aa-tree.ts +1 -0
  270. package/src/data-structures/binary-tree/abstract-binary-tree.ts +1631 -0
  271. package/src/data-structures/binary-tree/avl-tree.ts +310 -0
  272. package/src/data-structures/binary-tree/b-tree.ts +1 -0
  273. package/src/data-structures/binary-tree/binary-indexed-tree.ts +76 -0
  274. package/src/data-structures/binary-tree/binary-tree.ts +47 -0
  275. package/src/data-structures/binary-tree/bst.ts +537 -0
  276. package/src/data-structures/binary-tree/index.ts +12 -0
  277. package/src/data-structures/binary-tree/rb-tree.ts +101 -0
  278. package/src/data-structures/binary-tree/segment-tree.ts +242 -0
  279. package/src/data-structures/binary-tree/splay-tree.ts +1 -0
  280. package/src/data-structures/binary-tree/tree-multiset.ts +700 -0
  281. package/src/data-structures/binary-tree/two-three-tree.ts +1 -0
  282. package/src/data-structures/diagrams/README.md +5 -0
  283. package/src/data-structures/graph/abstract-graph.ts +1040 -0
  284. package/src/data-structures/graph/directed-graph.ts +470 -0
  285. package/src/data-structures/graph/index.ts +4 -0
  286. package/src/data-structures/graph/map-graph.ts +129 -0
  287. package/src/data-structures/graph/undirected-graph.ts +274 -0
  288. package/src/data-structures/hash/coordinate-map.ts +67 -0
  289. package/src/data-structures/hash/coordinate-set.ts +56 -0
  290. package/src/data-structures/hash/hash-table.ts +1 -0
  291. package/src/data-structures/hash/index.ts +6 -0
  292. package/src/data-structures/hash/pair.ts +1 -0
  293. package/src/data-structures/hash/tree-map.ts +1 -0
  294. package/src/data-structures/hash/tree-set.ts +1 -0
  295. package/src/data-structures/heap/heap.ts +212 -0
  296. package/src/data-structures/heap/index.ts +3 -0
  297. package/src/data-structures/heap/max-heap.ts +31 -0
  298. package/src/data-structures/heap/min-heap.ts +32 -0
  299. package/src/data-structures/index.ts +11 -0
  300. package/src/data-structures/linked-list/doubly-linked-list.ts +573 -0
  301. package/src/data-structures/linked-list/index.ts +3 -0
  302. package/src/data-structures/linked-list/singly-linked-list.ts +501 -0
  303. package/src/data-structures/linked-list/skip-linked-list.ts +1 -0
  304. package/src/data-structures/matrix/index.ts +4 -0
  305. package/src/data-structures/matrix/matrix.ts +27 -0
  306. package/src/data-structures/matrix/matrix2d.ts +212 -0
  307. package/src/data-structures/matrix/navigator.ts +121 -0
  308. package/src/data-structures/matrix/vector2d.ts +316 -0
  309. package/src/data-structures/priority-queue/index.ts +3 -0
  310. package/src/data-structures/priority-queue/max-priority-queue.ts +56 -0
  311. package/src/data-structures/priority-queue/min-priority-queue.ts +57 -0
  312. package/src/data-structures/priority-queue/priority-queue.ts +359 -0
  313. package/src/data-structures/queue/deque.ts +297 -0
  314. package/src/data-structures/queue/index.ts +2 -0
  315. package/src/data-structures/queue/queue.ts +191 -0
  316. package/src/data-structures/stack/index.ts +1 -0
  317. package/src/data-structures/stack/stack.ts +98 -0
  318. package/src/data-structures/tree/index.ts +1 -0
  319. package/src/data-structures/tree/tree.ts +69 -0
  320. package/src/data-structures/trie/index.ts +1 -0
  321. package/src/data-structures/trie/trie.ts +225 -0
  322. package/src/index.ts +4 -0
  323. package/src/interfaces/abstract-binary-tree.ts +191 -0
  324. package/src/interfaces/abstract-graph.ts +31 -0
  325. package/src/interfaces/avl-tree.ts +25 -0
  326. package/src/interfaces/binary-tree.ts +6 -0
  327. package/src/interfaces/bst.ts +31 -0
  328. package/src/interfaces/directed-graph.ts +20 -0
  329. package/src/interfaces/doubly-linked-list.ts +1 -0
  330. package/src/interfaces/heap.ts +1 -0
  331. package/src/interfaces/index.ts +15 -0
  332. package/src/interfaces/navigator.ts +1 -0
  333. package/src/interfaces/priority-queue.ts +1 -0
  334. package/src/interfaces/rb-tree.ts +9 -0
  335. package/src/interfaces/segment-tree.ts +1 -0
  336. package/src/interfaces/singly-linked-list.ts +1 -0
  337. package/src/interfaces/tree-multiset.ts +7 -0
  338. package/src/interfaces/undirected-graph.ts +6 -0
  339. package/src/types/data-structures/abstract-binary-tree.ts +50 -0
  340. package/src/types/data-structures/abstract-graph.ts +11 -0
  341. package/src/types/data-structures/avl-tree.ts +5 -0
  342. package/src/types/data-structures/binary-tree.ts +5 -0
  343. package/src/types/data-structures/bst.ts +13 -0
  344. package/src/types/data-structures/directed-graph.ts +8 -0
  345. package/src/types/data-structures/doubly-linked-list.ts +1 -0
  346. package/src/types/data-structures/heap.ts +5 -0
  347. package/src/types/data-structures/index.ts +15 -0
  348. package/src/types/data-structures/map-graph.ts +1 -0
  349. package/src/types/data-structures/navigator.ts +13 -0
  350. package/src/types/data-structures/priority-queue.ts +9 -0
  351. package/src/types/data-structures/rb-tree.ts +8 -0
  352. package/src/types/data-structures/segment-tree.ts +1 -0
  353. package/src/types/data-structures/singly-linked-list.ts +1 -0
  354. package/src/types/data-structures/tree-multiset.ts +6 -0
  355. package/src/types/helpers.ts +1 -0
  356. package/src/types/index.ts +3 -0
  357. package/src/types/utils/index.ts +2 -0
  358. package/src/types/utils/utils.ts +6 -0
  359. package/src/types/utils/validate-type.ts +35 -0
  360. package/src/utils/index.ts +1 -0
  361. package/src/utils/utils.ts +79 -0
  362. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +1 -1
  363. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +3 -1
  364. package/tsconfig.json +1 -1
  365. package/umd/bundle.min.js.map +1 -1
@@ -31,7 +31,7 @@
31
31
  <ul class="tsd-hierarchy">
32
32
  <li><a href="../interfaces/IAbstractBinaryTree.html" class="tsd-signature-type tsd-kind-interface">IAbstractBinaryTree</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">&gt;</span></li></ul></section><aside class="tsd-sources">
33
33
  <ul>
34
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L138">src/data-structures/binary-tree/abstract-binary-tree.ts:138</a></li></ul></aside>
34
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L138">src/data-structures/binary-tree/abstract-binary-tree.ts:138</a></li></ul></aside>
35
35
  <section class="tsd-panel-group tsd-index-group">
36
36
  <section class="tsd-panel tsd-index-panel">
37
37
  <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -132,44 +132,44 @@ tree.</p>
132
132
  <h4 class="tsd-returns-title">Returns <a href="AbstractBinaryTree.html" class="tsd-signature-type tsd-kind-class">AbstractBinaryTree</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">&gt;</span></h4>
133
133
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
134
134
  <ul>
135
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L146">src/data-structures/binary-tree/abstract-binary-tree.ts:146</a></li></ul></aside></li></ul></section></section>
135
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L146">src/data-structures/binary-tree/abstract-binary-tree.ts:146</a></li></ul></aside></li></ul></section></section>
136
136
  <section class="tsd-panel-group tsd-member-group">
137
137
  <h2>Properties</h2>
138
138
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_loopType" class="tsd-anchor"></a>
139
139
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_loop<wbr/>Type</span><a href="#_loopType" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
140
140
  <div class="tsd-signature"><span class="tsd-kind-property">_loop<wbr/>Type</span><span class="tsd-signature-symbol">:</span> <a href="../enums/LoopType.html" class="tsd-signature-type tsd-kind-enum">LoopType</a><span class="tsd-signature-symbol"> = LoopType.ITERATIVE</span></div><aside class="tsd-sources">
141
141
  <ul>
142
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L166">src/data-structures/binary-tree/abstract-binary-tree.ts:166</a></li></ul></aside></section>
142
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L166">src/data-structures/binary-tree/abstract-binary-tree.ts:166</a></li></ul></aside></section>
143
143
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_root" class="tsd-anchor"></a>
144
144
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_root</span><a href="#_root" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
145
145
  <div class="tsd-signature"><span class="tsd-kind-property">_root</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources">
146
146
  <ul>
147
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L154">src/data-structures/binary-tree/abstract-binary-tree.ts:154</a></li></ul></aside></section>
147
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L154">src/data-structures/binary-tree/abstract-binary-tree.ts:154</a></li></ul></aside></section>
148
148
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_size" class="tsd-anchor"></a>
149
149
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_size</span><a href="#_size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
150
150
  <div class="tsd-signature"><span class="tsd-kind-property">_size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div><aside class="tsd-sources">
151
151
  <ul>
152
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L160">src/data-structures/binary-tree/abstract-binary-tree.ts:160</a></li></ul></aside></section>
152
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L160">src/data-structures/binary-tree/abstract-binary-tree.ts:160</a></li></ul></aside></section>
153
153
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_visitedId" class="tsd-anchor"></a>
154
154
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_visited<wbr/>Id</span><a href="#_visitedId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
155
155
  <div class="tsd-signature"><span class="tsd-kind-property">_visited<wbr/>Id</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources">
156
156
  <ul>
157
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L172">src/data-structures/binary-tree/abstract-binary-tree.ts:172</a></li></ul></aside></section>
157
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L172">src/data-structures/binary-tree/abstract-binary-tree.ts:172</a></li></ul></aside></section>
158
158
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_visitedLeftSum" class="tsd-anchor"></a>
159
159
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_visited<wbr/>Left<wbr/>Sum</span><a href="#_visitedLeftSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
160
160
  <div class="tsd-signature"><span class="tsd-kind-property">_visited<wbr/>Left<wbr/>Sum</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources">
161
161
  <ul>
162
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L190">src/data-structures/binary-tree/abstract-binary-tree.ts:190</a></li></ul></aside></section>
162
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L190">src/data-structures/binary-tree/abstract-binary-tree.ts:190</a></li></ul></aside></section>
163
163
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_visitedNode" class="tsd-anchor"></a>
164
164
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_visited<wbr/>Node</span><a href="#_visitedNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
165
165
  <div class="tsd-signature"><span class="tsd-kind-property">_visited<wbr/>Node</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources">
166
166
  <ul>
167
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L184">src/data-structures/binary-tree/abstract-binary-tree.ts:184</a></li></ul></aside></section>
167
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L184">src/data-structures/binary-tree/abstract-binary-tree.ts:184</a></li></ul></aside></section>
168
168
  <section class="tsd-panel tsd-member tsd-is-private"><a id="_visitedVal" class="tsd-anchor"></a>
169
169
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_visited<wbr/>Val</span><a href="#_visitedVal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
170
170
  <div class="tsd-signature"><span class="tsd-kind-property">_visited<wbr/>Val</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources">
171
171
  <ul>
172
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L178">src/data-structures/binary-tree/abstract-binary-tree.ts:178</a></li></ul></aside></section></section>
172
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L178">src/data-structures/binary-tree/abstract-binary-tree.ts:178</a></li></ul></aside></section></section>
173
173
  <section class="tsd-panel-group tsd-member-group">
174
174
  <h2>Accessors</h2>
175
175
  <section class="tsd-panel tsd-member"><a id="loopType" class="tsd-anchor"></a>
@@ -180,7 +180,7 @@ tree.</p>
180
180
  <h4 class="tsd-returns-title">Returns <a href="../enums/LoopType.html" class="tsd-signature-type tsd-kind-enum">LoopType</a></h4><aside class="tsd-sources">
181
181
  <p>Implementation of IAbstractBinaryTree.loopType</p>
182
182
  <ul>
183
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L168">src/data-structures/binary-tree/abstract-binary-tree.ts:168</a></li></ul></aside></li></ul></section>
183
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L168">src/data-structures/binary-tree/abstract-binary-tree.ts:168</a></li></ul></aside></li></ul></section>
184
184
  <section class="tsd-panel tsd-member"><a id="root" class="tsd-anchor"></a>
185
185
  <h3 class="tsd-anchor-link"><span>root</span><a href="#root" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
186
186
  <ul class="tsd-signatures">
@@ -189,7 +189,7 @@ tree.</p>
189
189
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><aside class="tsd-sources">
190
190
  <p>Implementation of IAbstractBinaryTree.root</p>
191
191
  <ul>
192
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L156">src/data-structures/binary-tree/abstract-binary-tree.ts:156</a></li></ul></aside></li></ul></section>
192
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L156">src/data-structures/binary-tree/abstract-binary-tree.ts:156</a></li></ul></aside></li></ul></section>
193
193
  <section class="tsd-panel tsd-member"><a id="size" class="tsd-anchor"></a>
194
194
  <h3 class="tsd-anchor-link"><span>size</span><a href="#size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
195
195
  <ul class="tsd-signatures">
@@ -198,7 +198,7 @@ tree.</p>
198
198
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
199
199
  <p>Implementation of IAbstractBinaryTree.size</p>
200
200
  <ul>
201
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L162">src/data-structures/binary-tree/abstract-binary-tree.ts:162</a></li></ul></aside></li></ul></section>
201
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L162">src/data-structures/binary-tree/abstract-binary-tree.ts:162</a></li></ul></aside></li></ul></section>
202
202
  <section class="tsd-panel tsd-member"><a id="visitedId" class="tsd-anchor"></a>
203
203
  <h3 class="tsd-anchor-link"><span>visited<wbr/>Id</span><a href="#visitedId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
204
204
  <ul class="tsd-signatures">
@@ -207,7 +207,7 @@ tree.</p>
207
207
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
208
208
  <p>Implementation of IAbstractBinaryTree.visitedId</p>
209
209
  <ul>
210
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L174">src/data-structures/binary-tree/abstract-binary-tree.ts:174</a></li></ul></aside></li></ul></section>
210
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L174">src/data-structures/binary-tree/abstract-binary-tree.ts:174</a></li></ul></aside></li></ul></section>
211
211
  <section class="tsd-panel tsd-member"><a id="visitedLeftSum" class="tsd-anchor"></a>
212
212
  <h3 class="tsd-anchor-link"><span>visited<wbr/>Left<wbr/>Sum</span><a href="#visitedLeftSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
213
213
  <ul class="tsd-signatures">
@@ -216,7 +216,7 @@ tree.</p>
216
216
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
217
217
  <p>Implementation of IAbstractBinaryTree.visitedLeftSum</p>
218
218
  <ul>
219
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L192">src/data-structures/binary-tree/abstract-binary-tree.ts:192</a></li></ul></aside></li></ul></section>
219
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L192">src/data-structures/binary-tree/abstract-binary-tree.ts:192</a></li></ul></aside></li></ul></section>
220
220
  <section class="tsd-panel tsd-member"><a id="visitedNode" class="tsd-anchor"></a>
221
221
  <h3 class="tsd-anchor-link"><span>visited<wbr/>Node</span><a href="#visitedNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
222
222
  <ul class="tsd-signatures">
@@ -225,7 +225,7 @@ tree.</p>
225
225
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
226
226
  <p>Implementation of IAbstractBinaryTree.visitedNode</p>
227
227
  <ul>
228
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L186">src/data-structures/binary-tree/abstract-binary-tree.ts:186</a></li></ul></aside></li></ul></section>
228
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L186">src/data-structures/binary-tree/abstract-binary-tree.ts:186</a></li></ul></aside></li></ul></section>
229
229
  <section class="tsd-panel tsd-member"><a id="visitedVal" class="tsd-anchor"></a>
230
230
  <h3 class="tsd-anchor-link"><span>visited<wbr/>Val</span><a href="#visitedVal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
231
231
  <ul class="tsd-signatures">
@@ -234,7 +234,7 @@ tree.</p>
234
234
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
235
235
  <p>Implementation of IAbstractBinaryTree.visitedVal</p>
236
236
  <ul>
237
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L180">src/data-structures/binary-tree/abstract-binary-tree.ts:180</a></li></ul></aside></li></ul></section></section>
237
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L180">src/data-structures/binary-tree/abstract-binary-tree.ts:180</a></li></ul></aside></li></ul></section></section>
238
238
  <section class="tsd-panel-group tsd-member-group">
239
239
  <h2>Methods</h2>
240
240
  <section class="tsd-panel tsd-member"><a id="BFS" class="tsd-anchor"></a>
@@ -242,278 +242,232 @@ tree.</p>
242
242
  <ul class="tsd-signatures">
243
243
  <li class="tsd-signature tsd-anchor-link" id="BFS.BFS-1"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
244
244
  <li class="tsd-description">
245
- <div class="tsd-comment tsd-typography"><p>The BFS function performs a breadth-first search on a binary tree, accumulating properties of each node based on a
246
- specified property name.</p>
245
+ <div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating properties of each node based on their &#39;id&#39; property.</p>
247
246
  </div>
248
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the <code>AbstractBinaryTreeNodeProperties</code> class with generic type <code>N</code>.</p>
247
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
249
248
 
250
249
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
251
250
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#BFS">BFS</a></p>
252
251
  <ul>
253
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L888">src/data-structures/binary-tree/abstract-binary-tree.ts:888</a></li></ul></aside></li>
252
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L929">src/data-structures/binary-tree/abstract-binary-tree.ts:929</a></li></ul></aside></li>
254
253
  <li class="tsd-signature tsd-anchor-link" id="BFS.BFS-2"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
255
254
  <li class="tsd-description">
256
- <div class="tsd-comment tsd-typography"><p>The BFS function performs a breadth-first search on a binary tree, accumulating properties of each node based on a
257
- specified property name.</p>
255
+ <div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating properties of each node based on the specified property name.</p>
258
256
  </div>
259
257
  <div class="tsd-parameters">
260
258
  <h4 class="tsd-parameters-title">Parameters</h4>
261
259
  <ul class="tsd-parameter-list">
262
260
  <li>
263
261
  <h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
264
- <div class="tsd-comment tsd-typography"><p>The parameter <code>nodeOrPropertyName</code> is an optional parameter that
265
- represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
266
- performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
267
- the</p>
262
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
268
263
  </div>
269
264
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
270
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the <code>AbstractBinaryTreeNodeProperties</code> class with generic type <code>N</code>.</p>
265
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
271
266
 
272
267
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
273
268
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#BFS">BFS</a></p>
274
269
  <ul>
275
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L890">src/data-structures/binary-tree/abstract-binary-tree.ts:890</a></li></ul></aside></li>
270
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L936">src/data-structures/binary-tree/abstract-binary-tree.ts:936</a></li></ul></aside></li>
276
271
  <li class="tsd-signature tsd-anchor-link" id="BFS.BFS-3"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
277
272
  <li class="tsd-description">
278
- <div class="tsd-comment tsd-typography"><p>The BFS function performs a breadth-first search on a binary tree, accumulating properties of each node based on a
279
- specified property name.</p>
273
+ <div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating the &#39;val&#39; property of each node.</p>
280
274
  </div>
281
275
  <div class="tsd-parameters">
282
276
  <h4 class="tsd-parameters-title">Parameters</h4>
283
277
  <ul class="tsd-parameter-list">
284
278
  <li>
285
279
  <h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
286
- <div class="tsd-comment tsd-typography"><p>The parameter <code>nodeOrPropertyName</code> is an optional parameter that
287
- represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
288
- performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
289
- the</p>
280
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
290
281
  </div>
291
282
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
292
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the <code>AbstractBinaryTreeNodeProperties</code> class with generic type <code>N</code>.</p>
283
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of &#39;val&#39; properties from each node.</p>
293
284
 
294
285
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
295
286
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#BFS">BFS</a></p>
296
287
  <ul>
297
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L892">src/data-structures/binary-tree/abstract-binary-tree.ts:892</a></li></ul></aside></li>
288
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L943">src/data-structures/binary-tree/abstract-binary-tree.ts:943</a></li></ul></aside></li>
298
289
  <li class="tsd-signature tsd-anchor-link" id="BFS.BFS-4"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
299
290
  <li class="tsd-description">
300
- <div class="tsd-comment tsd-typography"><p>The BFS function performs a breadth-first search on a binary tree, accumulating properties of each node based on a
301
- specified property name.</p>
291
+ <div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating nodes themselves.</p>
302
292
  </div>
303
293
  <div class="tsd-parameters">
304
294
  <h4 class="tsd-parameters-title">Parameters</h4>
305
295
  <ul class="tsd-parameter-list">
306
296
  <li>
307
297
  <h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
308
- <div class="tsd-comment tsd-typography"><p>The parameter <code>nodeOrPropertyName</code> is an optional parameter that
309
- represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
310
- performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
311
- the</p>
298
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
312
299
  </div>
313
300
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
314
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the <code>AbstractBinaryTreeNodeProperties</code> class with generic type <code>N</code>.</p>
301
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
315
302
 
316
303
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
317
304
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#BFS">BFS</a></p>
318
305
  <ul>
319
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L894">src/data-structures/binary-tree/abstract-binary-tree.ts:894</a></li></ul></aside></li></ul></section>
306
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L950">src/data-structures/binary-tree/abstract-binary-tree.ts:950</a></li></ul></aside></li></ul></section>
320
307
  <section class="tsd-panel tsd-member"><a id="DFS" class="tsd-anchor"></a>
321
308
  <h3 class="tsd-anchor-link"><span>DFS</span><a href="#DFS" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
322
309
  <ul class="tsd-signatures">
323
310
  <li class="tsd-signature tsd-anchor-link" id="DFS.DFS-1"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
324
311
  <li class="tsd-description">
325
- <div class="tsd-comment tsd-typography"><p>The DFS function performs a depth-first search traversal on a binary tree and returns the accumulated properties of
326
- each node based on the specified pattern and property name.</p>
312
+ <div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on their &#39;id&#39; property.</p>
327
313
  </div>
328
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the AbstractBinaryTreeNodeProperties class, which contains the accumulated properties of the
329
- binary tree nodes based on the specified pattern and node or property name.</p>
314
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
330
315
 
331
316
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
332
317
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFS">DFS</a></p>
333
318
  <ul>
334
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L922">src/data-structures/binary-tree/abstract-binary-tree.ts:922</a></li></ul></aside></li>
319
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L980">src/data-structures/binary-tree/abstract-binary-tree.ts:980</a></li></ul></aside></li>
335
320
  <li class="tsd-signature tsd-anchor-link" id="DFS.DFS-2"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
336
321
  <li class="tsd-description">
337
- <div class="tsd-comment tsd-typography"><p>The DFS function performs a depth-first search traversal on a binary tree and returns the accumulated properties of
338
- each node based on the specified pattern and property name.</p>
322
+ <div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on the specified property name.</p>
339
323
  </div>
340
324
  <div class="tsd-parameters">
341
325
  <h4 class="tsd-parameters-title">Parameters</h4>
342
326
  <ul class="tsd-parameter-list">
343
327
  <li>
344
328
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
345
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter is used to specify the traversal order of the
346
- binary tree. It can have three possible values:</p>
329
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
347
330
  </div>
348
331
  <div class="tsd-comment tsd-typography"></div></li>
349
332
  <li>
350
333
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
351
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is a string that represents
352
- the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
353
- depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>&#39;id&#39;</code>.</p>
334
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
354
335
  </div>
355
336
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
356
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the AbstractBinaryTreeNodeProperties class, which contains the accumulated properties of the
357
- binary tree nodes based on the specified pattern and node or property name.</p>
337
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
358
338
 
359
339
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
360
340
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFS">DFS</a></p>
361
341
  <ul>
362
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L924">src/data-structures/binary-tree/abstract-binary-tree.ts:924</a></li></ul></aside></li>
342
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L988">src/data-structures/binary-tree/abstract-binary-tree.ts:988</a></li></ul></aside></li>
363
343
  <li class="tsd-signature tsd-anchor-link" id="DFS.DFS-3"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
364
344
  <li class="tsd-description">
365
- <div class="tsd-comment tsd-typography"><p>The DFS function performs a depth-first search traversal on a binary tree and returns the accumulated properties of
366
- each node based on the specified pattern and property name.</p>
345
+ <div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates the &#39;val&#39; property of each node.</p>
367
346
  </div>
368
347
  <div class="tsd-parameters">
369
348
  <h4 class="tsd-parameters-title">Parameters</h4>
370
349
  <ul class="tsd-parameter-list">
371
350
  <li>
372
351
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
373
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter is used to specify the traversal order of the
374
- binary tree. It can have three possible values:</p>
352
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
375
353
  </div>
376
354
  <div class="tsd-comment tsd-typography"></div></li>
377
355
  <li>
378
356
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
379
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is a string that represents
380
- the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
381
- depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>&#39;id&#39;</code>.</p>
357
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
382
358
  </div>
383
359
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
384
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the AbstractBinaryTreeNodeProperties class, which contains the accumulated properties of the
385
- binary tree nodes based on the specified pattern and node or property name.</p>
360
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of &#39;val&#39; properties from each node.</p>
386
361
 
387
362
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
388
363
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFS">DFS</a></p>
389
364
  <ul>
390
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L926">src/data-structures/binary-tree/abstract-binary-tree.ts:926</a></li></ul></aside></li>
365
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L996">src/data-structures/binary-tree/abstract-binary-tree.ts:996</a></li></ul></aside></li>
391
366
  <li class="tsd-signature tsd-anchor-link" id="DFS.DFS-4"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
392
367
  <li class="tsd-description">
393
- <div class="tsd-comment tsd-typography"><p>The DFS function performs a depth-first search traversal on a binary tree and returns the accumulated properties of
394
- each node based on the specified pattern and property name.</p>
368
+ <div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
395
369
  </div>
396
370
  <div class="tsd-parameters">
397
371
  <h4 class="tsd-parameters-title">Parameters</h4>
398
372
  <ul class="tsd-parameter-list">
399
373
  <li>
400
374
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
401
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter is used to specify the traversal order of the
402
- binary tree. It can have three possible values:</p>
375
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
403
376
  </div>
404
377
  <div class="tsd-comment tsd-typography"></div></li>
405
378
  <li>
406
379
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
407
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is a string that represents
408
- the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
409
- depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>&#39;id&#39;</code>.</p>
380
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
410
381
  </div>
411
382
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
412
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an instance of the AbstractBinaryTreeNodeProperties class, which contains the accumulated properties of the
413
- binary tree nodes based on the specified pattern and node or property name.</p>
383
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
414
384
 
415
385
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
416
386
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFS">DFS</a></p>
417
387
  <ul>
418
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L928">src/data-structures/binary-tree/abstract-binary-tree.ts:928</a></li></ul></aside></li></ul></section>
388
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1004">src/data-structures/binary-tree/abstract-binary-tree.ts:1004</a></li></ul></aside></li></ul></section>
419
389
  <section class="tsd-panel tsd-member"><a id="DFSIterative" class="tsd-anchor"></a>
420
390
  <h3 class="tsd-anchor-link"><span>DFSIterative</span><a href="#DFSIterative" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
421
391
  <ul class="tsd-signatures">
422
392
  <li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-1"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
423
393
  <li class="tsd-description">
424
- <div class="tsd-comment tsd-typography"><p>The DFSIterative function performs an iterative depth-first search traversal on a binary tree, with the option to
425
- specify the traversal pattern and the property name to accumulate results by.</p>
394
+ <div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on their &#39;id&#39; property.</p>
426
395
  </div>
427
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an object of type AbstractBinaryTreeNodeProperties<N>.</p>
396
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
428
397
 
429
398
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
430
399
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFSIterative">DFSIterative</a></p>
431
400
  <ul>
432
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L969">src/data-structures/binary-tree/abstract-binary-tree.ts:969</a></li></ul></aside></li>
401
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1047">src/data-structures/binary-tree/abstract-binary-tree.ts:1047</a></li></ul></aside></li>
433
402
  <li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-2"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
434
403
  <li class="tsd-description">
435
- <div class="tsd-comment tsd-typography"><p>The DFSIterative function performs an iterative depth-first search traversal on a binary tree, with the option to
436
- specify the traversal pattern and the property name to accumulate results by.</p>
404
+ <div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on the specified property name.</p>
437
405
  </div>
438
406
  <div class="tsd-parameters">
439
407
  <h4 class="tsd-parameters-title">Parameters</h4>
440
408
  <ul class="tsd-parameter-list">
441
409
  <li>
442
410
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
443
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter determines the order in which the nodes of the
444
- binary tree are visited during the depth-first search. It can have one of the following values:</p>
411
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
445
412
  </div>
446
413
  <div class="tsd-comment tsd-typography"></div></li>
447
414
  <li>
448
415
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
449
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is used to specify the
450
- property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
451
- default, it is set to <code>&#39;id&#39;</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
452
- the</p>
416
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
453
417
  </div>
454
418
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
455
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an object of type AbstractBinaryTreeNodeProperties<N>.</p>
419
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
456
420
 
457
421
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
458
422
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFSIterative">DFSIterative</a></p>
459
423
  <ul>
460
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L973">src/data-structures/binary-tree/abstract-binary-tree.ts:973</a></li></ul></aside></li>
424
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1055">src/data-structures/binary-tree/abstract-binary-tree.ts:1055</a></li></ul></aside></li>
461
425
  <li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-3"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
462
426
  <li class="tsd-description">
463
- <div class="tsd-comment tsd-typography"><p>The DFSIterative function performs an iterative depth-first search traversal on a binary tree, with the option to
464
- specify the traversal pattern and the property name to accumulate results by.</p>
427
+ <div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates the &#39;val&#39; property of each node.</p>
465
428
  </div>
466
429
  <div class="tsd-parameters">
467
430
  <h4 class="tsd-parameters-title">Parameters</h4>
468
431
  <ul class="tsd-parameter-list">
469
432
  <li>
470
433
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
471
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter determines the order in which the nodes of the
472
- binary tree are visited during the depth-first search. It can have one of the following values:</p>
434
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
473
435
  </div>
474
436
  <div class="tsd-comment tsd-typography"></div></li>
475
437
  <li>
476
438
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
477
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is used to specify the
478
- property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
479
- default, it is set to <code>&#39;id&#39;</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
480
- the</p>
439
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
481
440
  </div>
482
441
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
483
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an object of type AbstractBinaryTreeNodeProperties<N>.</p>
442
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of &#39;val&#39; properties from each node.</p>
484
443
 
485
444
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
486
445
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFSIterative">DFSIterative</a></p>
487
446
  <ul>
488
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L975">src/data-structures/binary-tree/abstract-binary-tree.ts:975</a></li></ul></aside></li>
447
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1063">src/data-structures/binary-tree/abstract-binary-tree.ts:1063</a></li></ul></aside></li>
489
448
  <li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-4"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
490
449
  <li class="tsd-description">
491
- <div class="tsd-comment tsd-typography"><p>The DFSIterative function performs an iterative depth-first search traversal on a binary tree, with the option to
492
- specify the traversal pattern and the property name to accumulate results by.</p>
450
+ <div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
493
451
  </div>
494
452
  <div class="tsd-parameters">
495
453
  <h4 class="tsd-parameters-title">Parameters</h4>
496
454
  <ul class="tsd-parameter-list">
497
455
  <li>
498
456
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
499
- <div class="tsd-comment tsd-typography"><p>The &quot;pattern&quot; parameter determines the order in which the nodes of the
500
- binary tree are visited during the depth-first search. It can have one of the following values:</p>
457
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
501
458
  </div>
502
459
  <div class="tsd-comment tsd-typography"></div></li>
503
460
  <li>
504
461
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
505
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is used to specify the
506
- property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
507
- default, it is set to <code>&#39;id&#39;</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
508
- the</p>
462
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
509
463
  </div>
510
464
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
511
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an object of type AbstractBinaryTreeNodeProperties<N>.</p>
465
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
512
466
 
513
467
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
514
468
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#DFSIterative">DFSIterative</a></p>
515
469
  <ul>
516
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L977">src/data-structures/binary-tree/abstract-binary-tree.ts:977</a></li></ul></aside></li></ul></section>
470
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1071">src/data-structures/binary-tree/abstract-binary-tree.ts:1071</a></li></ul></aside></li></ul></section>
517
471
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_accumulatedByPropertyName" class="tsd-anchor"></a>
518
472
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_accumulated<wbr/>By<wbr/>Property<wbr/>Name</span><a href="#_accumulatedByPropertyName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
519
473
  <ul class="tsd-signatures tsd-is-protected">
@@ -539,7 +493,7 @@ specifies the property name to be used for accumulating values. If it is a <code
539
493
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
540
494
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
541
495
  <ul>
542
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1433">src/data-structures/binary-tree/abstract-binary-tree.ts:1433</a></li></ul></aside></li></ul></section>
496
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1584">src/data-structures/binary-tree/abstract-binary-tree.ts:1584</a></li></ul></aside></li></ul></section>
543
497
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_addTo" class="tsd-anchor"></a>
544
498
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_add<wbr/>To</span><a href="#_addTo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
545
499
  <ul class="tsd-signatures tsd-is-protected">
@@ -568,7 +522,7 @@ undefined.</p>
568
522
 
569
523
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
570
524
  <ul>
571
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1287">src/data-structures/binary-tree/abstract-binary-tree.ts:1287</a></li></ul></aside></li></ul></section>
525
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1438">src/data-structures/binary-tree/abstract-binary-tree.ts:1438</a></li></ul></aside></li></ul></section>
572
526
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_clearResults" class="tsd-anchor"></a>
573
527
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_clear<wbr/>Results</span><a href="#_clearResults" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
574
528
  <ul class="tsd-signatures tsd-is-protected">
@@ -580,7 +534,7 @@ properties.</p>
580
534
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
581
535
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
582
536
  <ul>
583
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1375">src/data-structures/binary-tree/abstract-binary-tree.ts:1375</a></li></ul></aside></li></ul></section>
537
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1526">src/data-structures/binary-tree/abstract-binary-tree.ts:1526</a></li></ul></aside></li></ul></section>
584
538
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_getResultByPropertyName" class="tsd-anchor"></a>
585
539
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_get<wbr/>Result<wbr/>By<wbr/>Property<wbr/>Name</span><a href="#_getResultByPropertyName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
586
540
  <ul class="tsd-signatures tsd-is-protected">
@@ -602,7 +556,7 @@ can accept either a <code>NodeOrPropertyName</code> type or be undefined.</p>
602
556
 
603
557
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
604
558
  <ul>
605
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1464">src/data-structures/binary-tree/abstract-binary-tree.ts:1464</a></li></ul></aside></li></ul></section>
559
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1615">src/data-structures/binary-tree/abstract-binary-tree.ts:1615</a></li></ul></aside></li></ul></section>
606
560
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_pushByPropertyNameStopOrNot" class="tsd-anchor"></a>
607
561
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_push<wbr/>By<wbr/>Property<wbr/>Name<wbr/>Stop<wbr/>Or<wbr/>Not</span><a href="#_pushByPropertyNameStopOrNot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
608
562
  <ul class="tsd-signatures tsd-is-protected">
@@ -648,7 +602,7 @@ stop after finding the first matching node or continue searching for all matchin
648
602
 
649
603
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
650
604
  <ul>
651
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1397">src/data-structures/binary-tree/abstract-binary-tree.ts:1397</a></li></ul></aside></li></ul></section>
605
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1548">src/data-structures/binary-tree/abstract-binary-tree.ts:1548</a></li></ul></aside></li></ul></section>
652
606
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setLoopType" class="tsd-anchor"></a>
653
607
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Loop<wbr/>Type</span><a href="#_setLoopType" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
654
608
  <ul class="tsd-signatures tsd-is-protected">
@@ -667,7 +621,7 @@ stop after finding the first matching node or continue searching for all matchin
667
621
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
668
622
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
669
623
  <ul>
670
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1315">src/data-structures/binary-tree/abstract-binary-tree.ts:1315</a></li></ul></aside></li></ul></section>
624
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1466">src/data-structures/binary-tree/abstract-binary-tree.ts:1466</a></li></ul></aside></li></ul></section>
671
625
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setRoot" class="tsd-anchor"></a>
672
626
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Root</span><a href="#_setRoot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
673
627
  <ul class="tsd-signatures tsd-is-protected">
@@ -687,7 +641,7 @@ parent property of the value to undefined.</p>
687
641
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
688
642
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
689
643
  <ul>
690
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1356">src/data-structures/binary-tree/abstract-binary-tree.ts:1356</a></li></ul></aside></li></ul></section>
644
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1507">src/data-structures/binary-tree/abstract-binary-tree.ts:1507</a></li></ul></aside></li></ul></section>
691
645
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setSize" class="tsd-anchor"></a>
692
646
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Size</span><a href="#_setSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
693
647
  <ul class="tsd-signatures tsd-is-protected">
@@ -706,7 +660,7 @@ parent property of the value to undefined.</p>
706
660
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
707
661
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
708
662
  <ul>
709
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1367">src/data-structures/binary-tree/abstract-binary-tree.ts:1367</a></li></ul></aside></li></ul></section>
663
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1518">src/data-structures/binary-tree/abstract-binary-tree.ts:1518</a></li></ul></aside></li></ul></section>
710
664
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setVisitedId" class="tsd-anchor"></a>
711
665
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Id</span><a href="#_setVisitedId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
712
666
  <ul class="tsd-signatures tsd-is-protected">
@@ -725,7 +679,7 @@ parent property of the value to undefined.</p>
725
679
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
726
680
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
727
681
  <ul>
728
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1323">src/data-structures/binary-tree/abstract-binary-tree.ts:1323</a></li></ul></aside></li></ul></section>
682
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1474">src/data-structures/binary-tree/abstract-binary-tree.ts:1474</a></li></ul></aside></li></ul></section>
729
683
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setVisitedLeftSum" class="tsd-anchor"></a>
730
684
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Left<wbr/>Sum</span><a href="#_setVisitedLeftSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
731
685
  <ul class="tsd-signatures tsd-is-protected">
@@ -744,7 +698,7 @@ parent property of the value to undefined.</p>
744
698
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
745
699
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
746
700
  <ul>
747
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1347">src/data-structures/binary-tree/abstract-binary-tree.ts:1347</a></li></ul></aside></li></ul></section>
701
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1498">src/data-structures/binary-tree/abstract-binary-tree.ts:1498</a></li></ul></aside></li></ul></section>
748
702
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setVisitedNode" class="tsd-anchor"></a>
749
703
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Node</span><a href="#_setVisitedNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
750
704
  <ul class="tsd-signatures tsd-is-protected">
@@ -763,7 +717,7 @@ parent property of the value to undefined.</p>
763
717
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
764
718
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
765
719
  <ul>
766
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1339">src/data-structures/binary-tree/abstract-binary-tree.ts:1339</a></li></ul></aside></li></ul></section>
720
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1490">src/data-structures/binary-tree/abstract-binary-tree.ts:1490</a></li></ul></aside></li></ul></section>
767
721
  <section class="tsd-panel tsd-member tsd-is-protected"><a id="_setVisitedVal" class="tsd-anchor"></a>
768
722
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Val</span><a href="#_setVisitedVal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
769
723
  <ul class="tsd-signatures tsd-is-protected">
@@ -782,7 +736,7 @@ parent property of the value to undefined.</p>
782
736
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
783
737
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
784
738
  <ul>
785
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1331">src/data-structures/binary-tree/abstract-binary-tree.ts:1331</a></li></ul></aside></li></ul></section>
739
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1482">src/data-structures/binary-tree/abstract-binary-tree.ts:1482</a></li></ul></aside></li></ul></section>
786
740
  <section class="tsd-panel tsd-member"><a id="add" class="tsd-anchor"></a>
787
741
  <h3 class="tsd-anchor-link"><span>add</span><a href="#add" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
788
742
  <ul class="tsd-signatures">
@@ -811,7 +765,7 @@ being added to the binary tree.</p>
811
765
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
812
766
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#add">add</a></p>
813
767
  <ul>
814
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L255">src/data-structures/binary-tree/abstract-binary-tree.ts:255</a></li></ul></aside></li></ul></section>
768
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L255">src/data-structures/binary-tree/abstract-binary-tree.ts:255</a></li></ul></aside></li></ul></section>
815
769
  <section class="tsd-panel tsd-member"><a id="addMany" class="tsd-anchor"></a>
816
770
  <h3 class="tsd-anchor-link"><span>add<wbr/>Many</span><a href="#addMany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
817
771
  <ul class="tsd-signatures">
@@ -841,7 +795,7 @@ the value of the nodes will be <code>undefined</code>.</p>
841
795
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
842
796
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#addMany">addMany</a></p>
843
797
  <ul>
844
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L314">src/data-structures/binary-tree/abstract-binary-tree.ts:314</a></li></ul></aside></li></ul></section>
798
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L314">src/data-structures/binary-tree/abstract-binary-tree.ts:314</a></li></ul></aside></li></ul></section>
845
799
  <section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a>
846
800
  <h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
847
801
  <ul class="tsd-signatures">
@@ -853,7 +807,7 @@ the value of the nodes will be <code>undefined</code>.</p>
853
807
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
854
808
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#clear">clear</a></p>
855
809
  <ul>
856
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L227">src/data-structures/binary-tree/abstract-binary-tree.ts:227</a></li></ul></aside></li></ul></section>
810
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L227">src/data-structures/binary-tree/abstract-binary-tree.ts:227</a></li></ul></aside></li></ul></section>
857
811
  <section class="tsd-panel tsd-member"><a id="createNode" class="tsd-anchor"></a>
858
812
  <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagAbstract">Abstract</code> <span>create<wbr/>Node</span><a href="#createNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
859
813
  <ul class="tsd-signatures">
@@ -869,7 +823,7 @@ the value of the nodes will be <code>undefined</code>.</p>
869
823
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><aside class="tsd-sources">
870
824
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#createNode">createNode</a></p>
871
825
  <ul>
872
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L196">src/data-structures/binary-tree/abstract-binary-tree.ts:196</a></li></ul></aside></li></ul></section>
826
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L196">src/data-structures/binary-tree/abstract-binary-tree.ts:196</a></li></ul></aside></li></ul></section>
873
827
  <section class="tsd-panel tsd-member"><a id="fill" class="tsd-anchor"></a>
874
828
  <h3 class="tsd-anchor-link"><span>fill</span><a href="#fill" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
875
829
  <ul class="tsd-signatures">
@@ -898,7 +852,7 @@ array. Each value in the <code>data</code> array will be assigned to the</p>
898
852
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
899
853
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#fill">fill</a></p>
900
854
  <ul>
901
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L345">src/data-structures/binary-tree/abstract-binary-tree.ts:345</a></li></ul></aside></li></ul></section>
855
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L345">src/data-structures/binary-tree/abstract-binary-tree.ts:345</a></li></ul></aside></li></ul></section>
902
856
  <section class="tsd-panel tsd-member"><a id="get" class="tsd-anchor"></a>
903
857
  <h3 class="tsd-anchor-link"><span>get</span><a href="#get" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
904
858
  <ul class="tsd-signatures">
@@ -929,7 +883,7 @@ If no matching node is found, it returns null.</p>
929
883
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
930
884
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#get">get</a></p>
931
885
  <ul>
932
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L599">src/data-structures/binary-tree/abstract-binary-tree.ts:599</a></li></ul></aside></li></ul></section>
886
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L599">src/data-structures/binary-tree/abstract-binary-tree.ts:599</a></li></ul></aside></li></ul></section>
933
887
  <section class="tsd-panel tsd-member"><a id="getDepth" class="tsd-anchor"></a>
934
888
  <h3 class="tsd-anchor-link"><span>get<wbr/>Depth</span><a href="#getDepth" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
935
889
  <ul class="tsd-signatures">
@@ -950,7 +904,7 @@ If no matching node is found, it returns null.</p>
950
904
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
951
905
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getDepth">getDepth</a></p>
952
906
  <ul>
953
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L412">src/data-structures/binary-tree/abstract-binary-tree.ts:412</a></li></ul></aside></li></ul></section>
907
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L412">src/data-structures/binary-tree/abstract-binary-tree.ts:412</a></li></ul></aside></li></ul></section>
954
908
  <section class="tsd-panel tsd-member"><a id="getHeight" class="tsd-anchor"></a>
955
909
  <h3 class="tsd-anchor-link"><span>get<wbr/>Height</span><a href="#getHeight" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
956
910
  <ul class="tsd-signatures">
@@ -973,41 +927,50 @@ node), or <code>null</code>.</p>
973
927
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
974
928
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getHeight">getHeight</a></p>
975
929
  <ul>
976
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L430">src/data-structures/binary-tree/abstract-binary-tree.ts:430</a></li></ul></aside></li></ul></section>
930
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L430">src/data-structures/binary-tree/abstract-binary-tree.ts:430</a></li></ul></aside></li></ul></section>
977
931
  <section class="tsd-panel tsd-member"><a id="getLeftMost" class="tsd-anchor"></a>
978
932
  <h3 class="tsd-anchor-link"><span>get<wbr/>Left<wbr/>Most</span><a href="#getLeftMost" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
979
933
  <ul class="tsd-signatures">
980
934
  <li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-1"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
981
935
  <li class="tsd-description">
982
- <div class="tsd-comment tsd-typography"><p>The <code>getLeftMost</code> function returns the leftmost node in a binary tree, starting from a specified node or the root if
983
- no node is specified.</p>
936
+ <div class="tsd-comment tsd-typography"><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree, starting from a specified node or the root if
937
+ no node is specified.
938
+ generic type representing a node in a binary tree), <code>BinaryTreeNodeId</code> (a type representing the ID of a binary tree
939
+ node), or <code>null</code>.</p>
984
940
  </div>
985
941
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree. If the <code>beginRoot</code> parameter is
986
- provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the
987
- traversal from the root of the binary tree. If there are no nodes in the binary tree, it returns <code>null</code>.</p>
942
+ provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the traversal
943
+ from the root of the binary tree. The function returns the leftmost node found during the traversal. If no leftmost
944
+ node is found (</p>
988
945
 
989
946
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
990
947
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getLeftMost">getLeftMost</a></p>
991
948
  <ul>
992
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L628">src/data-structures/binary-tree/abstract-binary-tree.ts:628</a></li></ul></aside></li>
993
- <li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-2"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
949
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L638">src/data-structures/binary-tree/abstract-binary-tree.ts:638</a></li></ul></aside></li>
950
+ <li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-2"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
994
951
  <li class="tsd-description">
995
- <div class="tsd-comment tsd-typography"><p>The <code>getLeftMost</code> function returns the leftmost node in a binary tree, starting from a specified node or the root if
952
+ <div class="tsd-comment tsd-typography"><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree, starting from a specified node or the root if
996
953
  no node is specified.</p>
997
954
  </div>
998
955
  <div class="tsd-parameters">
999
956
  <h4 class="tsd-parameters-title">Parameters</h4>
1000
957
  <ul class="tsd-parameter-list">
1001
958
  <li>
1002
- <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5></li></ul></div>
959
+ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
960
+ <div class="tsd-comment tsd-typography"><p>The <code>beginRoot</code> parameter is optional and can be of type <code>N</code> (a
961
+ generic type representing a node in a binary tree), <code>BinaryTreeNodeId</code> (a type representing the ID of a binary tree
962
+ node).</p>
963
+ </div>
964
+ <div class="tsd-comment tsd-typography"></div></li></ul></div>
1003
965
  <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree. If the <code>beginRoot</code> parameter is
1004
- provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the
1005
- traversal from the root of the binary tree. If there are no nodes in the binary tree, it returns <code>null</code>.</p>
966
+ provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the traversal
967
+ from the root of the binary tree. The function returns the leftmost node found during the traversal. If no leftmost
968
+ node is found (</p>
1006
969
 
1007
970
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1008
971
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getLeftMost">getLeftMost</a></p>
1009
972
  <ul>
1010
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L630">src/data-structures/binary-tree/abstract-binary-tree.ts:630</a></li></ul></aside></li></ul></section>
973
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L651">src/data-structures/binary-tree/abstract-binary-tree.ts:651</a></li></ul></aside></li></ul></section>
1011
974
  <section class="tsd-panel tsd-member"><a id="getMinHeight" class="tsd-anchor"></a>
1012
975
  <h3 class="tsd-anchor-link"><span>get<wbr/>Min<wbr/>Height</span><a href="#getMinHeight" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1013
976
  <ul class="tsd-signatures">
@@ -1031,7 +994,7 @@ for <code>beginRoot</code>, the <code>this.root</code> property is used as the d
1031
994
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1032
995
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getMinHeight">getMinHeight</a></p>
1033
996
  <ul>
1034
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L479">src/data-structures/binary-tree/abstract-binary-tree.ts:479</a></li></ul></aside></li></ul></section>
997
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L479">src/data-structures/binary-tree/abstract-binary-tree.ts:479</a></li></ul></aside></li></ul></section>
1035
998
  <section class="tsd-panel tsd-member"><a id="getNodes" class="tsd-anchor"></a>
1036
999
  <h3 class="tsd-anchor-link"><span>get<wbr/>Nodes</span><a href="#getNodes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1037
1000
  <ul class="tsd-signatures">
@@ -1066,7 +1029,7 @@ function will stop traversing the tree and return the first matching node. If `o
1066
1029
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1067
1030
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getNodes">getNodes</a></p>
1068
1031
  <ul>
1069
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L544">src/data-structures/binary-tree/abstract-binary-tree.ts:544</a></li></ul></aside></li></ul></section>
1032
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L544">src/data-structures/binary-tree/abstract-binary-tree.ts:544</a></li></ul></aside></li></ul></section>
1070
1033
  <section class="tsd-panel tsd-member"><a id="getPathToRoot" class="tsd-anchor"></a>
1071
1034
  <h3 class="tsd-anchor-link"><span>get<wbr/>Path<wbr/>To<wbr/>Root</span><a href="#getPathToRoot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1072
1035
  <ul class="tsd-signatures">
@@ -1096,7 +1059,7 @@ path should be reversed or not. If <code>isReverse</code> is set to <code>true</
1096
1059
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1097
1060
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getPathToRoot">getPathToRoot</a></p>
1098
1061
  <ul>
1099
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L615">src/data-structures/binary-tree/abstract-binary-tree.ts:615</a></li></ul></aside></li></ul></section>
1062
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L615">src/data-structures/binary-tree/abstract-binary-tree.ts:615</a></li></ul></aside></li></ul></section>
1100
1063
  <section class="tsd-panel tsd-member"><a id="getPredecessor" class="tsd-anchor"></a>
1101
1064
  <h3 class="tsd-anchor-link"><span>get<wbr/>Predecessor</span><a href="#getPredecessor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1102
1065
  <ul class="tsd-signatures">
@@ -1117,46 +1080,44 @@ path should be reversed or not. If <code>isReverse</code> is set to <code>true</
1117
1080
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1118
1081
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getPredecessor">getPredecessor</a></p>
1119
1082
  <ul>
1120
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1151">src/data-structures/binary-tree/abstract-binary-tree.ts:1151</a></li></ul></aside></li></ul></section>
1083
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1284">src/data-structures/binary-tree/abstract-binary-tree.ts:1284</a></li></ul></aside></li></ul></section>
1121
1084
  <section class="tsd-panel tsd-member"><a id="getRightMost" class="tsd-anchor"></a>
1122
1085
  <h3 class="tsd-anchor-link"><span>get<wbr/>Right<wbr/>Most</span><a href="#getRightMost" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1123
1086
  <ul class="tsd-signatures">
1124
1087
  <li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-1"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1125
1088
  <li class="tsd-description">
1126
- <div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using
1127
- tail recursion optimization.</p>
1089
+ <div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using tail
1090
+ recursion optimization.</p>
1128
1091
  </div>
1129
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getRightMost</code> returns the rightmost node (<code>N</code>) in a binary tree. If the <code>node</code> parameter is
1130
- not provided, it defaults to the root node of the tree. If the tree is empty or the <code>node</code> parameter is <code>null</code>, the
1131
- function returns <code>null</code>.</p>
1092
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree. It returns the
1093
+ rightmost node starting from the root of the binary tree.</p>
1132
1094
 
1133
1095
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1134
1096
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getRightMost">getRightMost</a></p>
1135
1097
  <ul>
1136
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L666">src/data-structures/binary-tree/abstract-binary-tree.ts:666</a></li></ul></aside></li>
1137
- <li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-2"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1098
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L694">src/data-structures/binary-tree/abstract-binary-tree.ts:694</a></li></ul></aside></li>
1099
+ <li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-2"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1138
1100
  <li class="tsd-description">
1139
- <div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using
1140
- tail recursion optimization.</p>
1101
+ <div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using tail
1102
+ recursion optimization.</p>
1141
1103
  </div>
1142
1104
  <div class="tsd-parameters">
1143
1105
  <h4 class="tsd-parameters-title">Parameters</h4>
1144
1106
  <ul class="tsd-parameter-list">
1145
1107
  <li>
1146
- <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1108
+ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1147
1109
  <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is an optional parameter of type <code>N</code> or <code>null</code>. It represents the
1148
- starting node from which we want to find the rightmost node. If no node is provided, the <code>node</code> parameter defaults
1149
- to <code>this.root</code>, which is the root node of the data structure</p>
1110
+ starting node from which we want to find the rightmost node. If no node is provided, the function will default to
1111
+ using the root node of the data structure.</p>
1150
1112
  </div>
1151
1113
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1152
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getRightMost</code> returns the rightmost node (<code>N</code>) in a binary tree. If the <code>node</code> parameter is
1153
- not provided, it defaults to the root node of the tree. If the tree is empty or the <code>node</code> parameter is <code>null</code>, the
1154
- function returns <code>null</code>.</p>
1114
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree. It returns the rightmost node
1115
+ starting from that node.</p>
1155
1116
 
1156
1117
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1157
1118
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getRightMost">getRightMost</a></p>
1158
1119
  <ul>
1159
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L668">src/data-structures/binary-tree/abstract-binary-tree.ts:668</a></li></ul></aside></li></ul></section>
1120
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L705">src/data-structures/binary-tree/abstract-binary-tree.ts:705</a></li></ul></aside></li></ul></section>
1160
1121
  <section class="tsd-panel tsd-member"><a id="getSubTreeSize" class="tsd-anchor"></a>
1161
1122
  <h3 class="tsd-anchor-link"><span>get<wbr/>Sub<wbr/>Tree<wbr/>Size</span><a href="#getSubTreeSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1162
1123
  <ul class="tsd-signatures">
@@ -1178,7 +1139,7 @@ binary tree.</p>
1178
1139
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1179
1140
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#getSubTreeSize">getSubTreeSize</a></p>
1180
1141
  <ul>
1181
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L752">src/data-structures/binary-tree/abstract-binary-tree.ts:752</a></li></ul></aside></li></ul></section>
1142
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L789">src/data-structures/binary-tree/abstract-binary-tree.ts:789</a></li></ul></aside></li></ul></section>
1182
1143
  <section class="tsd-panel tsd-member"><a id="has" class="tsd-anchor"></a>
1183
1144
  <h3 class="tsd-anchor-link"><span>has</span><a href="#has" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1184
1145
  <ul class="tsd-signatures">
@@ -1206,7 +1167,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
1206
1167
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1207
1168
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#has">has</a></p>
1208
1169
  <ul>
1209
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L582">src/data-structures/binary-tree/abstract-binary-tree.ts:582</a></li></ul></aside></li></ul></section>
1170
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L582">src/data-structures/binary-tree/abstract-binary-tree.ts:582</a></li></ul></aside></li></ul></section>
1210
1171
  <section class="tsd-panel tsd-member"><a id="isBST" class="tsd-anchor"></a>
1211
1172
  <h3 class="tsd-anchor-link"><span>isBST</span><a href="#isBST" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1212
1173
  <ul class="tsd-signatures">
@@ -1219,7 +1180,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
1219
1180
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1220
1181
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#isBST">isBST</a></p>
1221
1182
  <ul>
1222
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L742">src/data-structures/binary-tree/abstract-binary-tree.ts:742</a></li></ul></aside></li></ul></section>
1183
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L779">src/data-structures/binary-tree/abstract-binary-tree.ts:779</a></li></ul></aside></li></ul></section>
1223
1184
  <section class="tsd-panel tsd-member"><a id="isEmpty" class="tsd-anchor"></a>
1224
1185
  <h3 class="tsd-anchor-link"><span>is<wbr/>Empty</span><a href="#isEmpty" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1225
1186
  <ul class="tsd-signatures">
@@ -1232,7 +1193,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
1232
1193
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1233
1194
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#isEmpty">isEmpty</a></p>
1234
1195
  <ul>
1235
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L237">src/data-structures/binary-tree/abstract-binary-tree.ts:237</a></li></ul></aside></li></ul></section>
1196
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L237">src/data-structures/binary-tree/abstract-binary-tree.ts:237</a></li></ul></aside></li></ul></section>
1236
1197
  <section class="tsd-panel tsd-member"><a id="isPerfectlyBalanced" class="tsd-anchor"></a>
1237
1198
  <h3 class="tsd-anchor-link"><span>is<wbr/>Perfectly<wbr/>Balanced</span><a href="#isPerfectlyBalanced" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1238
1199
  <ul class="tsd-signatures">
@@ -1255,7 +1216,7 @@ tree or null if the tree is empty.</p>
1255
1216
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1256
1217
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#isPerfectlyBalanced">isPerfectlyBalanced</a></p>
1257
1218
  <ul>
1258
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L529">src/data-structures/binary-tree/abstract-binary-tree.ts:529</a></li></ul></aside></li></ul></section>
1219
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L529">src/data-structures/binary-tree/abstract-binary-tree.ts:529</a></li></ul></aside></li></ul></section>
1259
1220
  <section class="tsd-panel tsd-member"><a id="isSubtreeBST" class="tsd-anchor"></a>
1260
1221
  <h3 class="tsd-anchor-link"><span>is<wbr/>SubtreeBST</span><a href="#isSubtreeBST" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1261
1222
  <ul class="tsd-signatures">
@@ -1276,303 +1237,265 @@ tree or null if the tree is empty.</p>
1276
1237
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1277
1238
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#isSubtreeBST">isSubtreeBST</a></p>
1278
1239
  <ul>
1279
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L708">src/data-structures/binary-tree/abstract-binary-tree.ts:708</a></li></ul></aside></li></ul></section>
1240
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L745">src/data-structures/binary-tree/abstract-binary-tree.ts:745</a></li></ul></aside></li></ul></section>
1280
1241
  <section class="tsd-panel tsd-member"><a id="levelIterative" class="tsd-anchor"></a>
1281
1242
  <h3 class="tsd-anchor-link"><span>level<wbr/>Iterative</span><a href="#levelIterative" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1282
1243
  <ul class="tsd-signatures">
1283
1244
  <li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-1"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1284
1245
  <li class="tsd-description">
1285
- <div class="tsd-comment tsd-typography"><p>The <code>levelIterative</code> function performs a level-order traversal on a binary tree and returns the values of the nodes
1286
- in an array, based on a specified property name.</p>
1246
+ <div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates properties of each node based on their &#39;id&#39; property.</p>
1287
1247
  </div>
1288
1248
  <div class="tsd-parameters">
1289
1249
  <h4 class="tsd-parameters-title">Parameters</h4>
1290
1250
  <ul class="tsd-parameter-list">
1291
1251
  <li>
1292
1252
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1293
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object representing the starting
1294
- node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
1295
- the tree is used as the starting node.</p>
1253
+ <div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
1296
1254
  </div>
1297
1255
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1298
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>levelIterative</code> returns an object of type <code>AbstractBinaryTreeNodeProperties&lt;N&gt;</code>.</p>
1256
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
1299
1257
 
1300
1258
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1301
1259
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#levelIterative">levelIterative</a></p>
1302
1260
  <ul>
1303
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1035">src/data-structures/binary-tree/abstract-binary-tree.ts:1035</a></li></ul></aside></li>
1261
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1130">src/data-structures/binary-tree/abstract-binary-tree.ts:1130</a></li></ul></aside></li>
1304
1262
  <li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-2"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1305
1263
  <li class="tsd-description">
1306
- <div class="tsd-comment tsd-typography"><p>The <code>levelIterative</code> function performs a level-order traversal on a binary tree and returns the values of the nodes
1307
- in an array, based on a specified property name.</p>
1264
+ <div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates properties of each node based on the specified property name.</p>
1308
1265
  </div>
1309
1266
  <div class="tsd-parameters">
1310
1267
  <h4 class="tsd-parameters-title">Parameters</h4>
1311
1268
  <ul class="tsd-parameter-list">
1312
1269
  <li>
1313
1270
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1314
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object representing the starting
1315
- node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
1316
- the tree is used as the starting node.</p>
1271
+ <div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
1317
1272
  </div>
1318
1273
  <div class="tsd-comment tsd-typography"></div></li>
1319
1274
  <li>
1320
1275
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
1321
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1322
- can be either a <code>BinaryTreeNode</code> property name or the string <code>&#39;id&#39;</code>. If a property name is provided, the function
1323
- will accumulate results based on that property. If no property name is provided, the function will default to
1324
- accumulating results</p>
1276
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
1325
1277
  </div>
1326
1278
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1327
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>levelIterative</code> returns an object of type <code>AbstractBinaryTreeNodeProperties&lt;N&gt;</code>.</p>
1279
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
1328
1280
 
1329
1281
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1330
1282
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#levelIterative">levelIterative</a></p>
1331
1283
  <ul>
1332
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1037">src/data-structures/binary-tree/abstract-binary-tree.ts:1037</a></li></ul></aside></li>
1284
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1138">src/data-structures/binary-tree/abstract-binary-tree.ts:1138</a></li></ul></aside></li>
1333
1285
  <li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-3"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1334
1286
  <li class="tsd-description">
1335
- <div class="tsd-comment tsd-typography"><p>The <code>levelIterative</code> function performs a level-order traversal on a binary tree and returns the values of the nodes
1336
- in an array, based on a specified property name.</p>
1287
+ <div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates the &#39;val&#39; property of each node.</p>
1337
1288
  </div>
1338
1289
  <div class="tsd-parameters">
1339
1290
  <h4 class="tsd-parameters-title">Parameters</h4>
1340
1291
  <ul class="tsd-parameter-list">
1341
1292
  <li>
1342
1293
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1343
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object representing the starting
1344
- node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
1345
- the tree is used as the starting node.</p>
1294
+ <div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
1346
1295
  </div>
1347
1296
  <div class="tsd-comment tsd-typography"></div></li>
1348
1297
  <li>
1349
1298
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
1350
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1351
- can be either a <code>BinaryTreeNode</code> property name or the string <code>&#39;id&#39;</code>. If a property name is provided, the function
1352
- will accumulate results based on that property. If no property name is provided, the function will default to
1353
- accumulating results</p>
1299
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
1354
1300
  </div>
1355
1301
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1356
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>levelIterative</code> returns an object of type <code>AbstractBinaryTreeNodeProperties&lt;N&gt;</code>.</p>
1302
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of &#39;val&#39; properties from each node.</p>
1357
1303
 
1358
1304
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1359
1305
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#levelIterative">levelIterative</a></p>
1360
1306
  <ul>
1361
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1039">src/data-structures/binary-tree/abstract-binary-tree.ts:1039</a></li></ul></aside></li>
1307
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1146">src/data-structures/binary-tree/abstract-binary-tree.ts:1146</a></li></ul></aside></li>
1362
1308
  <li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-4"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1363
1309
  <li class="tsd-description">
1364
- <div class="tsd-comment tsd-typography"><p>The <code>levelIterative</code> function performs a level-order traversal on a binary tree and returns the values of the nodes
1365
- in an array, based on a specified property name.</p>
1310
+ <div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates nodes themselves.</p>
1366
1311
  </div>
1367
1312
  <div class="tsd-parameters">
1368
1313
  <h4 class="tsd-parameters-title">Parameters</h4>
1369
1314
  <ul class="tsd-parameter-list">
1370
1315
  <li>
1371
1316
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1372
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object representing the starting
1373
- node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
1374
- the tree is used as the starting node.</p>
1317
+ <div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
1375
1318
  </div>
1376
1319
  <div class="tsd-comment tsd-typography"></div></li>
1377
1320
  <li>
1378
1321
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
1379
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1380
- can be either a <code>BinaryTreeNode</code> property name or the string <code>&#39;id&#39;</code>. If a property name is provided, the function
1381
- will accumulate results based on that property. If no property name is provided, the function will default to
1382
- accumulating results</p>
1322
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
1383
1323
  </div>
1384
1324
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1385
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>levelIterative</code> returns an object of type <code>AbstractBinaryTreeNodeProperties&lt;N&gt;</code>.</p>
1325
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
1386
1326
 
1387
1327
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1388
1328
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#levelIterative">levelIterative</a></p>
1389
1329
  <ul>
1390
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1041">src/data-structures/binary-tree/abstract-binary-tree.ts:1041</a></li></ul></aside></li></ul></section>
1330
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1154">src/data-structures/binary-tree/abstract-binary-tree.ts:1154</a></li></ul></aside></li></ul></section>
1391
1331
  <section class="tsd-panel tsd-member"><a id="listLevels" class="tsd-anchor"></a>
1392
1332
  <h3 class="tsd-anchor-link"><span>list<wbr/>Levels</span><a href="#listLevels" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1393
1333
  <ul class="tsd-signatures">
1394
1334
  <li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-1"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1395
1335
  <li class="tsd-description">
1396
- <div class="tsd-comment tsd-typography"><p>The <code>listLevels</code> function collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1336
+ <div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1397
1337
  </div>
1398
1338
  <div class="tsd-parameters">
1399
1339
  <h4 class="tsd-parameters-title">Parameters</h4>
1400
1340
  <ul class="tsd-parameter-list">
1401
1341
  <li>
1402
1342
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1403
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object or null. It represents the
1404
- root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
1343
+ <div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
1405
1344
  </div>
1406
1345
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1407
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>listLevels</code> returns a 2D array of <code>AbstractBinaryTreeNodeProperty&lt;N&gt;</code> objects.</p>
1346
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of AbstractBinaryTreeNodeProperty<N> objects.</p>
1408
1347
 
1409
1348
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1410
1349
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#listLevels">listLevels</a></p>
1411
1350
  <ul>
1412
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1079">src/data-structures/binary-tree/abstract-binary-tree.ts:1079</a></li></ul></aside></li>
1351
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1197">src/data-structures/binary-tree/abstract-binary-tree.ts:1197</a></li></ul></aside></li>
1413
1352
  <li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-2"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1414
1353
  <li class="tsd-description">
1415
- <div class="tsd-comment tsd-typography"><p>The <code>listLevels</code> function collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1354
+ <div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1416
1355
  </div>
1417
1356
  <div class="tsd-parameters">
1418
1357
  <h4 class="tsd-parameters-title">Parameters</h4>
1419
1358
  <ul class="tsd-parameter-list">
1420
1359
  <li>
1421
1360
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1422
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object or null. It represents the
1423
- root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
1361
+ <div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
1424
1362
  </div>
1425
1363
  <div class="tsd-comment tsd-typography"></div></li>
1426
1364
  <li>
1427
- <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
1428
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1429
- specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
1430
- values:</p>
1431
- </div>
1432
- <div class="tsd-comment tsd-typography"></div></li></ul></div>
1433
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>listLevels</code> returns a 2D array of <code>AbstractBinaryTreeNodeProperty&lt;N&gt;</code> objects.</p>
1434
-
1365
+ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5></li></ul></div>
1366
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4>
1435
1367
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1436
1368
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#listLevels">listLevels</a></p>
1437
1369
  <ul>
1438
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1081">src/data-structures/binary-tree/abstract-binary-tree.ts:1081</a></li></ul></aside></li>
1370
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1205">src/data-structures/binary-tree/abstract-binary-tree.ts:1205</a></li></ul></aside></li>
1439
1371
  <li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-3"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1440
1372
  <li class="tsd-description">
1441
- <div class="tsd-comment tsd-typography"><p>The <code>listLevels</code> function collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1373
+ <div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1442
1374
  </div>
1443
1375
  <div class="tsd-parameters">
1444
1376
  <h4 class="tsd-parameters-title">Parameters</h4>
1445
1377
  <ul class="tsd-parameter-list">
1446
1378
  <li>
1447
1379
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1448
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object or null. It represents the
1449
- root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
1380
+ <div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
1450
1381
  </div>
1451
1382
  <div class="tsd-comment tsd-typography"></div></li>
1452
1383
  <li>
1453
1384
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
1454
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1455
- specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
1456
- values:</p>
1385
+ <div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
1457
1386
  </div>
1458
1387
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1459
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>listLevels</code> returns a 2D array of <code>AbstractBinaryTreeNodeProperty&lt;N&gt;</code> objects.</p>
1388
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;val&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of &#39;val&#39; properties from each node.</p>
1460
1389
 
1461
1390
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1462
1391
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#listLevels">listLevels</a></p>
1463
1392
  <ul>
1464
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1083">src/data-structures/binary-tree/abstract-binary-tree.ts:1083</a></li></ul></aside></li>
1393
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1213">src/data-structures/binary-tree/abstract-binary-tree.ts:1213</a></li></ul></aside></li>
1465
1394
  <li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-4"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1466
1395
  <li class="tsd-description">
1467
- <div class="tsd-comment tsd-typography"><p>The <code>listLevels</code> function collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1396
+ <div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
1468
1397
  </div>
1469
1398
  <div class="tsd-parameters">
1470
1399
  <h4 class="tsd-parameters-title">Parameters</h4>
1471
1400
  <ul class="tsd-parameter-list">
1472
1401
  <li>
1473
1402
  <h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
1474
- <div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is a BinaryTreeNode object or null. It represents the
1475
- root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
1403
+ <div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
1476
1404
  </div>
1477
1405
  <div class="tsd-comment tsd-typography"></div></li>
1478
1406
  <li>
1479
1407
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
1480
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is an optional parameter that
1481
- specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
1482
- values:</p>
1408
+ <div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
1483
1409
  </div>
1484
1410
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1485
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>listLevels</code> returns a 2D array of <code>AbstractBinaryTreeNodeProperty&lt;N&gt;</code> objects.</p>
1411
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of binary tree nodes.</p>
1486
1412
 
1487
1413
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1488
1414
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#listLevels">listLevels</a></p>
1489
1415
  <ul>
1490
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1085">src/data-structures/binary-tree/abstract-binary-tree.ts:1085</a></li></ul></aside></li></ul></section>
1416
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1221">src/data-structures/binary-tree/abstract-binary-tree.ts:1221</a></li></ul></aside></li></ul></section>
1491
1417
  <section class="tsd-panel tsd-member"><a id="morris" class="tsd-anchor"></a>
1492
1418
  <h3 class="tsd-anchor-link"><span>morris</span><a href="#morris" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1493
1419
  <ul class="tsd-signatures">
1494
1420
  <li class="tsd-signature tsd-anchor-link" id="morris.morris-1"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1495
1421
  <li class="tsd-description">
1496
- <div class="tsd-comment tsd-typography"><p>The <code>morris</code> function performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris
1497
- traversal algorithm.</p>
1422
+ <div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm.</p>
1498
1423
  </div>
1499
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an array of AbstractBinaryTreeNodeProperties<N> objects.</p>
1424
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
1500
1425
 
1501
1426
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1502
1427
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#morris">morris</a></p>
1503
1428
  <ul>
1504
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1165">src/data-structures/binary-tree/abstract-binary-tree.ts:1165</a></li></ul></aside></li>
1429
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1307">src/data-structures/binary-tree/abstract-binary-tree.ts:1307</a></li></ul></aside></li>
1505
1430
  <li class="tsd-signature tsd-anchor-link" id="morris.morris-2"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1506
1431
  <li class="tsd-description">
1507
- <div class="tsd-comment tsd-typography"><p>The <code>morris</code> function performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris
1508
- traversal algorithm.</p>
1432
+ <div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates properties of each node based on the specified property name.</p>
1509
1433
  </div>
1510
1434
  <div class="tsd-parameters">
1511
1435
  <h4 class="tsd-parameters-title">Parameters</h4>
1512
1436
  <ul class="tsd-parameter-list">
1513
1437
  <li>
1514
1438
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
1515
- <div class="tsd-comment tsd-typography"><p>The <code>pattern</code> parameter determines the traversal pattern for the binary
1516
- tree. It can have one of three values:</p>
1439
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
1517
1440
  </div>
1518
1441
  <div class="tsd-comment tsd-typography"></div></li>
1519
1442
  <li>
1520
1443
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;id&quot;</span></h5>
1521
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is used to specify the
1522
- property name of the nodes that you want to retrieve. It can be any valid property name of the nodes in the binary
1523
- tree.</p>
1444
+ <div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
1524
1445
  </div>
1525
1446
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1526
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>an array of AbstractBinaryTreeNodeProperties<N> objects.</p>
1447
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
1527
1448
 
1528
1449
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1529
1450
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#morris">morris</a></p>
1530
1451
  <ul>
1531
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1167">src/data-structures/binary-tree/abstract-binary-tree.ts:1167</a></li></ul></aside></li>
1452
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1315">src/data-structures/binary-tree/abstract-binary-tree.ts:1315</a></li></ul></aside></li>
1532
1453
  <li class="tsd-signature tsd-anchor-link" id="morris.morris-3"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1533
1454
  <li class="tsd-description">
1534
- <div class="tsd-comment tsd-typography"><p>The <code>morris</code> function performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris
1535
- traversal algorithm.</p>
1455
+ <div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates the &#39;val&#39; property of each node.</p>
1536
1456
  </div>
1537
1457
  <div class="tsd-parameters">
1538
1458
  <h4 class="tsd-parameters-title">Parameters</h4>
1539
1459
  <ul class="tsd-parameter-list">
1540
1460
  <li>
1541
1461
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
1542
- <div class="tsd-comment tsd-typography"><p>The <code>pattern</code> parameter determines the traversal pattern for the binary
1543
- tree. It can have one of three values:</p>
1462
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
1544
1463
  </div>
1545
1464
  <div class="tsd-comment tsd-typography"></div></li>
1546
1465
  <li>
1547
1466
  <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;val&quot;</span></h5>
1548
- <div class="tsd-comment tsd-typography"><p>The <code>nodeOrPropertyName</code> parameter is used to specify the
1549
- property name of the nodes that you want to retrieve. It can be any valid property name of the nodes in the binary
1550
- tree.</p>
1467
+ <div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
1551
1468
  </div>
1552
1469
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
1553
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>an array of AbstractBinaryTreeNodeProperties<N> objects.</p>
1470
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of &#39;val&#39; properties from each node.</p>
1554
1471
 
1555
1472
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1556
1473
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#morris">morris</a></p>
1557
1474
  <ul>
1558
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1169">src/data-structures/binary-tree/abstract-binary-tree.ts:1169</a></li></ul></aside></li>
1475
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1323">src/data-structures/binary-tree/abstract-binary-tree.ts:1323</a></li></ul></aside></li>
1559
1476
  <li class="tsd-signature tsd-anchor-link" id="morris.morris-4"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
1560
1477
  <li class="tsd-description">
1561
- <div class="tsd-comment tsd-typography"><p>Time complexity is O(n)
1562
- Space complexity of Iterative DFS equals to recursive DFS which is O(n) because of the stack</p>
1478
+ <div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates nodes themselves.</p>
1563
1479
  </div>
1564
1480
  <div class="tsd-parameters">
1565
1481
  <h4 class="tsd-parameters-title">Parameters</h4>
1566
1482
  <ul class="tsd-parameter-list">
1567
1483
  <li>
1568
- <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5></li>
1484
+ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
1485
+ <div class="tsd-comment tsd-typography"><p>The traversal pattern: &#39;in&#39; (in-order), &#39;pre&#39; (pre-order), or &#39;post&#39; (post-order).</p>
1486
+ </div>
1487
+ <div class="tsd-comment tsd-typography"></div></li>
1569
1488
  <li>
1570
- <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5></li></ul></div>
1571
- <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4>
1489
+ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">&quot;node&quot;</span></h5>
1490
+ <div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
1491
+ </div>
1492
+ <div class="tsd-comment tsd-typography"></div></li></ul></div>
1493
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
1494
+
1572
1495
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1573
1496
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#morris">morris</a></p>
1574
1497
  <ul>
1575
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L1176">src/data-structures/binary-tree/abstract-binary-tree.ts:1176</a></li></ul></aside></li></ul></section>
1498
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L1331">src/data-structures/binary-tree/abstract-binary-tree.ts:1331</a></li></ul></aside></li></ul></section>
1576
1499
  <section class="tsd-panel tsd-member"><a id="remove" class="tsd-anchor"></a>
1577
1500
  <h3 class="tsd-anchor-link"><span>remove</span><a href="#remove" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1578
1501
  <ul class="tsd-signatures">
@@ -1602,7 +1525,7 @@ determines whether to update the left sum of all nodes in the binary tree after
1602
1525
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1603
1526
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#remove">remove</a></p>
1604
1527
  <ul>
1605
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L360">src/data-structures/binary-tree/abstract-binary-tree.ts:360</a></li></ul></aside></li></ul></section>
1528
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L360">src/data-structures/binary-tree/abstract-binary-tree.ts:360</a></li></ul></aside></li></ul></section>
1606
1529
  <section class="tsd-panel tsd-member"><a id="subTreeAdd" class="tsd-anchor"></a>
1607
1530
  <h3 class="tsd-anchor-link"><span>sub<wbr/>Tree<wbr/>Add</span><a href="#subTreeAdd" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1608
1531
  <ul class="tsd-signatures">
@@ -1636,7 +1559,7 @@ specifies the property of the binary tree node that should be modified. If not p
1636
1559
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1637
1560
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#subTreeAdd">subTreeAdd</a></p>
1638
1561
  <ul>
1639
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L845">src/data-structures/binary-tree/abstract-binary-tree.ts:845</a></li></ul></aside></li></ul></section>
1562
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L882">src/data-structures/binary-tree/abstract-binary-tree.ts:882</a></li></ul></aside></li></ul></section>
1640
1563
  <section class="tsd-panel tsd-member"><a id="subTreeSum" class="tsd-anchor"></a>
1641
1564
  <h3 class="tsd-anchor-link"><span>sub<wbr/>Tree<wbr/>Sum</span><a href="#subTreeSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1642
1565
  <ul class="tsd-signatures">
@@ -1665,7 +1588,7 @@ not provided, it defaults to &#39;id&#39;.</p>
1665
1588
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1666
1589
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#subTreeSum">subTreeSum</a></p>
1667
1590
  <ul>
1668
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L789">src/data-structures/binary-tree/abstract-binary-tree.ts:789</a></li></ul></aside></li></ul></section>
1591
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L826">src/data-structures/binary-tree/abstract-binary-tree.ts:826</a></li></ul></aside></li></ul></section>
1669
1592
  <section class="tsd-panel tsd-member"><a id="swapLocation" class="tsd-anchor"></a>
1670
1593
  <h3 class="tsd-anchor-link"><span>swap<wbr/>Location</span><a href="#swapLocation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
1671
1594
  <ul class="tsd-signatures">
@@ -1692,7 +1615,7 @@ be swapped to.</p>
1692
1615
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
1693
1616
  <p>Implementation of <a href="../interfaces/IAbstractBinaryTree.html">IAbstractBinaryTree</a>.<a href="../interfaces/IAbstractBinaryTree.html#swapLocation">swapLocation</a></p>
1694
1617
  <ul>
1695
- <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/83d3f8d/src/data-structures/binary-tree/abstract-binary-tree.ts#L205">src/data-structures/binary-tree/abstract-binary-tree.ts:205</a></li></ul></aside></li></ul></section></section></div>
1618
+ <li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/474f431/src/data-structures/binary-tree/abstract-binary-tree.ts#L205">src/data-structures/binary-tree/abstract-binary-tree.ts:205</a></li></ul></aside></li></ul></section></section></div>
1696
1619
  <div class="col-sidebar">
1697
1620
  <div class="page-menu">
1698
1621
  <div class="tsd-navigation settings">