Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename Type>
- Linked_stack<Type>::~Linked_stack() {
- Double_node<Type *> *ptr = list.head();
- //iterates through each node and destroys them
- while(ptr != list.tail()){
- Double_node<Type *> *del = ptr;
- ptr = ptr->next();
- delete[] del->retrieve();
- }
- delete[] list.tail();
- }
- --------------------------------------------------------
- template <typename Type>
- Double_sentinel_list<Type>::~Double_sentinel_list() {
- Double_node<Type> *ptr = head();
- //iterates through each node and destroys them
- while(ptr != nullptr){
- Double_node<Type> *del = ptr;
- ptr = ptr->next();
- delete del;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement