Skip to content

Instantly share code, notes, and snippets.

@TT-F
Created February 1, 2017 23:37
Show Gist options
  • Save TT-F/18c14ad59f1922c18cdc78d899dd3700 to your computer and use it in GitHub Desktop.
Save TT-F/18c14ad59f1922c18cdc78d899dd3700 to your computer and use it in GitHub Desktop.
Destructor for doubly linked list
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;
}
@ryan-k8
Copy link

ryan-k8 commented Oct 19, 2022

thanks!

@kabeerali1825
Copy link

oks.

@judgementbutcher
Copy link

tk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment