Node structure
public class node { public int val ; public node left ; public node right ; public node ( ) { this . val = 0 ; this . left = null ; this . right = null ; } public node ( int x ) { this . val = x ; this . left = null ; this . right = null ; } public node ( int x , node left , node right ) { this . val = x ; this . left = left ; this . right = right ; } } ;