write a java program to print your Introduction.
Answers
Answer:
❥ᴀ᭄ɴsᴡᴇʀ:⤵
public class BinaryTree {
Node root;
public static void main(String[] args) {
BinaryTree tree = new BinaryTree();
/* constructing an unbalanced tree which will look like this...
4
/ \
3 5
/ \
2 6
/ \
1 7
*/
tree.root = new Node(4);
tree.root.left = new Node(3);
tree.root.right = new Node(5);
tree.root.left.left = new Node(2);
tree.root.right.right = new Node(6);
tree.root.left.left.left = new Node(1);
tree.root.right.right.right = new Node(7);
public class BinaryTree {
Node root;
public static void main(String[] args) {
BinaryTree tree = new BinaryTree();
/* constructing an unbalanced tree which will look like this...
4
/ \
3 5
/ \
2 6
/ \
1 7
*/
tree.root = new Node(4);
tree.root.left = new Node(3);
tree.root.right = new Node(5);
tree.root.left.left = new Node(2);
tree.root.right.right = new Node(6);
tree.root.left.left.left = new Node(1);
tree.root.right.right.right = new Node(7);