diff --git a/queue.h b/queue.h index bbea8ec4d..df3733c6b 100644 --- a/queue.h +++ b/queue.h @@ -207,6 +207,8 @@ void q_sort(struct list_head *head, bool descend); * * No effect if queue is NULL or empty. If there has only one element, do * nothing. + * The memory allocated to nodes that are removed must be freed after their + * removal. * * Reference: * https://leetcode.com/problems/remove-nodes-from-linked-list/ @@ -222,6 +224,8 @@ int q_ascend(struct list_head *head); * * No effect if queue is NULL or empty. If there has only one element, do * nothing. + * The memory allocated to nodes that are removed must be freed after their + * removal. * * Reference: * https://leetcode.com/problems/remove-nodes-from-linked-list/