mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-27 15:46:29 +08:00
build
This commit is contained in:
parent
7818cd9d31
commit
a8d26b3736
3 changed files with 4 additions and 3 deletions
|
@ -470,7 +470,7 @@ comments: true
|
||||||
|
|
||||||
/* 析构方法 */
|
/* 析构方法 */
|
||||||
~LinkedListDeque() {
|
~LinkedListDeque() {
|
||||||
// 释放内存
|
// 遍历链表删除结点,释放内存
|
||||||
DoublyListNode *pre, *cur = front;
|
DoublyListNode *pre, *cur = front;
|
||||||
while (cur != nullptr) {
|
while (cur != nullptr) {
|
||||||
pre = cur;
|
pre = cur;
|
||||||
|
|
|
@ -362,8 +362,8 @@ comments: true
|
||||||
}
|
}
|
||||||
|
|
||||||
~LinkedListQueue() {
|
~LinkedListQueue() {
|
||||||
delete front;
|
// 遍历链表删除结点,释放内存
|
||||||
delete rear;
|
freeMemoryLinkedList(front);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 获取队列的长度 */
|
/* 获取队列的长度 */
|
||||||
|
|
|
@ -353,6 +353,7 @@ comments: true
|
||||||
}
|
}
|
||||||
|
|
||||||
~LinkedListStack() {
|
~LinkedListStack() {
|
||||||
|
// 遍历链表删除结点,释放内存
|
||||||
freeMemoryLinkedList(stackTop);
|
freeMemoryLinkedList(stackTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue