Update doubly_linked_list.cpp

when remove an item , should free the item memory
This commit is contained in:
liushubin-gitHub
2020-05-27 10:03:54 +08:00
committed by GitHub
parent 6b55d4472f
commit 030348a284

View File

@@ -61,6 +61,7 @@ void double_linked_list::remove(int x) {
t->prev->next = t->next;
t->next->prev = t->prev;
}
delete t;
}
void double_linked_list::search(int x) {