tree delete( pq )
tree pq;
{
if ( pq == NULL ) Error /*** deletion on an empty queue ***/;
else if ( pq->left == NULL ) return( NULL );
else if ( pq->left->left == NULL ) {
pq->left = pq->right;
pq->right = NULL;
}
else pq->left = delete( pq->left );
return( pq );
};
|