Revise the method clearso that it calls a recursive method to deallocatethe nodes in the chain.
What will be an ideal response?
```
template
void LinkedBag
{
deallocate(headPtr);
headPtr = nullptr;
itemCount = 0;
} // end clear
// Private method: Deallocates all nodes assigned to the bag.
template
voidLinkedBag
{
if (nextNodePtr != nullptr)
{
Node
nextNodePtr = nextNodePtr->getNext();
delete nodeToDeletePtr;
deallocate(nextNodePtr);
} // end if
} // end deallocate
```
You might also like to view...
Which of the following would be sent to an SNMP network management system in the event that a failure or predefined threshold was crossed?
A. SNMP trap B. History log C. System log D. SNMP agent
When working with layers, it is important to make sure you know which layer you are editing by looking at the active layer on the Layers panel.
Answer the following statement true (T) or false (F)