Bootstrap

C语言 | Leetcode C语言题解之第237题删除链表中的节点

题目:

题解:

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */

void deleteNode(struct ListNode* node) {
    struct ListNode * p = node->next;
    int temp;
    temp = node->val;
    node->val = p->val;
    p->val = temp;
    node->next = p->next;
}
;