File tree 1 file changed +5
-5
lines changed
src/test/java/com/thealgorithms/datastructures/trees 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 3
3
4
4
// Define the TreeNode class to represent nodes in the binary tree.
5
5
class TreeNode {
6
- int val ;// Value stored in the node
7
- TreeNode left ;// Pointer to the left child
8
- TreeNode right ;// Pointer to the right child
6
+ int val ; // Value stored in the node
7
+ TreeNode left ; // Pointer to the left child
8
+ TreeNode right ; // Pointer to the right child
9
9
10
10
// Constructor to create a new node with a given value
11
11
TreeNode (int val ) {
@@ -91,7 +91,7 @@ public TreeNode deserialize(String data) {
91
91
// Add the left child to the queue for further processing.
92
92
queue .add (node .left );
93
93
}
94
- index ++; // Move to the next value in the array.
94
+ index ++; // Move to the next value in the array.
95
95
96
96
// Rebuild the right child.
97
97
if (!nodes [index ].equals ("null" )) {
@@ -100,7 +100,7 @@ public TreeNode deserialize(String data) {
100
100
// Add the right child to the queue for further processing.
101
101
queue .add (node .right );
102
102
}
103
- index ++; // Move to the next value in the array.
103
+ index ++; // Move to the next value in the array.
104
104
}
105
105
106
106
// Return the root of the reconstructed tree.
You can’t perform that action at this time.
0 commit comments