Skip to content

Instantly share code, notes, and snippets.

View devansh1305's full-sized avatar
🔑
just sudo it!

Devansh Panirwala devansh1305

🔑
just sudo it!
View GitHub Profile
@TT-F
TT-F / gist:18c14ad59f1922c18cdc78d899dd3700
Created February 1, 2017 23:37
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;