Constructing a Binary tree in Java [closed]
I am constructing a binary tree. Let me know if this is a right way to do it. If not please tell me how to?? I could not find a proper link where constructing a general binary tree has been coded. Everywhere BST is coded. 3 / \ 1 4 / \ 2 5 This is the binary tree which i want to make.I should be able to do all the tree traversals.Simple stuff. public class Binarytreenode { public Binarytreenode left; public Binarytreenode right; public int data; public Binarytreenode(int data) { this.data=data; } public void printNode() { System.out.println(data); } public static void main(String ar[]) {