WHILE "head" is not NULL DO { copy "head" to "temp" ; make "head" equal to the "next" field of the node that head currently points to ; call "delete" to free the node that "temp" points to. }
void function listClass::SeekKey (keyType theKey, bool& Success, ptrType& prev, ptrType& cur) init prev to NULL and cur to head; WHILE ((cur is not NULL) AND (the key of the current node is less than theKey)) DO { change the value of prev to cur; change the value of cur to the "next" field of the node that cur now points to. } IF cur is NULL now then set Success to false; ELSE IF cur now points to a node matching theKey set Success to true ELSE set Success to false