File tree 1 file changed +3
-3
lines changed
src/test/java/com/thealgorithms/datastructures/trees 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class TreeNode {
14
14
}
15
15
}
16
16
17
- public class BinaryTreeSerializer {
17
+ public class SerializeaBinaryTree {
18
18
19
19
// The 'serialize' method converts a binary tree into a string.
20
20
public String serialize (TreeNode root ) {
@@ -116,8 +116,8 @@ public static void main(String[] args) {
116
116
root .right .left = new TreeNode (4 ); // Create the left child of node 3 (value 4)
117
117
root .right .right = new TreeNode (5 ); // Create the right child of node 3 (value 5)
118
118
119
- // Instantiate the BinaryTreeSerializer class
120
- BinaryTreeSerializer serializer = new BinaryTreeSerializer ();
119
+ // Instantiate the SerializeaBinaryTree class
120
+ SerializeaBinaryTree serializer = new SerializeaBinaryTree ();
121
121
122
122
// Serialize the tree to a string format
123
123
String serializedTree = serializer .serialize (root );
You can’t perform that action at this time.
0 commit comments