deleteleaves ( )
Node * deleteLeaves ( Node * root , int x ) { if ( root == NULL ) return nullptr ; root -> left = deleteLeaves ( root -> left , x ) ; root -> right = deleteLeaves ( root -> right , x ) ; if ( root -> data == x && root -> left == NULL && root -> right == NULL ) { return nullptr ; } return root ; }