******** fig3.13 ********** /* Delete from a list. Cell pointed to by p->next is wiped out */ /* Assume that the position is legal. Assume use of a header node */ void delete( element_type x, LIST L ) { position p, tmp_cell; p = find_previous( x, L ); if( p->next != NULL ) /* Implicit assumption of header use */ { /* x is found: delete it */ tmp_cell = p->next; p->next = tmp_cell->next; /* bypass the cell to be deleted */ free( tmp_cell ); } }