Skip to content

Commit

Permalink
Add explaination for q_ascend and q_descend
Browse files Browse the repository at this point in the history
Add supllementary explainations for q_ascend and q_descend,
indicating the required memory operations that must be
implemented in these functions.
  • Loading branch information
backink committed Mar 10, 2024
1 parent b1fbeb7 commit d482ff0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
Expand Down

0 comments on commit d482ff0

Please sign in to comment.