Utility method to create a new node
static Node newNode ( int x ) { Node temp = new Node ( ) ; temp . data = x ; temp . left = null ; temp . right = null ; return temp ; } static bool isLeaf ( Node t ) { return ( ( t . left == null ) && ( t . right == null ) ) ; }