Update linked_list.md (#935)

There is no need to declare next
This commit is contained in:
jiaxianhua 2023-11-11 19:53:55 +08:00 committed by GitHub
parent c81d5e091b
commit 1f71f6f701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,7 +152,7 @@
/* 构造函数 */
ListNode *newListNode(int val) {
ListNode *node, *next;
ListNode *node;
node = (ListNode *) malloc(sizeof(ListNode));
node->val = val;
node->next = NULL;
@ -618,7 +618,7 @@
/* 构造函数 */
ListNode *newListNode(int val) {
ListNode *node, *next;
ListNode *node;
node = (ListNode *) malloc(sizeof(ListNode));
node->val = val;
node->next = NULL;