advantage of using sentinels although we could implement doubly linked list without sentinel nodes (as we did with our singly linked list in section )the slight extra space devoted to the sentinels greatly simplifies the logic of our operations most notablythe header and trailer nodes never change--only the nodes between them change furthermorewe can treat all insertions in unified mannerbecause new node will always be placed between pair of existing nodes in similar fashionevery element that is to be deleted is guaranteed to be stored in node that has neighbors on each side for contrastlook back at our linkedqueue implementation from section its enqueue methodgiven in code fragment adds new node to the end of the list howeverits implementation required conditional to manage the special case of inserting into an empty list in the general casethe new node was linked after the existing tail but when adding to an empty listthere is no existing tailinstead it is necessary to reassign self head to reference the new node the use of sentinel node in that implementation would eliminate the special caseas there would always be an existing node (possibly the headerbefore new node inserting and deleting with doubly linked list every insertion into our doubly linked list representation will take place between pair of existing nodesas diagrammed in figure for examplewhen new element is inserted at the front of the sequencewe will simply add the new node between the header and the node that is currently after the header (see figure header trailer bwi jfk sfo (aheader trailer bwi jfk pvd sfo pvd sfo (bheader trailer bwi jfk (cfigure adding an element to doubly linked list with header and trailer sentinels(abefore the operation(bafter creating the new node(cafter linking the neighbors to the new node