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.
- package/README.md +193 -66
- package/backup/recursive-type/src/assets/complexities-diff.jpg +0 -0
- package/backup/recursive-type/src/assets/data-structure-complexities.jpg +0 -0
- package/backup/recursive-type/src/assets/logo.png +0 -0
- package/backup/recursive-type/src/assets/overview-diagram-of-data-structures.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/aa-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/avl-tree.ts +288 -0
- package/backup/recursive-type/src/data-structures/binary-tree/b-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-indexed-tree.ts +78 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-tree.ts +1502 -0
- package/backup/recursive-type/src/data-structures/binary-tree/bst.ts +503 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/bst-rotation.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/segment-tree.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/index.ts +11 -0
- package/backup/recursive-type/src/data-structures/binary-tree/rb-tree.ts +110 -0
- package/backup/recursive-type/src/data-structures/binary-tree/segment-tree.ts +243 -0
- package/backup/recursive-type/src/data-structures/binary-tree/splay-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/tree-multiset.ts +55 -0
- package/backup/recursive-type/src/data-structures/binary-tree/two-three-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/diagrams/README.md +5 -0
- package/backup/recursive-type/src/data-structures/graph/abstract-graph.ts +985 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/mst.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-articulation-point-bridge.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-complicate-simple.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-strongly-connected-component.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.mp4 +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.webp +0 -0
- package/backup/recursive-type/src/data-structures/graph/directed-graph.ts +478 -0
- package/backup/recursive-type/src/data-structures/graph/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/graph/undirected-graph.ts +293 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-map.ts +67 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-set.ts +56 -0
- package/backup/recursive-type/src/data-structures/hash/hash-table.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/index.ts +6 -0
- package/backup/recursive-type/src/data-structures/hash/pair.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-map.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-set.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/heap.ts +176 -0
- package/backup/recursive-type/src/data-structures/heap/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/max-heap.ts +31 -0
- package/backup/recursive-type/src/data-structures/heap/min-heap.ts +34 -0
- package/backup/recursive-type/src/data-structures/index.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/abstract-graph.ts +42 -0
- package/backup/recursive-type/src/data-structures/interfaces/avl-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/binary-tree.ts +56 -0
- package/backup/recursive-type/src/data-structures/interfaces/bst.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/directed-graph.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/heap.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/index.ts +13 -0
- package/backup/recursive-type/src/data-structures/interfaces/navigator.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/priority-queue.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/undirected-graph.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/doubly-linked-list.ts +573 -0
- package/backup/recursive-type/src/data-structures/linked-list/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/singly-linked-list.ts +490 -0
- package/backup/recursive-type/src/data-structures/linked-list/skip-linked-list.ts +3 -0
- package/backup/recursive-type/src/data-structures/matrix/index.ts +4 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix.ts +27 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix2d.ts +208 -0
- package/backup/recursive-type/src/data-structures/matrix/navigator.ts +122 -0
- package/backup/recursive-type/src/data-structures/matrix/vector2d.ts +316 -0
- package/backup/recursive-type/src/data-structures/priority-queue/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/priority-queue/max-priority-queue.ts +49 -0
- package/backup/recursive-type/src/data-structures/priority-queue/min-priority-queue.ts +50 -0
- package/backup/recursive-type/src/data-structures/priority-queue/priority-queue.ts +354 -0
- package/backup/recursive-type/src/data-structures/queue/deque.ts +251 -0
- package/backup/recursive-type/src/data-structures/queue/index.ts +2 -0
- package/backup/recursive-type/src/data-structures/queue/queue.ts +120 -0
- package/backup/recursive-type/src/data-structures/stack/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/stack/stack.ts +98 -0
- package/backup/recursive-type/src/data-structures/tree/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/tree/tree.ts +80 -0
- package/backup/recursive-type/src/data-structures/trie/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/trie/trie.ts +227 -0
- package/backup/recursive-type/src/data-structures/types/abstract-graph.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/avl-tree.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/binary-tree.ts +10 -0
- package/backup/recursive-type/src/data-structures/types/bst.ts +6 -0
- package/backup/recursive-type/src/data-structures/types/directed-graph.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/heap.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/index.ts +12 -0
- package/backup/recursive-type/src/data-structures/types/navigator.ts +13 -0
- package/backup/recursive-type/src/data-structures/types/priority-queue.ts +9 -0
- package/backup/recursive-type/src/data-structures/types/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/index.ts +1 -0
- package/backup/recursive-type/src/utils/index.ts +2 -0
- package/backup/recursive-type/src/utils/types/index.ts +1 -0
- package/backup/recursive-type/src/utils/types/utils.ts +6 -0
- package/backup/recursive-type/src/utils/utils.ts +78 -0
- package/dist/data-structures/binary-tree/avl-tree.d.ts +19 -25
- package/dist/data-structures/binary-tree/avl-tree.js +8 -16
- package/dist/data-structures/binary-tree/binary-tree.d.ts +99 -98
- package/dist/data-structures/binary-tree/binary-tree.js +70 -65
- package/dist/data-structures/binary-tree/bst.d.ts +21 -21
- package/dist/data-structures/binary-tree/bst.js +15 -17
- package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -2
- package/dist/data-structures/binary-tree/rb-tree.js +68 -5
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +9 -8
- package/dist/data-structures/binary-tree/tree-multiset.js +7 -6
- package/dist/data-structures/graph/abstract-graph.d.ts +56 -58
- package/dist/data-structures/graph/abstract-graph.js +84 -68
- package/dist/data-structures/graph/directed-graph.d.ts +127 -96
- package/dist/data-structures/graph/directed-graph.js +161 -109
- package/dist/data-structures/graph/undirected-graph.d.ts +82 -59
- package/dist/data-structures/graph/undirected-graph.js +99 -72
- package/dist/data-structures/hash/coordinate-set.d.ts +1 -1
- package/dist/data-structures/index.d.ts +1 -0
- package/dist/data-structures/index.js +1 -0
- package/dist/data-structures/interfaces/abstract-graph.d.ts +22 -0
- package/dist/data-structures/interfaces/abstract-graph.js +2 -0
- package/dist/data-structures/interfaces/avl-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/avl-tree.js +2 -0
- package/dist/data-structures/interfaces/binary-tree.d.ts +27 -0
- package/dist/data-structures/interfaces/binary-tree.js +2 -0
- package/dist/data-structures/interfaces/bst.d.ts +1 -0
- package/dist/data-structures/interfaces/bst.js +2 -0
- package/dist/data-structures/interfaces/directed-graph.d.ts +9 -0
- package/dist/data-structures/interfaces/directed-graph.js +2 -0
- package/dist/data-structures/interfaces/doubly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/doubly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/heap.d.ts +1 -0
- package/dist/data-structures/interfaces/heap.js +2 -0
- package/dist/data-structures/interfaces/index.d.ts +13 -0
- package/dist/data-structures/interfaces/index.js +29 -0
- package/dist/data-structures/interfaces/navigator.d.ts +1 -0
- package/dist/data-structures/interfaces/navigator.js +2 -0
- package/dist/data-structures/interfaces/priority-queue.d.ts +1 -0
- package/dist/data-structures/interfaces/priority-queue.js +2 -0
- package/dist/data-structures/interfaces/segment-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/segment-tree.js +2 -0
- package/dist/data-structures/interfaces/singly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/singly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/tree-multiset.d.ts +1 -0
- package/dist/data-structures/interfaces/tree-multiset.js +2 -0
- package/dist/data-structures/interfaces/undirected-graph.d.ts +2 -0
- package/dist/data-structures/interfaces/undirected-graph.js +2 -0
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +4 -4
- package/dist/data-structures/queue/deque.d.ts +5 -5
- package/dist/data-structures/queue/deque.js +6 -6
- package/dist/data-structures/queue/queue.d.ts +1 -1
- package/dist/data-structures/stack/stack.d.ts +1 -1
- package/dist/data-structures/types/abstract-graph.d.ts +1 -20
- package/dist/data-structures/types/avl-tree.d.ts +5 -4
- package/dist/data-structures/types/binary-tree.d.ts +6 -5
- package/dist/data-structures/types/bst.d.ts +4 -3
- package/dist/data-structures/types/directed-graph.d.ts +5 -9
- package/dist/data-structures/types/directed-graph.js +7 -0
- package/dist/data-structures/types/heap.d.ts +2 -2
- package/dist/data-structures/types/index.d.ts +0 -1
- package/dist/data-structures/types/index.js +0 -1
- package/dist/data-structures/types/navigator.d.ts +2 -2
- package/dist/data-structures/types/priority-queue.d.ts +2 -2
- package/dist/data-structures/types/tree-multiset.d.ts +3 -4
- package/docs/assets/search.js +1 -1
- package/docs/classes/AVLTree.html +288 -287
- package/docs/classes/AVLTreeNode.html +106 -63
- package/docs/classes/AaTree.html +14 -12
- package/docs/classes/AbstractEdge.html +68 -34
- package/docs/classes/AbstractGraph.html +219 -114
- package/docs/classes/AbstractVertex.html +71 -30
- package/docs/classes/ArrayDeque.html +27 -25
- package/docs/classes/BST.html +279 -273
- package/docs/classes/BSTNode.html +106 -57
- package/docs/classes/BTree.html +14 -12
- package/docs/classes/BinaryIndexedTree.html +22 -20
- package/docs/classes/BinaryTree.html +283 -277
- package/docs/classes/BinaryTreeNode.html +111 -63
- package/docs/classes/Character.html +17 -15
- package/docs/classes/CoordinateMap.html +22 -20
- package/docs/classes/CoordinateSet.html +23 -21
- package/docs/classes/Deque.html +47 -45
- package/docs/classes/DirectedEdge.html +74 -41
- package/docs/classes/DirectedGraph.html +444 -208
- package/docs/classes/DirectedVertex.html +63 -36
- package/docs/classes/DoublyLinkedList.html +52 -50
- package/docs/classes/DoublyLinkedListNode.html +24 -22
- package/docs/classes/HashTable.html +14 -12
- package/docs/classes/Heap.html +29 -27
- package/docs/classes/HeapItem.html +21 -19
- package/docs/classes/Matrix2D.html +29 -27
- package/docs/classes/MatrixNTI2D.html +17 -15
- package/docs/classes/MaxHeap.html +29 -27
- package/docs/classes/MaxPriorityQueue.html +67 -60
- package/docs/classes/MinHeap.html +29 -27
- package/docs/classes/MinPriorityQueue.html +67 -60
- package/docs/classes/Navigator.html +24 -22
- package/docs/classes/ObjectDeque.html +62 -50
- package/docs/classes/Pair.html +14 -12
- package/docs/classes/PriorityQueue.html +62 -55
- package/docs/classes/Queue.html +29 -27
- package/docs/classes/SegmentTree.html +30 -28
- package/docs/classes/SegmentTreeNode.html +33 -31
- package/docs/classes/SinglyLinkedList.html +49 -47
- package/docs/classes/SinglyLinkedListNode.html +21 -19
- package/docs/classes/SkipLinkedList.html +14 -12
- package/docs/classes/SplayTree.html +14 -12
- package/docs/classes/Stack.html +27 -25
- package/docs/classes/TreeMap.html +14 -12
- package/docs/classes/TreeMultiSet.html +277 -270
- package/docs/classes/TreeNode.html +29 -27
- package/docs/classes/TreeSet.html +14 -12
- package/docs/classes/Trie.html +26 -24
- package/docs/classes/TrieNode.html +24 -22
- package/docs/classes/TwoThreeTree.html +14 -12
- package/docs/classes/UndirectedEdge.html +70 -51
- package/docs/classes/UndirectedGraph.html +344 -161
- package/docs/classes/UndirectedVertex.html +63 -36
- package/docs/classes/Vector2D.html +41 -39
- package/docs/enums/CP.html +17 -15
- package/docs/enums/FamilyPosition.html +17 -15
- package/docs/enums/LoopType.html +16 -14
- package/docs/{interfaces/AVLTreeDeleted.html → enums/TopologicalProperty.html} +43 -43
- package/docs/index.html +195 -68
- package/docs/interfaces/{HeapOptions.html → IBinaryTree.html} +39 -32
- package/docs/interfaces/IBinaryTreeNode.html +383 -0
- package/docs/interfaces/IDirectedGraph.html +20 -18
- package/docs/interfaces/IGraph.html +118 -88
- package/docs/interfaces/{PriorityQueueOptions.html → IUNDirectedGraph.html} +22 -53
- package/docs/modules.html +25 -21
- package/docs/types/{ToThunkFn.html → AVLTreeDeleted.html} +27 -21
- package/docs/types/BSTComparator.html +14 -12
- package/docs/types/BSTDeletedResult.html +19 -17
- package/docs/types/BinaryTreeDeleted.html +19 -17
- package/docs/types/BinaryTreeNodeId.html +14 -12
- package/docs/types/BinaryTreeNodePropertyName.html +14 -12
- package/docs/types/DFSOrderPattern.html +14 -12
- package/docs/types/DijkstraResult.html +14 -12
- package/docs/types/Direction.html +14 -12
- package/docs/types/{TrlFn.html → EdgeId.html} +18 -29
- package/docs/types/{TrlAsyncFn.html → HeapOptions.html} +29 -19
- package/docs/types/NavigatorParams.html +164 -0
- package/docs/types/NodeOrPropertyName.html +14 -12
- package/docs/types/PriorityQueueComparator.html +14 -12
- package/docs/types/PriorityQueueDFSOrderPattern.html +14 -12
- package/docs/types/{SpecifyOptional.html → PriorityQueueOptions.html} +28 -19
- package/docs/types/RecursiveAVLTreeNode.html +135 -0
- package/docs/types/{Thunk.html → RecursiveBSTNode.html} +23 -24
- package/docs/types/RecursiveBinaryTreeNode.html +135 -0
- package/docs/types/ResultByProperty.html +17 -15
- package/docs/types/ResultsByProperty.html +17 -15
- package/docs/types/SegmentTreeNodeVal.html +14 -12
- package/docs/types/TopologicalStatus.html +14 -12
- package/docs/types/TreeMultiSetDeletedResult.html +19 -17
- package/docs/types/Turning.html +14 -12
- package/docs/types/VertexId.html +14 -12
- package/notes/note.md +8 -1
- package/package.json +10 -2
- package/docs/classes/RBTree.html +0 -153
- 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():
|
|
34
|
-
set left(v:
|
|
34
|
+
get left(): FAMILY | null | undefined;
|
|
35
|
+
set left(v: FAMILY | null | undefined);
|
|
35
36
|
private _right?;
|
|
36
|
-
get right():
|
|
37
|
-
set right(v:
|
|
37
|
+
get right(): FAMILY | null | undefined;
|
|
38
|
+
set right(v: FAMILY | null | undefined);
|
|
38
39
|
private _parent;
|
|
39
|
-
get parent():
|
|
40
|
-
set parent(v:
|
|
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
|
-
|
|
51
|
-
|
|
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<
|
|
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<
|
|
71
|
+
get visitedVal(): Array<N['val']>;
|
|
70
72
|
private _visitedNode;
|
|
71
|
-
get visitedNode():
|
|
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():
|
|
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
|
|
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
|
|
93
|
-
* @param {
|
|
94
|
-
*
|
|
95
|
-
* @param {number} [count] - The count parameter is an optional parameter
|
|
96
|
-
* the value in the binary tree node.
|
|
97
|
-
* @returns
|
|
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
|
-
|
|
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 {
|
|
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 `
|
|
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:
|
|
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 {
|
|
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:
|
|
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 {
|
|
135
|
-
* array of `
|
|
136
|
-
* @returns The function `addMany` returns an array of `
|
|
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:
|
|
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 {
|
|
143
|
-
* array of `
|
|
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:
|
|
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<
|
|
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 -
|
|
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:
|
|
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 {
|
|
170
|
-
* `
|
|
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?:
|
|
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 {
|
|
179
|
-
* `
|
|
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?:
|
|
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 {
|
|
187
|
-
* of type `
|
|
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?:
|
|
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 |
|
|
195
|
-
* generic type `
|
|
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 `
|
|
202
|
+
* @returns The function `getNodes` returns an array of `N | null | undefined` objects.
|
|
202
203
|
*/
|
|
203
|
-
getNodes(nodeProperty: BinaryTreeNodeId |
|
|
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 |
|
|
208
|
-
* generic type `
|
|
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 |
|
|
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 |
|
|
218
|
-
* generic type `
|
|
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 |
|
|
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 `
|
|
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:
|
|
232
|
-
getLeftMost():
|
|
233
|
-
getLeftMost(node:
|
|
234
|
-
getRightMost():
|
|
235
|
-
getRightMost(node:
|
|
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 {
|
|
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?:
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
275
|
+
subTreeAdd(subTreeRoot: N, delta: number, propertyName?: BinaryTreeNodePropertyName): boolean;
|
|
275
276
|
BFS(): BinaryTreeNodeId[];
|
|
276
277
|
BFS(nodeOrPropertyName: 'id'): BinaryTreeNodeId[];
|
|
277
|
-
BFS(nodeOrPropertyName: 'val'):
|
|
278
|
-
BFS(nodeOrPropertyName: 'node'):
|
|
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'):
|
|
283
|
-
DFS(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'):
|
|
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'):
|
|
288
|
-
DFSIterative(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'):
|
|
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:
|
|
291
|
-
levelIterative(node:
|
|
292
|
-
levelIterative(node:
|
|
293
|
-
levelIterative(node:
|
|
294
|
-
levelIterative(node:
|
|
295
|
-
listLevels(node:
|
|
296
|
-
listLevels(node:
|
|
297
|
-
listLevels(node:
|
|
298
|
-
listLevels(node:
|
|
299
|
-
listLevels(node:
|
|
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:
|
|
306
|
+
getPredecessor(node: N): N;
|
|
306
307
|
morris(): BinaryTreeNodeId[];
|
|
307
308
|
morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'id'): BinaryTreeNodeId[];
|
|
308
|
-
morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'val'):
|
|
309
|
-
morris(pattern?: DFSOrderPattern, nodeOrPropertyName?: 'node'):
|
|
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<
|
|
314
|
-
protected _setVisitedNode(value:
|
|
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:
|
|
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 {(
|
|
332
|
+
* @param {(N | null | undefined)[]} result - An array that stores the matching nodes found during the
|
|
332
333
|
* traversal.
|
|
333
|
-
* @param {BinaryTreeNodeId |
|
|
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:
|
|
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 `
|
|
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:
|
|
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<
|
|
361
|
+
protected _getResultByPropertyName(nodeOrPropertyName?: NodeOrPropertyName): ResultsByProperty<N>;
|
|
361
362
|
}
|