Skip to content

Commit 14615d5

Browse files
authored
Final Update SerializeaBinaryTree.java
1 parent 2fbb2f3 commit 14615d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/java/com/thealgorithms/datastructures/trees/SerializeaBinaryTree.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
// Define the TreeNode class to represent nodes in the binary tree.
55
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
99

1010
// Constructor to create a new node with a given value
1111
TreeNode(int val) {
@@ -91,7 +91,7 @@ public TreeNode deserialize(String data) {
9191
// Add the left child to the queue for further processing.
9292
queue.add(node.left);
9393
}
94-
index++; // Move to the next value in the array.
94+
index++; // Move to the next value in the array.
9595

9696
// Rebuild the right child.
9797
if (!nodes[index].equals("null")) {
@@ -100,7 +100,7 @@ public TreeNode deserialize(String data) {
100100
// Add the right child to the queue for further processing.
101101
queue.add(node.right);
102102
}
103-
index++; // Move to the next value in the array.
103+
index++; // Move to the next value in the array.
104104
}
105105

106106
// Return the root of the reconstructed tree.

0 commit comments

Comments
 (0)