A:\minispir.GIFA:\minispir.GIF
‹#›
23
Destructors
•For a linked list, the purpose of the destructor is to deallocate all memory
•This requires traversing through the linked data structure, deallocating all items
•Will this do it?
• delete head;
•Of course not. This will deallocate one node unless the “node” has a destructor of its own...
•