Answer:
The answer is "delete temp;".
Step-by-step explanation:
- In the given code a class "doublyLinkedList" is defined that contains a method that is destroy(). This code uses a scope resolution operator to define the method outside the class.
- To access this method write return type of function then class name:: (use scope resolution operator) and function name.
- In this function, nodeType temp is a pointer variable that is used to delete the node.
- In method definition, a loop is declared that check value that is first not equal to nullptr. which means the first node is not equal to null. In this loop, a temp variable holds the first variable value and the first variable value is holding another variable value and then use the "delete temp" statement to delete a node in the list.
- Outside a loop, the last variable holds nullptr variable value and the count variable assigns a value that is 0.