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...
Sometimes known as a “logic bomb”, the __________ is the event or condition that determines when the payload is activated or delivered.
Fill in the blank(s) with the appropriate word(s).
Integration Services is the core service component of SQL Server 2012.
Answer the following statement true (T) or false (F)
Which type of software helps protect against viruses that are attached to e-mail?
A. Firewall software B. Antivirus software C. Windows Defender D. Hardware firewall
Describe each cost classification and include two examples.
What will be an ideal response?