linked structures head prednode curnode (ahead (bfigure using second temporary reference to remove node from linked list(apositioning the second temporary reference variable prednodeand (bthe resulting list after removing from the linked list we now step through the code required for deleting node from singly linked listas illustrated in listing the curnode external reference is initially set to the first node in the listthe same as is done in the traversal and search operations the prednode external reference is set to none since there is no predecessor to the first node in the list loop is used to position the two temporary external reference variables as shown in lines - of listing as the curnode reference is moved along the list in the body of the loopthe prednode reference follows behind thusprednode must be assigned to reference the same node as curnode before advancing curnode to reference the next node after positioning the two external referencesthere are three possible conditions( the item is not in the list( the item is in the first nodeor ( the item is somewhere else in the list if the target is not in the listcurnode will be nullhaving been assigned none via the link field of the last node this condition is evaluated in line to determine if the target is in the first nodewe can simply compare curnode to head and determine if they reference the same node if they dowe set head to point to the next node in the listas shown in lines - pred node head figure modifications required to remove the first node of linked list