Revise the program in Listing 4-4 so that it tests first the link-based implementationand then the array-based implementation. Ensure that the program does not have amemory leak.
What will be an ideal response?
```
int main()
{
BagInterface
std::cout << "Testing the Link-Based Bag:" <
delete bagPtr;
std::cout <
std::cout << "Testing the Array-Based Bag:" <
delete bagPtr;
bagPtr = nullptr;
std::cout << "All done!" << std::endl;
return 0;
} // end main
```
You might also like to view...
If a document is changed after the table of contents was created, then the table of contents needs to be updated
Indicate whether the statement is true or false
The ________ button will remove all items from the Office Clipboard
A) Clear All B) Remove All C) Close D) Cut