[Home]
[Contents]
[Chapter]
[Previous Algorithm]
[Next Algorithm]


P-tree deletion of maximum (Pascal version available)


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 ); };

C source (512.del.c) Pascal source (512.del.p)



© Addison-Wesley Publishing Co. Inc.