Solved

Consider the Following Code,which Deletes All the Nodes in a Linked

Question 3

Multiple Choice

Consider the following code,which deletes all the nodes in a linked list. void doublyLinkedList<Type>::destroy()
{
\quad NodeType<Type> *temp; //pointer to delete the node
\quad While (first != NULL)
\quad {
\quad\quad Temp = first;
\quad\quad First = first->next;
\quad\quad ____
\quad }
\quad Last = NULL;
\quad Count = 0;
}
Which of the following is the missing statement?


A) delete first;
B) delete temp;
C) destroy temp;
D) clear temp;

Correct Answer:

verifed

Verified

Related Questions