It has a node class containing this code
class Node {
String value;
Node left;
Node right;
Node(String value) {
this.value = value;
this.left = null;
this.right = null;
}
}
The tree structure is already been made according to the node and having
Node node = new Node();
here node represents the root of the tree.
I need to draw or print a tree without Gui, Jframe. Just to show in the output panel. Example like this
format of the tree
this tree like structure should be drawn according to node's left and right branches.
on call sketch(node);
the tree will print
Can u guys help me to create the sketch class which will print the tree.
public static void sketch(Node root) {
}
Really appreciate your help.