Position the pointer discard so that it points to the node to be deleted, and position the pointer before so that it points to the node before the one to be deleted.
before->link = discard->link;
In a flow diagram, an arrow points from a box at left labeled “head” to the top box of a column of five two-tiered boxes at right. The numbers in the top tiers of these boxes are 2, 1, 6, 3, and 5 from top to bottom; an arrow points from the bottom tier of each box to the box below, except the bottom tier of the last box contains the text “NULL”. The arrow from the bottom tier of the “6” box to the “3” box is broken; another arrow points from here to the bottom box, bypassing the “3” box. An arrow points from a box at left labeled “before” to the “6” box to its right, and an arrow points from a box at left labeled “discard” to the “3” box to its right.
delete discard;
The same diagram as in (2) is shown, except the “3” box has been removed and a dashed enclosure labeled “Recycled” replaces it.