# Easy-题目5：237. Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.
Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.

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

4ms,beats 0.52% 众数4ms,99.48%
Cmershen的碎碎念：

• 本文已收录于以下专栏：

## LeetCode之路：237. Delete Node in a Linked List

LeetCode之路：237. Delete Node in a Linked List 一、引言这道题 哈哈哈 这是我做完了之后看到最高票答案的标题，顿时觉得有些滑稽：）那么接下来就让我们看看这...

## Delete Node in a Linked List（删除链表中的节点）

Write a function to delete a node (except the tail) in a singly linked list, given only access to th...

## 【LeetCode】 Delete Node in a Linked List

Delete Node in a Linked List  Total Accepted: 1872 Total Submissions: 3662 Write a...

## Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to th...

## LeetCode从零单排之零分段——Delete Node in a Linked List（删除链表中的元素）

• dt_yee
• 2015年07月15日 20:54
• 361

举报原因： 您举报文章：Easy-题目5：237. Delete Node in a Linked List 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)