Skip to content

Commit 74153ff

Browse files
committed
Clarify q_ascend and q_descend descriptions
As q_ascend and q_descend require freeing the removed node, clarify these function descriptions by replacing "remove" with "delete". Remove redundant words after replacement. Change-Id: Ic2e20c6188d91da5f7a64decf86621ef80cf1ab4
1 parent 29d90ea commit 74153ff

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

queue.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,12 @@ void q_reverseK(struct list_head *head, int k);
201201
void q_sort(struct list_head *head, bool descend);
202202

203203
/**
204-
* q_ascend() - Remove every node which has a node with a strictly less
204+
* q_ascend() - Delete every node which has a node with a strictly less
205205
* value anywhere to the right side of it.
206206
* @head: header of queue
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.
211210
*
212211
* Reference:
213212
* https://leetcode.com/problems/remove-nodes-from-linked-list/
@@ -217,13 +216,12 @@ void q_sort(struct list_head *head, bool descend);
217216
int q_ascend(struct list_head *head);
218217

219218
/**
220-
* q_descend() - Remove every node which has a node with a strictly greater
219+
* q_descend() - Delete every node which has a node with a strictly greater
221220
* value anywhere to the right side of it.
222221
* @head: header of queue
223222
*
224223
* No effect if queue is NULL or empty. If there has only one element, do
225224
* nothing.
226-
* Memory allocated to removed nodes must be freed.
227225
*
228226
* Reference:
229227
* 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,3 +1,3 @@
1-
398b59c23f699ff1bf1e73a94503a9a91caa9207 queue.h
1+
bff0704601c8197ae6b847647b4167664b7d6abc queue.h
22
5179cf8f5aafbc6cb8e8d7b898ef3798cfe85613 list.h
33
1029c2784b4cae3909190c64f53a06cba12ea38e scripts/check-commitlog.sh

0 commit comments

Comments
 (0)