From a8d26b37363c9b20fa51f16a93cfd1af61a0fa08 Mon Sep 17 00:00:00 2001 From: krahets Date: Thu, 16 Mar 2023 18:20:52 +0800 Subject: [PATCH] build --- chapter_stack_and_queue/deque.md | 2 +- chapter_stack_and_queue/queue.md | 4 ++-- chapter_stack_and_queue/stack.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chapter_stack_and_queue/deque.md b/chapter_stack_and_queue/deque.md index e26d2160e..74438bf85 100644 --- a/chapter_stack_and_queue/deque.md +++ b/chapter_stack_and_queue/deque.md @@ -470,7 +470,7 @@ comments: true /* 析构方法 */ ~LinkedListDeque() { - // 释放内存 + // 遍历链表删除结点,释放内存 DoublyListNode *pre, *cur = front; while (cur != nullptr) { pre = cur; diff --git a/chapter_stack_and_queue/queue.md b/chapter_stack_and_queue/queue.md index b06eef8e2..7f09f6508 100755 --- a/chapter_stack_and_queue/queue.md +++ b/chapter_stack_and_queue/queue.md @@ -362,8 +362,8 @@ comments: true } ~LinkedListQueue() { - delete front; - delete rear; + // 遍历链表删除结点,释放内存 + freeMemoryLinkedList(front); } /* 获取队列的长度 */ diff --git a/chapter_stack_and_queue/stack.md b/chapter_stack_and_queue/stack.md index 346ceb3ec..b18d58726 100755 --- a/chapter_stack_and_queue/stack.md +++ b/chapter_stack_and_queue/stack.md @@ -353,6 +353,7 @@ comments: true } ~LinkedListStack() { + // 遍历链表删除结点,释放内存 freeMemoryLinkedList(stackTop); }