data-structure-typed 1.18.0 → 1.18.5

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 (268) hide show
  1. package/README.md +193 -66
  2. package/backup/recursive-type/src/assets/complexities-diff.jpg +0 -0
  3. package/backup/recursive-type/src/assets/data-structure-complexities.jpg +0 -0
  4. package/backup/recursive-type/src/assets/logo.png +0 -0
  5. package/backup/recursive-type/src/assets/overview-diagram-of-data-structures.png +0 -0
  6. package/backup/recursive-type/src/data-structures/binary-tree/aa-tree.ts +3 -0
  7. package/backup/recursive-type/src/data-structures/binary-tree/avl-tree.ts +288 -0
  8. package/backup/recursive-type/src/data-structures/binary-tree/b-tree.ts +3 -0
  9. package/backup/recursive-type/src/data-structures/binary-tree/binary-indexed-tree.ts +78 -0
  10. package/backup/recursive-type/src/data-structures/binary-tree/binary-tree.ts +1502 -0
  11. package/backup/recursive-type/src/data-structures/binary-tree/bst.ts +503 -0
  12. package/backup/recursive-type/src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif +0 -0
  13. package/backup/recursive-type/src/data-structures/binary-tree/diagrams/bst-rotation.gif +0 -0
  14. package/backup/recursive-type/src/data-structures/binary-tree/diagrams/segment-tree.png +0 -0
  15. package/backup/recursive-type/src/data-structures/binary-tree/index.ts +11 -0
  16. package/backup/recursive-type/src/data-structures/binary-tree/rb-tree.ts +110 -0
  17. package/backup/recursive-type/src/data-structures/binary-tree/segment-tree.ts +243 -0
  18. package/backup/recursive-type/src/data-structures/binary-tree/splay-tree.ts +3 -0
  19. package/backup/recursive-type/src/data-structures/binary-tree/tree-multiset.ts +55 -0
  20. package/backup/recursive-type/src/data-structures/binary-tree/two-three-tree.ts +3 -0
  21. package/backup/recursive-type/src/data-structures/diagrams/README.md +5 -0
  22. package/backup/recursive-type/src/data-structures/graph/abstract-graph.ts +985 -0
  23. package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
  24. package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
  25. package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
  26. package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
  27. package/backup/recursive-type/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
  28. package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
  29. package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
  30. package/backup/recursive-type/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
  31. package/backup/recursive-type/src/data-structures/graph/diagrams/mst.jpg +0 -0
  32. package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-articulation-point-bridge.png +0 -0
  33. package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-complicate-simple.png +0 -0
  34. package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-strongly-connected-component.png +0 -0
  35. package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.mp4 +0 -0
  36. package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.webp +0 -0
  37. package/backup/recursive-type/src/data-structures/graph/directed-graph.ts +478 -0
  38. package/backup/recursive-type/src/data-structures/graph/index.ts +3 -0
  39. package/backup/recursive-type/src/data-structures/graph/undirected-graph.ts +293 -0
  40. package/backup/recursive-type/src/data-structures/hash/coordinate-map.ts +67 -0
  41. package/backup/recursive-type/src/data-structures/hash/coordinate-set.ts +56 -0
  42. package/backup/recursive-type/src/data-structures/hash/hash-table.ts +3 -0
  43. package/backup/recursive-type/src/data-structures/hash/index.ts +6 -0
  44. package/backup/recursive-type/src/data-structures/hash/pair.ts +3 -0
  45. package/backup/recursive-type/src/data-structures/hash/tree-map.ts +3 -0
  46. package/backup/recursive-type/src/data-structures/hash/tree-set.ts +3 -0
  47. package/backup/recursive-type/src/data-structures/heap/heap.ts +176 -0
  48. package/backup/recursive-type/src/data-structures/heap/index.ts +3 -0
  49. package/backup/recursive-type/src/data-structures/heap/max-heap.ts +31 -0
  50. package/backup/recursive-type/src/data-structures/heap/min-heap.ts +34 -0
  51. package/backup/recursive-type/src/data-structures/index.ts +15 -0
  52. package/backup/recursive-type/src/data-structures/interfaces/abstract-graph.ts +42 -0
  53. package/backup/recursive-type/src/data-structures/interfaces/avl-tree.ts +1 -0
  54. package/backup/recursive-type/src/data-structures/interfaces/binary-tree.ts +56 -0
  55. package/backup/recursive-type/src/data-structures/interfaces/bst.ts +1 -0
  56. package/backup/recursive-type/src/data-structures/interfaces/directed-graph.ts +15 -0
  57. package/backup/recursive-type/src/data-structures/interfaces/doubly-linked-list.ts +1 -0
  58. package/backup/recursive-type/src/data-structures/interfaces/heap.ts +1 -0
  59. package/backup/recursive-type/src/data-structures/interfaces/index.ts +13 -0
  60. package/backup/recursive-type/src/data-structures/interfaces/navigator.ts +1 -0
  61. package/backup/recursive-type/src/data-structures/interfaces/priority-queue.ts +1 -0
  62. package/backup/recursive-type/src/data-structures/interfaces/segment-tree.ts +1 -0
  63. package/backup/recursive-type/src/data-structures/interfaces/singly-linked-list.ts +1 -0
  64. package/backup/recursive-type/src/data-structures/interfaces/tree-multiset.ts +1 -0
  65. package/backup/recursive-type/src/data-structures/interfaces/undirected-graph.ts +3 -0
  66. package/backup/recursive-type/src/data-structures/linked-list/doubly-linked-list.ts +573 -0
  67. package/backup/recursive-type/src/data-structures/linked-list/index.ts +3 -0
  68. package/backup/recursive-type/src/data-structures/linked-list/singly-linked-list.ts +490 -0
  69. package/backup/recursive-type/src/data-structures/linked-list/skip-linked-list.ts +3 -0
  70. package/backup/recursive-type/src/data-structures/matrix/index.ts +4 -0
  71. package/backup/recursive-type/src/data-structures/matrix/matrix.ts +27 -0
  72. package/backup/recursive-type/src/data-structures/matrix/matrix2d.ts +208 -0
  73. package/backup/recursive-type/src/data-structures/matrix/navigator.ts +122 -0
  74. package/backup/recursive-type/src/data-structures/matrix/vector2d.ts +316 -0
  75. package/backup/recursive-type/src/data-structures/priority-queue/index.ts +3 -0
  76. package/backup/recursive-type/src/data-structures/priority-queue/max-priority-queue.ts +49 -0
  77. package/backup/recursive-type/src/data-structures/priority-queue/min-priority-queue.ts +50 -0
  78. package/backup/recursive-type/src/data-structures/priority-queue/priority-queue.ts +354 -0
  79. package/backup/recursive-type/src/data-structures/queue/deque.ts +251 -0
  80. package/backup/recursive-type/src/data-structures/queue/index.ts +2 -0
  81. package/backup/recursive-type/src/data-structures/queue/queue.ts +120 -0
  82. package/backup/recursive-type/src/data-structures/stack/index.ts +1 -0
  83. package/backup/recursive-type/src/data-structures/stack/stack.ts +98 -0
  84. package/backup/recursive-type/src/data-structures/tree/index.ts +1 -0
  85. package/backup/recursive-type/src/data-structures/tree/tree.ts +80 -0
  86. package/backup/recursive-type/src/data-structures/trie/index.ts +1 -0
  87. package/backup/recursive-type/src/data-structures/trie/trie.ts +227 -0
  88. package/backup/recursive-type/src/data-structures/types/abstract-graph.ts +5 -0
  89. package/backup/recursive-type/src/data-structures/types/avl-tree.ts +8 -0
  90. package/backup/recursive-type/src/data-structures/types/binary-tree.ts +10 -0
  91. package/backup/recursive-type/src/data-structures/types/bst.ts +6 -0
  92. package/backup/recursive-type/src/data-structures/types/directed-graph.ts +8 -0
  93. package/backup/recursive-type/src/data-structures/types/doubly-linked-list.ts +1 -0
  94. package/backup/recursive-type/src/data-structures/types/heap.ts +5 -0
  95. package/backup/recursive-type/src/data-structures/types/index.ts +12 -0
  96. package/backup/recursive-type/src/data-structures/types/navigator.ts +13 -0
  97. package/backup/recursive-type/src/data-structures/types/priority-queue.ts +9 -0
  98. package/backup/recursive-type/src/data-structures/types/segment-tree.ts +1 -0
  99. package/backup/recursive-type/src/data-structures/types/singly-linked-list.ts +1 -0
  100. package/backup/recursive-type/src/data-structures/types/tree-multiset.ts +1 -0
  101. package/backup/recursive-type/src/index.ts +1 -0
  102. package/backup/recursive-type/src/utils/index.ts +2 -0
  103. package/backup/recursive-type/src/utils/types/index.ts +1 -0
  104. package/backup/recursive-type/src/utils/types/utils.ts +6 -0
  105. package/backup/recursive-type/src/utils/utils.ts +78 -0
  106. package/dist/data-structures/binary-tree/avl-tree.d.ts +19 -25
  107. package/dist/data-structures/binary-tree/avl-tree.js +8 -16
  108. package/dist/data-structures/binary-tree/binary-tree.d.ts +99 -98
  109. package/dist/data-structures/binary-tree/binary-tree.js +70 -65
  110. package/dist/data-structures/binary-tree/bst.d.ts +21 -21
  111. package/dist/data-structures/binary-tree/bst.js +15 -17
  112. package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -2
  113. package/dist/data-structures/binary-tree/rb-tree.js +68 -5
  114. package/dist/data-structures/binary-tree/tree-multiset.d.ts +9 -8
  115. package/dist/data-structures/binary-tree/tree-multiset.js +7 -6
  116. package/dist/data-structures/graph/abstract-graph.d.ts +56 -58
  117. package/dist/data-structures/graph/abstract-graph.js +84 -68
  118. package/dist/data-structures/graph/directed-graph.d.ts +127 -96
  119. package/dist/data-structures/graph/directed-graph.js +161 -109
  120. package/dist/data-structures/graph/undirected-graph.d.ts +82 -59
  121. package/dist/data-structures/graph/undirected-graph.js +99 -72
  122. package/dist/data-structures/hash/coordinate-set.d.ts +1 -1
  123. package/dist/data-structures/index.d.ts +1 -0
  124. package/dist/data-structures/index.js +1 -0
  125. package/dist/data-structures/interfaces/abstract-graph.d.ts +22 -0
  126. package/dist/data-structures/interfaces/abstract-graph.js +2 -0
  127. package/dist/data-structures/interfaces/avl-tree.d.ts +1 -0
  128. package/dist/data-structures/interfaces/avl-tree.js +2 -0
  129. package/dist/data-structures/interfaces/binary-tree.d.ts +27 -0
  130. package/dist/data-structures/interfaces/binary-tree.js +2 -0
  131. package/dist/data-structures/interfaces/bst.d.ts +1 -0
  132. package/dist/data-structures/interfaces/bst.js +2 -0
  133. package/dist/data-structures/interfaces/directed-graph.d.ts +9 -0
  134. package/dist/data-structures/interfaces/directed-graph.js +2 -0
  135. package/dist/data-structures/interfaces/doubly-linked-list.d.ts +1 -0
  136. package/dist/data-structures/interfaces/doubly-linked-list.js +2 -0
  137. package/dist/data-structures/interfaces/heap.d.ts +1 -0
  138. package/dist/data-structures/interfaces/heap.js +2 -0
  139. package/dist/data-structures/interfaces/index.d.ts +13 -0
  140. package/dist/data-structures/interfaces/index.js +29 -0
  141. package/dist/data-structures/interfaces/navigator.d.ts +1 -0
  142. package/dist/data-structures/interfaces/navigator.js +2 -0
  143. package/dist/data-structures/interfaces/priority-queue.d.ts +1 -0
  144. package/dist/data-structures/interfaces/priority-queue.js +2 -0
  145. package/dist/data-structures/interfaces/segment-tree.d.ts +1 -0
  146. package/dist/data-structures/interfaces/segment-tree.js +2 -0
  147. package/dist/data-structures/interfaces/singly-linked-list.d.ts +1 -0
  148. package/dist/data-structures/interfaces/singly-linked-list.js +2 -0
  149. package/dist/data-structures/interfaces/tree-multiset.d.ts +1 -0
  150. package/dist/data-structures/interfaces/tree-multiset.js +2 -0
  151. package/dist/data-structures/interfaces/undirected-graph.d.ts +2 -0
  152. package/dist/data-structures/interfaces/undirected-graph.js +2 -0
  153. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
  154. package/dist/data-structures/linked-list/singly-linked-list.d.ts +1 -1
  155. package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
  156. package/dist/data-structures/priority-queue/priority-queue.js +4 -4
  157. package/dist/data-structures/queue/deque.d.ts +5 -5
  158. package/dist/data-structures/queue/deque.js +6 -6
  159. package/dist/data-structures/queue/queue.d.ts +1 -1
  160. package/dist/data-structures/stack/stack.d.ts +1 -1
  161. package/dist/data-structures/types/abstract-graph.d.ts +1 -20
  162. package/dist/data-structures/types/avl-tree.d.ts +5 -4
  163. package/dist/data-structures/types/binary-tree.d.ts +6 -5
  164. package/dist/data-structures/types/bst.d.ts +4 -3
  165. package/dist/data-structures/types/directed-graph.d.ts +5 -9
  166. package/dist/data-structures/types/directed-graph.js +7 -0
  167. package/dist/data-structures/types/heap.d.ts +2 -2
  168. package/dist/data-structures/types/index.d.ts +0 -1
  169. package/dist/data-structures/types/index.js +0 -1
  170. package/dist/data-structures/types/navigator.d.ts +2 -2
  171. package/dist/data-structures/types/priority-queue.d.ts +2 -2
  172. package/dist/data-structures/types/tree-multiset.d.ts +3 -4
  173. package/docs/assets/search.js +1 -1
  174. package/docs/classes/AVLTree.html +288 -287
  175. package/docs/classes/AVLTreeNode.html +106 -63
  176. package/docs/classes/AaTree.html +14 -12
  177. package/docs/classes/AbstractEdge.html +68 -34
  178. package/docs/classes/AbstractGraph.html +219 -114
  179. package/docs/classes/AbstractVertex.html +71 -30
  180. package/docs/classes/ArrayDeque.html +27 -25
  181. package/docs/classes/BST.html +279 -273
  182. package/docs/classes/BSTNode.html +106 -57
  183. package/docs/classes/BTree.html +14 -12
  184. package/docs/classes/BinaryIndexedTree.html +22 -20
  185. package/docs/classes/BinaryTree.html +283 -277
  186. package/docs/classes/BinaryTreeNode.html +111 -63
  187. package/docs/classes/Character.html +17 -15
  188. package/docs/classes/CoordinateMap.html +22 -20
  189. package/docs/classes/CoordinateSet.html +23 -21
  190. package/docs/classes/Deque.html +47 -45
  191. package/docs/classes/DirectedEdge.html +74 -41
  192. package/docs/classes/DirectedGraph.html +444 -208
  193. package/docs/classes/DirectedVertex.html +63 -36
  194. package/docs/classes/DoublyLinkedList.html +52 -50
  195. package/docs/classes/DoublyLinkedListNode.html +24 -22
  196. package/docs/classes/HashTable.html +14 -12
  197. package/docs/classes/Heap.html +29 -27
  198. package/docs/classes/HeapItem.html +21 -19
  199. package/docs/classes/Matrix2D.html +29 -27
  200. package/docs/classes/MatrixNTI2D.html +17 -15
  201. package/docs/classes/MaxHeap.html +29 -27
  202. package/docs/classes/MaxPriorityQueue.html +67 -60
  203. package/docs/classes/MinHeap.html +29 -27
  204. package/docs/classes/MinPriorityQueue.html +67 -60
  205. package/docs/classes/Navigator.html +24 -22
  206. package/docs/classes/ObjectDeque.html +62 -50
  207. package/docs/classes/Pair.html +14 -12
  208. package/docs/classes/PriorityQueue.html +62 -55
  209. package/docs/classes/Queue.html +29 -27
  210. package/docs/classes/SegmentTree.html +30 -28
  211. package/docs/classes/SegmentTreeNode.html +33 -31
  212. package/docs/classes/SinglyLinkedList.html +49 -47
  213. package/docs/classes/SinglyLinkedListNode.html +21 -19
  214. package/docs/classes/SkipLinkedList.html +14 -12
  215. package/docs/classes/SplayTree.html +14 -12
  216. package/docs/classes/Stack.html +27 -25
  217. package/docs/classes/TreeMap.html +14 -12
  218. package/docs/classes/TreeMultiSet.html +277 -270
  219. package/docs/classes/TreeNode.html +29 -27
  220. package/docs/classes/TreeSet.html +14 -12
  221. package/docs/classes/Trie.html +26 -24
  222. package/docs/classes/TrieNode.html +24 -22
  223. package/docs/classes/TwoThreeTree.html +14 -12
  224. package/docs/classes/UndirectedEdge.html +70 -51
  225. package/docs/classes/UndirectedGraph.html +344 -161
  226. package/docs/classes/UndirectedVertex.html +63 -36
  227. package/docs/classes/Vector2D.html +41 -39
  228. package/docs/enums/CP.html +17 -15
  229. package/docs/enums/FamilyPosition.html +17 -15
  230. package/docs/enums/LoopType.html +16 -14
  231. package/docs/{interfaces/AVLTreeDeleted.html → enums/TopologicalProperty.html} +43 -43
  232. package/docs/index.html +195 -68
  233. package/docs/interfaces/{HeapOptions.html → IBinaryTree.html} +39 -32
  234. package/docs/interfaces/IBinaryTreeNode.html +383 -0
  235. package/docs/interfaces/IDirectedGraph.html +20 -18
  236. package/docs/interfaces/IGraph.html +118 -88
  237. package/docs/interfaces/{PriorityQueueOptions.html → IUNDirectedGraph.html} +22 -53
  238. package/docs/modules.html +25 -21
  239. package/docs/types/{ToThunkFn.html → AVLTreeDeleted.html} +27 -21
  240. package/docs/types/BSTComparator.html +14 -12
  241. package/docs/types/BSTDeletedResult.html +19 -17
  242. package/docs/types/BinaryTreeDeleted.html +19 -17
  243. package/docs/types/BinaryTreeNodeId.html +14 -12
  244. package/docs/types/BinaryTreeNodePropertyName.html +14 -12
  245. package/docs/types/DFSOrderPattern.html +14 -12
  246. package/docs/types/DijkstraResult.html +14 -12
  247. package/docs/types/Direction.html +14 -12
  248. package/docs/types/{TrlFn.html → EdgeId.html} +18 -29
  249. package/docs/types/{TrlAsyncFn.html → HeapOptions.html} +29 -19
  250. package/docs/types/NavigatorParams.html +164 -0
  251. package/docs/types/NodeOrPropertyName.html +14 -12
  252. package/docs/types/PriorityQueueComparator.html +14 -12
  253. package/docs/types/PriorityQueueDFSOrderPattern.html +14 -12
  254. package/docs/types/{SpecifyOptional.html → PriorityQueueOptions.html} +28 -19
  255. package/docs/types/RecursiveAVLTreeNode.html +135 -0
  256. package/docs/types/{Thunk.html → RecursiveBSTNode.html} +23 -24
  257. package/docs/types/RecursiveBinaryTreeNode.html +135 -0
  258. package/docs/types/ResultByProperty.html +17 -15
  259. package/docs/types/ResultsByProperty.html +17 -15
  260. package/docs/types/SegmentTreeNodeVal.html +14 -12
  261. package/docs/types/TopologicalStatus.html +14 -12
  262. package/docs/types/TreeMultiSetDeletedResult.html +19 -17
  263. package/docs/types/Turning.html +14 -12
  264. package/docs/types/VertexId.html +14 -12
  265. package/notes/note.md +8 -1
  266. package/package.json +10 -2
  267. package/docs/classes/RBTree.html +0 -153
  268. package/docs/interfaces/NavigatorParams.html +0 -200
@@ -5,7 +5,8 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { BinaryTreeDeleted, BinaryTreeNodeId, BinaryTreeNodePropertyName, DFSOrderPattern, NodeOrPropertyName, ResultsByProperty } from '../types';
8
+ import type { BinaryTreeDeleted, BinaryTreeNodeId, BinaryTreeNodePropertyName, DFSOrderPattern, NodeOrPropertyName, RecursiveBinaryTreeNode, ResultsByProperty } from '../types';
9
+ import { IBinaryTree, IBinaryTreeNode } from '../interfaces';
9
10
  export declare enum FamilyPosition {
10
11
  root = 0,
11
12
  left = 1,
@@ -21,7 +22,7 @@ export declare enum LoopType {
21
22
  iterative = 1,
22
23
  recursive = 2
23
24
  }
24
- export declare class BinaryTreeNode<T> {
25
+ export declare class BinaryTreeNode<T, FAMILY extends BinaryTreeNode<T, FAMILY> = RecursiveBinaryTreeNode<T>> implements IBinaryTreeNode<T, FAMILY> {
25
26
  constructor(id: BinaryTreeNodeId, val: T, count?: number);
26
27
  private _id;
27
28
  get id(): BinaryTreeNodeId;
@@ -30,14 +31,14 @@ export declare class BinaryTreeNode<T> {
30
31
  get val(): T;
31
32
  set val(v: T);
32
33
  private _left?;
33
- get left(): BinaryTreeNode<T> | null | undefined;
34
- set left(v: BinaryTreeNode<T> | null | undefined);
34
+ get left(): FAMILY | null | undefined;
35
+ set left(v: FAMILY | null | undefined);
35
36
  private _right?;
36
- get right(): BinaryTreeNode<T> | null | undefined;
37
- set right(v: BinaryTreeNode<T> | null | undefined);
37
+ get right(): FAMILY | null | undefined;
38
+ set right(v: FAMILY | null | undefined);
38
39
  private _parent;
39
- get parent(): BinaryTreeNode<T> | null | undefined;
40
- set parent(v: BinaryTreeNode<T> | null | undefined);
40
+ get parent(): FAMILY | null | undefined;
41
+ set parent(v: FAMILY | null | undefined);
41
42
  private _familyPosition;
42
43
  get familyPosition(): FamilyPosition;
43
44
  set familyPosition(v: FamilyPosition);
@@ -47,10 +48,11 @@ export declare class BinaryTreeNode<T> {
47
48
  private _height;
48
49
  get height(): number;
49
50
  set height(v: number);
50
- swapLocation(swapNode: BinaryTreeNode<T>): BinaryTreeNode<T>;
51
- clone(): BinaryTreeNode<T>;
51
+ _createNode(id: BinaryTreeNodeId, val: T | null, count?: number): FAMILY | null;
52
+ swapLocation(swapNode: FAMILY): FAMILY;
53
+ clone(): FAMILY | null;
52
54
  }
53
- export declare class BinaryTree<T> {
55
+ export declare class BinaryTree<N extends BinaryTreeNode<N['val'], N> = BinaryTreeNode<number>> implements IBinaryTree<N> {
54
56
  /**
55
57
  * The constructor function accepts an optional options object and sets the values of loopType, autoIncrementId, and
56
58
  * isDuplicatedVal based on the provided options.
@@ -66,9 +68,9 @@ export declare class BinaryTree<T> {
66
68
  private _visitedId;
67
69
  get visitedId(): BinaryTreeNodeId[];
68
70
  private _visitedVal;
69
- get visitedVal(): Array<T>;
71
+ get visitedVal(): Array<N['val']>;
70
72
  private _visitedNode;
71
- get visitedNode(): BinaryTreeNode<T>[];
73
+ get visitedNode(): N[];
72
74
  private _visitedCount;
73
75
  get visitedCount(): number[];
74
76
  private _visitedLeftSum;
@@ -80,24 +82,23 @@ export declare class BinaryTree<T> {
80
82
  private _isDuplicatedVal;
81
83
  get isDuplicatedVal(): boolean;
82
84
  private _root;
83
- get root(): BinaryTreeNode<T> | null;
85
+ get root(): N | null;
84
86
  private _size;
85
87
  get size(): number;
86
88
  private _count;
87
89
  get count(): number;
88
90
  /**
89
- * The function creates a new binary tree node with the given id, value, and count, or returns null if the value is
90
- * null.
91
+ * The function creates a new binary tree node with the given id, value, and count if the value is not null, otherwise
92
+ * it returns null.
91
93
  * @param {BinaryTreeNodeId} id - The `id` parameter is the identifier for the binary tree node. It is of type
92
- * `BinaryTreeNodeId`, which could be a string or a number, depending on how you want to identify your nodes.
93
- * @param {T | null} val - The `val` parameter represents the value to be stored in the binary tree node. It can be of
94
- * any type `T` or `null`.
95
- * @param {number} [count] - The count parameter is an optional parameter that represents the number of occurrences of
96
- * the value in the binary tree node. It is of type number.
97
- * @returns The function `createNode` returns a `BinaryTreeNode<T>` object if the `val` parameter is not null.
98
- * Otherwise, it returns null.
94
+ * `BinaryTreeNodeId`.
95
+ * @param {N | null} val - The `val` parameter represents the value of the node. It can be of type `N` (generic type)
96
+ * or `null`.
97
+ * @param {number} [count] - The `count` parameter is an optional parameter of type `number`. It represents the number
98
+ * of occurrences of the value in the binary tree node. If not provided, the default value is `undefined`.
99
+ * @returns a BinaryTreeNode object if the value is not null, otherwise it returns null.
99
100
  */
100
- createNode(id: BinaryTreeNodeId, val: T | null, count?: number): BinaryTreeNode<T> | null;
101
+ _createNode(id: BinaryTreeNodeId, val: N['val'] | null, count?: number): N | null;
101
102
  /**
102
103
  * The clear function resets the state of an object by setting its properties to their initial values.
103
104
  */
@@ -112,38 +113,38 @@ export declare class BinaryTree<T> {
112
113
  * already exists.
113
114
  * @param {BinaryTreeNodeId} id - The id parameter is the identifier of the binary tree node. It is used to uniquely
114
115
  * identify each node in the binary tree.
115
- * @param {T} val - The value to be inserted into the binary tree.
116
+ * @param {N} val - The value to be inserted into the binary tree.
116
117
  * @param {number} [count] - The `count` parameter is an optional parameter that specifies the number of times the
117
118
  * value should be inserted into the binary tree. If not provided, it defaults to 1.
118
- * @returns The function `add` returns a `BinaryTreeNode<T>` object if a new node is inserted, or `null` if no new node
119
+ * @returns The function `add` returns a `N` object if a new node is inserted, or `null` if no new node
119
120
  * is inserted, or `undefined` if the insertion fails.
120
121
  */
121
- add(id: BinaryTreeNodeId, val: T, count?: number): BinaryTreeNode<T> | null | undefined;
122
+ add(id: BinaryTreeNodeId, val: N['val'], count?: number): N | null | undefined;
122
123
  /**
123
124
  * The function inserts a new node into a binary tree as the left or right child of a given parent node.
124
- * @param {BinaryTreeNode<T> | null} newNode - The `newNode` parameter is an instance of the `BinaryTreeNode` class or
125
+ * @param {N | null} newNode - The `newNode` parameter is an instance of the `BinaryTreeNode` class or
125
126
  * `null`. It represents the node that needs to be inserted into the binary tree.
126
127
  * @param parent - The `parent` parameter is a BinaryTreeNode object representing the parent node to which the new node
127
128
  * will be inserted as a child.
128
129
  * @returns The method returns the newly inserted node, either as the left child or the right child of the parent node.
129
130
  */
130
- addTo(newNode: BinaryTreeNode<T> | null, parent: BinaryTreeNode<T>): BinaryTreeNode<T> | null | undefined;
131
+ addTo(newNode: N | null, parent: N): N | null | undefined;
131
132
  /**
132
133
  * The `addMany` function inserts multiple items into a binary tree and returns an array of the inserted nodes or
133
134
  * null/undefined values.
134
- * @param {T[] | BinaryTreeNode<T>[]} data - The `data` parameter can be either an array of elements of type `T` or an
135
- * array of `BinaryTreeNode<T>` objects.
136
- * @returns The function `addMany` returns an array of `BinaryTreeNode<T>`, `null`, or `undefined` values.
135
+ * @param {N[] | N[]} data - The `data` parameter can be either an array of elements of type `N` or an
136
+ * array of `N` objects.
137
+ * @returns The function `addMany` returns an array of `N`, `null`, or `undefined` values.
137
138
  */
138
- addMany(data: T[] | BinaryTreeNode<T>[]): (BinaryTreeNode<T> | null | undefined)[];
139
+ addMany(data: N[] | Array<N['val']>): (N | null | undefined)[];
139
140
  /**
140
141
  * The `fill` function clears the current data and inserts new data, returning a boolean indicating if the insertion
141
142
  * was successful.
142
- * @param {T[] | BinaryTreeNode<T>[]} data - The `data` parameter can be either an array of elements of type `T` or an
143
- * array of `BinaryTreeNode<T>` objects.
143
+ * @param {N[] | N[]} data - The `data` parameter can be either an array of elements of type `N` or an
144
+ * array of `N` objects.
144
145
  * @returns The method is returning a boolean value.
145
146
  */
146
- fill(data: T[] | BinaryTreeNode<T>[]): boolean;
147
+ fill(data: N[] | Array<N['val']>): boolean;
147
148
  /**
148
149
  * The function removes a node from a binary tree and returns information about the deleted node.
149
150
  * @param {BinaryTreeNodeId} id - The `id` parameter is the identifier of the binary tree node that you want to remove.
@@ -155,102 +156,102 @@ export declare class BinaryTree<T> {
155
156
  * "needBalanced". The "deleted" property contains the deleted node or undefined if no node was deleted. The
156
157
  * "needBalanced" property is always null.
157
158
  */
158
- remove(id: BinaryTreeNodeId, ignoreCount?: boolean): BinaryTreeDeleted<T>[];
159
+ remove(id: BinaryTreeNodeId, ignoreCount?: boolean): BinaryTreeDeleted<N>[];
159
160
  /**
160
161
  * The function calculates the depth of a binary tree node by traversing its parent nodes.
161
- * @param node - BinaryTreeNode<T> - This is the node for which we want to calculate the depth. It is a generic type,
162
+ * @param node - N - This is the node for which we want to calculate the depth. It is a generic type,
162
163
  * meaning it can represent any type of data that we want to store in the node.
163
164
  * @returns The depth of the given binary tree node.
164
165
  */
165
- getDepth(node: BinaryTreeNode<T>): number;
166
+ getDepth(node: N): number;
166
167
  /**
167
168
  * The `getHeight` function calculates the maximum height of a binary tree using either a recursive or iterative
168
169
  * approach.
169
- * @param {BinaryTreeNode<T> | null} [beginRoot] - The `beginRoot` parameter is an optional parameter of type
170
- * `BinaryTreeNode<T> | null`. It represents the starting node from which to calculate the height of the binary tree.
170
+ * @param {N | null} [beginRoot] - The `beginRoot` parameter is an optional parameter of type
171
+ * `N | null`. It represents the starting node from which to calculate the height of the binary tree.
171
172
  * If no value is provided for `beginRoot`, the function will use the `root` property of the class instance as
172
173
  * @returns the height of the binary tree.
173
174
  */
174
- getHeight(beginRoot?: BinaryTreeNode<T> | null): number;
175
+ getHeight(beginRoot?: N | null): number;
175
176
  /**
176
177
  * The `getMinHeight` function calculates the minimum height of a binary tree using either a recursive or iterative
177
178
  * approach.
178
- * @param {BinaryTreeNode<T> | null} [beginRoot] - The `beginRoot` parameter is an optional parameter of type
179
- * `BinaryTreeNode<T> | null`. It represents the starting node from which to calculate the minimum height of the binary
179
+ * @param {N | null} [beginRoot] - The `beginRoot` parameter is an optional parameter of type
180
+ * `N | null`. It represents the starting node from which to calculate the minimum height of the binary
180
181
  * tree. If no value is provided for `beginRoot`, the function will use the root node of the binary tree.
181
182
  * @returns The function `getMinHeight` returns the minimum height of the binary tree.
182
183
  */
183
- getMinHeight(beginRoot?: BinaryTreeNode<T> | null): number;
184
+ getMinHeight(beginRoot?: N | null): number;
184
185
  /**
185
186
  * The function checks if a binary tree is balanced by comparing the minimum height and the maximum height of the tree.
186
- * @param {BinaryTreeNode<T> | null} [beginRoot] - The `beginRoot` parameter is the root node of a binary tree. It is
187
- * of type `BinaryTreeNode<T> | null`, which means it can either be a `BinaryTreeNode` object or `null`.
187
+ * @param {N | null} [beginRoot] - The `beginRoot` parameter is the root node of a binary tree. It is
188
+ * of type `N | null`, which means it can either be a `BinaryTreeNode` object or `null`.
188
189
  * @returns The method is returning a boolean value.
189
190
  */
190
- isBalanced(beginRoot?: BinaryTreeNode<T> | null): boolean;
191
+ isBalanced(beginRoot?: N | null): boolean;
191
192
  /**
192
193
  * The function `getNodes` returns an array of binary tree nodes that match a given property value, with options for
193
194
  * searching recursively or iteratively.
194
- * @param {BinaryTreeNodeId | T} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
195
- * generic type `T`. It represents the property of the binary tree node that you want to search for.
195
+ * @param {BinaryTreeNodeId | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
196
+ * generic type `N`. It represents the property of the binary tree node that you want to search for.
196
197
  * @param {BinaryTreeNodePropertyName} [propertyName] - The `propertyName` parameter is an optional parameter that
197
198
  * specifies the property name to use when searching for nodes. If not provided, it defaults to 'id'.
198
199
  * @param {boolean} [onlyOne] - The `onlyOne` parameter is an optional boolean parameter that determines whether to
199
200
  * return only one node that matches the `nodeProperty` or `propertyName` criteria. If `onlyOne` is set to `true`, the
200
201
  * function will stop traversing the tree and return the first matching node. If `
201
- * @returns The function `getNodes` returns an array of `BinaryTreeNode<T> | null | undefined` objects.
202
+ * @returns The function `getNodes` returns an array of `N | null | undefined` objects.
202
203
  */
203
- getNodes(nodeProperty: BinaryTreeNodeId | T, propertyName?: BinaryTreeNodePropertyName, onlyOne?: boolean): (BinaryTreeNode<T> | null | undefined)[];
204
+ getNodes(nodeProperty: BinaryTreeNodeId | N, propertyName?: BinaryTreeNodePropertyName, onlyOne?: boolean): (N | null | undefined)[];
204
205
  /**
205
206
  * The function checks if a binary tree node has a specific property or if any node in the tree has a specific
206
207
  * property.
207
- * @param {BinaryTreeNodeId | T} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
208
- * generic type `T`. It represents the property of a binary tree node that you want to check.
208
+ * @param {BinaryTreeNodeId | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
209
+ * generic type `N`. It represents the property of a binary tree node that you want to check.
209
210
  * @param {BinaryTreeNodePropertyName} [propertyName] - The `propertyName` parameter is an optional parameter that
210
211
  * specifies the name of the property to check for in the nodes.
211
212
  * @returns a boolean value.
212
213
  */
213
- has(nodeProperty: BinaryTreeNodeId | T, propertyName?: BinaryTreeNodePropertyName): boolean;
214
+ has(nodeProperty: BinaryTreeNodeId | N, propertyName?: BinaryTreeNodePropertyName): boolean;
214
215
  /**
215
216
  * The function returns the first binary tree node that matches the given property name and value, or null if no match
216
217
  * is found.
217
- * @param {BinaryTreeNodeId | T} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
218
- * generic type `T`. It represents the property of the binary tree node that you want to search for.
218
+ * @param {BinaryTreeNodeId | N} nodeProperty - The `nodeProperty` parameter can be either a `BinaryTreeNodeId` or a
219
+ * generic type `N`. It represents the property of the binary tree node that you want to search for.
219
220
  * @param {BinaryTreeNodePropertyName} [propertyName] - The `propertyName` parameter is an optional parameter that
220
221
  * specifies the property of the binary tree node to search for. If not provided, it defaults to `'id'`.
221
222
  * @returns a BinaryTreeNode object or null.
222
223
  */
223
- get(nodeProperty: BinaryTreeNodeId | T, propertyName?: BinaryTreeNodePropertyName): BinaryTreeNode<T> | null;
224
+ get(nodeProperty: BinaryTreeNodeId | N, propertyName?: BinaryTreeNodePropertyName): N | null;
224
225
  /**
225
226
  * The function getPathToRoot returns an array of BinaryTreeNode objects representing the path from a given node to the
226
227
  * root of a binary tree.
227
228
  * @param node - The `node` parameter is a BinaryTreeNode object.
228
- * @returns The function `getPathToRoot` returns an array of `BinaryTreeNode<T>` objects, representing the path from
229
+ * @returns The function `getPathToRoot` returns an array of `N` objects, representing the path from
229
230
  * the given `node` to the root of the binary tree.
230
231
  */
231
- getPathToRoot(node: BinaryTreeNode<T>): BinaryTreeNode<T>[];
232
- getLeftMost(): BinaryTreeNode<T> | null;
233
- getLeftMost(node: BinaryTreeNode<T>): BinaryTreeNode<T>;
234
- getRightMost(): BinaryTreeNode<T> | null;
235
- getRightMost(node: BinaryTreeNode<T>): BinaryTreeNode<T>;
232
+ getPathToRoot(node: N): N[];
233
+ getLeftMost(): N | null;
234
+ getLeftMost(node: N): N;
235
+ getRightMost(): N | null;
236
+ getRightMost(node: N): N;
236
237
  /**
237
238
  * The `isBST` function checks if a binary tree is a binary search tree.
238
- * @param {BinaryTreeNode<T> | null} [node] - The `node` parameter is an optional parameter of type `BinaryTreeNode<T>
239
+ * @param {N | null} [node] - The `node` parameter is an optional parameter of type `N
239
240
  * | null`. It represents the root node of the binary search tree (BST) that we want to check for validity. If no node
240
241
  * is provided, the function will default to using the root node of the BST instance that
241
242
  * @returns The `isBST` function returns a boolean value. It returns `true` if the binary tree is a valid binary search
242
243
  * tree, and `false` otherwise.
243
244
  */
244
- isBST(node?: BinaryTreeNode<T> | null): boolean;
245
+ isBST(node?: N | null): boolean;
245
246
  /**
246
247
  * The function calculates the size and count of a subtree in a binary tree using either recursive or iterative
247
248
  * traversal.
248
- * @param {BinaryTreeNode<T> | null | undefined} subTreeRoot - The `subTreeRoot` parameter is the root node of a binary
249
+ * @param {N | null | undefined} subTreeRoot - The `subTreeRoot` parameter is the root node of a binary
249
250
  * tree.
250
251
  * @returns The function `getSubTreeSizeAndCount` returns an array `[number, number]`. The first element of the array
251
252
  * represents the size of the subtree, and the second element represents the count of the nodes in the subtree.
252
253
  */
253
- getSubTreeSizeAndCount(subTreeRoot: BinaryTreeNode<T> | null | undefined): [number, number];
254
+ getSubTreeSizeAndCount(subTreeRoot: N | null | undefined): [number, number];
254
255
  /**
255
256
  * The function `subTreeSum` calculates the sum of a specified property in a binary tree, either recursively or
256
257
  * iteratively.
@@ -261,7 +262,7 @@ export declare class BinaryTree<T> {
261
262
  * provided, it defaults to `'val'`.
262
263
  * @returns a number, which is the sum of the values of the nodes in the subtree rooted at `subTreeRoot`.
263
264
  */
264
- subTreeSum(subTreeRoot: BinaryTreeNode<T>, propertyName?: BinaryTreeNodePropertyName): number;
265
+ subTreeSum(subTreeRoot: N, propertyName?: BinaryTreeNodePropertyName): number;
265
266
  /**
266
267
  * The function `subTreeAdd` adds a specified delta value to a property of each node in a binary tree.
267
268
  * @param subTreeRoot - The `subTreeRoot` parameter is the root node of the subtree where the values will be modified.
@@ -271,53 +272,53 @@ export declare class BinaryTree<T> {
271
272
  * specifies the property of the `BinaryTreeNode` that should be modified. It defaults to `'id'` if not provided.
272
273
  * @returns a boolean value, which is `true`.
273
274
  */
274
- subTreeAdd(subTreeRoot: BinaryTreeNode<T>, delta: number, propertyName?: BinaryTreeNodePropertyName): boolean;
275
+ subTreeAdd(subTreeRoot: N, delta: number, propertyName?: BinaryTreeNodePropertyName): boolean;
275
276
  BFS(): BinaryTreeNodeId[];
276
277
  BFS(nodeOrPropertyName: 'id'): BinaryTreeNodeId[];
277
- BFS(nodeOrPropertyName: 'val'): T[];
278
- BFS(nodeOrPropertyName: 'node'): BinaryTreeNode<T>[];
278
+ BFS(nodeOrPropertyName: 'val'): N['val'][];
279
+ BFS(nodeOrPropertyName: 'node'): N[];
279
280
  BFS(nodeOrPropertyName: 'count'): number[];
280
281
  DFS(): BinaryTreeNodeId[];
281
282
  DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
282
- DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): T[];
283
- DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): BinaryTreeNode<T>[];
283
+ DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): N[];
284
+ DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): N[];
284
285
  DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'count'): number[];
285
286
  DFSIterative(): BinaryTreeNodeId[];
286
287
  DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
287
- DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): T[];
288
- DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): BinaryTreeNode<T>[];
288
+ DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): N[];
289
+ DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): N[];
289
290
  DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'count'): number[];
290
- levelIterative(node: BinaryTreeNode<T> | null): BinaryTreeNodeId[];
291
- levelIterative(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
292
- levelIterative(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'val'): T[];
293
- levelIterative(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'node'): BinaryTreeNode<T>[];
294
- levelIterative(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'count'): number[];
295
- listLevels(node: BinaryTreeNode<T> | null): BinaryTreeNodeId[][];
296
- listLevels(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[][];
297
- listLevels(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'val'): T[][];
298
- listLevels(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'node'): BinaryTreeNode<T>[][];
299
- listLevels(node: BinaryTreeNode<T> | null, nodeOrPropertyName?: 'count'): number[][];
291
+ levelIterative(node: N | null): BinaryTreeNodeId[];
292
+ levelIterative(node: N | null, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
293
+ levelIterative(node: N | null, nodeOrPropertyName?: 'val'): N['val'][];
294
+ levelIterative(node: N | null, nodeOrPropertyName?: 'node'): N[];
295
+ levelIterative(node: N | null, nodeOrPropertyName?: 'count'): number[];
296
+ listLevels(node: N | null): BinaryTreeNodeId[][];
297
+ listLevels(node: N | null, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[][];
298
+ listLevels(node: N | null, nodeOrPropertyName?: 'val'): N['val'][][];
299
+ listLevels(node: N | null, nodeOrPropertyName?: 'node'): N[][];
300
+ listLevels(node: N | null, nodeOrPropertyName?: 'count'): number[][];
300
301
  /**
301
302
  * The function returns the predecessor of a given node in a binary tree.
302
303
  * @param node - The parameter `node` is a BinaryTreeNode object, representing a node in a binary tree.
303
304
  * @returns the predecessor of the given node in a binary tree.
304
305
  */
305
- getPredecessor(node: BinaryTreeNode<T>): BinaryTreeNode<T>;
306
+ getPredecessor(node: N): N;
306
307
  morris(): BinaryTreeNodeId[];
307
308
  morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
308
- morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): T[];
309
- morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): BinaryTreeNode<T>[];
309
+ morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'): N[];
310
+ morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'): N[];
310
311
  morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'count'): number[];
311
312
  protected _setLoopType(value: LoopType): void;
312
313
  protected _setVisitedId(value: BinaryTreeNodeId[]): void;
313
- protected _setVisitedVal(value: Array<T>): void;
314
- protected _setVisitedNode(value: BinaryTreeNode<T>[]): void;
314
+ protected _setVisitedVal(value: Array<N>): void;
315
+ protected _setVisitedNode(value: N[]): void;
315
316
  protected setVisitedCount(value: number[]): void;
316
317
  protected _setVisitedLeftSum(value: number[]): void;
317
318
  protected _setAutoIncrementId(value: boolean): void;
318
319
  protected _setMaxId(value: number): void;
319
320
  protected _setIsDuplicatedVal(value: boolean): void;
320
- protected _setRoot(v: BinaryTreeNode<T> | null): void;
321
+ protected _setRoot(v: N | null): void;
321
322
  protected _setSize(v: number): void;
322
323
  protected _setCount(v: number): void;
323
324
  /**
@@ -328,9 +329,9 @@ export declare class BinaryTree<T> {
328
329
  * The function checks if a given property of a binary tree node matches a specified value, and if so, adds the node to
329
330
  * a result array.
330
331
  * @param cur - The current binary tree node that is being checked.
331
- * @param {(BinaryTreeNode<T> | null | undefined)[]} result - An array that stores the matching nodes found during the
332
+ * @param {(N | null | undefined)[]} result - An array that stores the matching nodes found during the
332
333
  * traversal.
333
- * @param {BinaryTreeNodeId | T} nodeProperty - The `nodeProperty` parameter is the value that we are searching for in
334
+ * @param {BinaryTreeNodeId | N} nodeProperty - The `nodeProperty` parameter is the value that we are searching for in
334
335
  * the binary tree nodes. It can be either the `id`, `count`, or `val` property of the node.
335
336
  * @param {BinaryTreeNodePropertyName} [propertyName] - The `propertyName` parameter is an optional parameter that
336
337
  * specifies the property of the `BinaryTreeNode` object that you want to compare with the `nodeProperty` value. It can
@@ -340,16 +341,16 @@ export declare class BinaryTree<T> {
340
341
  * `true`, the function will stop after finding the first matching node and return `true`. If `onlyOne
341
342
  * @returns a boolean value indicating whether or not a node was pushed into the result array.
342
343
  */
343
- protected _pushByPropertyNameStopOrNot(cur: BinaryTreeNode<T>, result: (BinaryTreeNode<T> | null | undefined)[], nodeProperty: BinaryTreeNodeId | T, propertyName?: BinaryTreeNodePropertyName, onlyOne?: boolean): boolean | undefined;
344
+ protected _pushByPropertyNameStopOrNot(cur: N, result: (N | null | undefined)[], nodeProperty: BinaryTreeNodeId | N, propertyName?: BinaryTreeNodePropertyName, onlyOne?: boolean): boolean | undefined;
344
345
  /**
345
346
  * The function `_accumulatedByPropertyName` pushes a property value of a binary tree node into an array based on the
346
347
  * provided property name or a default property name.
347
- * @param node - The `node` parameter is of type `BinaryTreeNode<T>`, which represents a node in a binary tree.
348
+ * @param node - The `node` parameter is of type `N`, which represents a node in a binary tree.
348
349
  * @param {NodeOrPropertyName} [nodeOrPropertyName] - The parameter `nodeOrPropertyName` is an optional parameter that
349
350
  * can be either a string representing a property name or a reference to a node object. If it is a string, it specifies
350
351
  * the property name of the node that should be accumulated. If it is a node object, it specifies the node itself
351
352
  */
352
- protected _accumulatedByPropertyName(node: BinaryTreeNode<T>, nodeOrPropertyName?: NodeOrPropertyName): void;
353
+ protected _accumulatedByPropertyName(node: N, nodeOrPropertyName?: NodeOrPropertyName): void;
353
354
  /**
354
355
  * The function `_getResultByPropertyName` returns different results based on the provided property name or defaulting
355
356
  * to 'id'.
@@ -357,5 +358,5 @@ export declare class BinaryTree<T> {
357
358
  * can accept a value of type `NodeOrPropertyName`.
358
359
  * @returns The method returns an object of type `ResultsByProperty<T>`.
359
360
  */
360
- protected _getResultByPropertyName(nodeOrPropertyName?: NodeOrPropertyName): ResultsByProperty<T>;
361
+ protected _getResultByPropertyName(nodeOrPropertyName?: NodeOrPropertyName): ResultsByProperty<N>;
361
362
  }