首页 > 编程语言 > 详细

LeetCode-237 Delete Node in a Linked List Solution (with Java)

时间:2020-03-02 13:54:25      阅读:52      评论:0      收藏:0      [点我收藏+]

1. Description:

技术分享图片

Notes:

技术分享图片

2. Examples:

技术分享图片

3.Solutions:

 1 /**
 2  * Created by sheepcore on 2019-05-07
 3  * Definition for singly-linked list.
 4  * public class ListNode {
 5  *     int val;
 6  *     ListNode next;
 7  *     ListNode(int x) { val = x; }
 8  * }
 9  */
10 class Solution {
11     public void deleteNode(ListNode node) {
12         node.val = node.next.val;
13         node.next = node.next.next;   
14     }
15 }

LeetCode-237 Delete Node in a Linked List Solution (with Java)

原文:https://www.cnblogs.com/sheepcore/p/12395183.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!