其他分享
首页 > 其他分享> > leetcode 面试题 02.03. 删除中间节点

leetcode 面试题 02.03. 删除中间节点

作者:互联网

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) { val = x; }
 * }
 */
class Solution {
    public void deleteNode(ListNode node) {
        node.val = node.next.val;
        node.next = node.next.next;
        
    }
}

标签:node,面试题,ListNode,val,int,02.03,next,public,leetcode
来源: https://blog.csdn.net/qq_35712788/article/details/114411086