Question: Given the algorithm for deleting nodes from an ordered double linked list (or a portion of the algorithm) in real code, be able to fill

 Given the algorithm for deleting nodes from an ordered double linked

Given the algorithm for deleting nodes from an ordered double linked list (or a portion of the algorithm) in real code, be able to fill in the blanks. List Node *MyDoubleLinkedList::Delete (int Key) { //Assume ListNode is a structure and contains the variable int key; // and ListNode *prev, *next; //Assume the function returns a pointer to the node if it successfully removes the node // or NULL if the node was not found ListNode *temp = head; //Search for node to delete while ((___________) && (___________)) { _____________; //Advance to next node if (________________) //Check for node to delete not found return Null; else if (______________) //Check for deleting head of the list { _____________; //Remove the head of the list if(head ! = NULL) //Make sure head is not now NULL _______________; Set head's prev pointer return temp;// Return the node removed } else //Delete node elsewhere in the list { __________________; //Move pointer of node before temp if(temp rightarrow next ! = NULL) ______________; return temp; } return NULL; //This line will never be reached but it keeps the compiler from complaining

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!