Question: need help for toString method public class BinaryTree { //Implements a Binary Tree of Strings private class Node { private Node left; private String data;
need help for toString method
public class BinaryTree {
//Implements a Binary Tree of Strings
private class Node {
private Node left;
private String data;
private Node right;
private Node parent; // reference to the parent node
// the parent is null for the root node
private Node(Node L, String d, Node r, Node p) {
left = L;
data = d;
right = r;
parent = p;
}
}
private Node root;
public BinaryTree() {
// create an empty tree
root = null;
}
public String toString() {
// returns the string representation of the tree using the in order format
// If the tree was created from a string use the
// the values of open, close and empty given to the constructor otherwise
// use (, ) and ! for open, close and empty respectively
// most of the work should be done in a recursive private method.
}

Tree tvn Sthig Rappesetoarem Tree tvn Sthig Rappesetoarem
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
