A utility function to check if a given node is leaf or not
bool isLeaf ( Node * node ) { if ( node == NULL ) return false ; if ( node -> left == NULL && node -> right == NULL ) return true ; return false ; }