class Solution {
public:
void deleteNode(ListNode* node) {
node -> val = node -> next -> val;
node -> next = node -> next -> next;
}
};
删除链表中的节点
最新推荐文章于 2022-08-20 22:39:03 发布
class Solution {
public:
void deleteNode(ListNode* node) {
node -> val = node -> next -> val;
node -> next = node -> next -> next;
}
};