Created
February 1, 2017 23:37
-
-
Save TT-F/18c14ad59f1922c18cdc78d899dd3700 to your computer and use it in GitHub Desktop.
Destructor for doubly linked list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sequence::~Sequence() | |
{ | |
while (head->m_next != head) | |
{ | |
Node* p = head->m_next; | |
p->m_next->m_prev = head; | |
head->m_next = p->m_next; | |
delete p; | |
} | |
delete head; | |
} |
oks.
tk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks!