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

https://leetcode.com/problems/delete-node-in-a-linked-list/#/description

leetcode237的更多相关文章

  1. Leetcode-237 Delete Node in a Linked List

    #237.    Delete Node in a Linked List Write a function to delete a node (except the tail) in a singl ...

  2. Leetcode237: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 ...

  3. 每天一道LeetCode--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 th ...

  4. [Java]LeetCode237. 删除链表中的节点 | 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 ...

  5. LeetCode237 删除链表中的节点

    请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点,你将只被给定要求被删除的节点. 现有一个链表 -- head = [4,5,1,9],它可以表示为: 4 -> 5 -> 1 - ...

  6. LeetCode链表解题模板

    一.通用方法以及题目分类 0.遍历链表 方法代码如下,head可以为空: ListNode* p = head; while(p!=NULL) p = p->next; 可以在这个代码上进行修改 ...

  7. ACM金牌选手算法讲解《线性表》

    哈喽,大家好,我是编程熊,双非逆袭选手,字节跳动.旷视科技前员工,ACM亚洲区域赛金牌,保研985研究生,分享算法与数据结构.计算机学习经验,帮助大家进大厂~ 公众号:『编程熊』 文章首发于: ACM ...

随机推荐

  1. oracle 11g 建库 建表 增 删 改 查 约束

    一.建库 1.(点击左上角带绿色+号的按钮) 2.(进入这个界面,passowrd为密码.填写完后点击下面一排的Test按钮进行测试,无异常就点击Connect) 二.建表 1-1. create t ...

  2. LeetCode-Microsoft-Add Two Numbers II

    You are given two non-empty linked lists representing two non-negative integers. The most significan ...

  3. nginx 配置 vhosts 的方案

    网上有很多种 nginx 配置 vhosts,来个比较方便的. 步骤如下: 在 conf 目录建一个vhosts 目录. 在 nginx.conf 末尾加入 include vhosts/*.conf ...

  4. ResourceBundle介绍

    介绍: ResourceBundle类主要作用是读取属性文件,读取属性文件时可以直接指定属性文件的名称(指定名称时不需要文件的后缀),也可以根据Locale所指定的区域码来选取指定的资源文件: Res ...

  5. nexus7 升级失败后手动刷系统

    http://bbs.gfan.com/android-6934570-1-1.html   步骤如下: 1. 下载Android系统文件,打开官方地址:https://developers.goog ...

  6. 【转】每天一个linux命令(57):ss命令

    原文网址:http://www.cnblogs.com/peida/archive/2013/03/11/2953420.html ss是Socket Statistics的缩写.顾名思义,ss命令可 ...

  7. 关于 Cookie-free Domains (为什么将静态图片,js,css存放到单独的域名?)

    这篇文章对高性能web开发具有参考性:http://developer.yahoo.com/performance/rules.html 本文主要描述使用裸域名做网站主域名时,如何用子域名做 cook ...

  8. Java8 lam。。。表达式

    双冒号:相当于用了别人实现的方法,格式,类名::方法 Math::max等效于(a, b)->Math.max(a, b)String::startWith等效于(s1, s2)->s1. ...

  9. AngularJS---核心特性

    步入正题.学习Angular,首先得了解.熟知.掌握它的四大核心特性. 一.MVC模式 Model(模型):是应用程序中用于处理应用程序数据逻辑的部分,通常模型对象负责在数据库中存取数据. View( ...

  10. js jquery 设置cookie

    转自http://yaoqianglilan.blog.163.com/blog/static/70978316201091810435251/ 本人亲测setcookie() getcookie() ...