Skip to content

Commit 7a02fb2

Browse files
Lin Chun Yehjserv
authored andcommitted
Clarify ascend/descend description
Add supllementary explainations for q_ascend and q_descend, indicating the required memory operations that must be implemented in these functions.
1 parent c44d8e2 commit 7a02fb2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

queue.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ void q_sort(struct list_head *head, bool descend);
207207
*
208208
* No effect if queue is NULL or empty. If there has only one element, do
209209
* nothing.
210+
* Memory allocated to removed nodes must be freed.
210211
*
211212
* Reference:
212213
* https://leetcode.com/problems/remove-nodes-from-linked-list/
@@ -222,6 +223,7 @@ int q_ascend(struct list_head *head);
222223
*
223224
* No effect if queue is NULL or empty. If there has only one element, do
224225
* nothing.
226+
* Memory allocated to removed nodes must be freed.
225227
*
226228
* Reference:
227229
* https://leetcode.com/problems/remove-nodes-from-linked-list/

scripts/checksums

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
186d420b53e21c6daf8eabe980a5b90780c53bcd queue.h
1+
db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h
22
3337dbccc33eceedda78e36cc118d5a374838ec7 list.h

0 commit comments

Comments
 (0)