在链接列表中删除节点.

编写一个函数来删除单链表中的一个节点(除了尾部),只提供对该节点的访问.。
假设链表是1 - > 2 - > 3 > 4,并给出了具有值为3的节点,

链表应该成为1 - > 2 - > 4

public class Solution {
public void deleteNode(ListNode node) {
node.val=node.next.val;
node.next = node.next.next;
}
}

237. Delete Node in a Linked List的更多相关文章

  1. 237. Delete Node in a Linked List(C++)

    237. Delete Node in a Linked Lis t Write a function to delete a node (except the tail) in a singly l ...

  2. LeetCode Javascript实现 283. Move Zeroes 349. Intersection of Two Arrays 237. Delete Node in a Linked List

    283. Move Zeroes var moveZeroes = function(nums) { var num1=0,num2=1; while(num1!=num2){ nums.forEac ...

  3. 237. Delete Node in a Linked List【easy】

    237. Delete Node in a Linked List[easy] Write a function to delete a node (except the tail) in a sin ...

  4. [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 ...

  5. (easy)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 ...

  6. leetcode 237 Delete Node in a Linked List python

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

  7. 【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 t ...

  8. 17.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 ...

  9. 237. Delete Node in a Linked List(leetcode)

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

  10. 【一天一道LeetCode】#237. Delete Node in a Linked List

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Write a ...

随机推荐

  1. 原创 C++之常量(一)

    1概述 一个C++程序就是一系列数据与操作的集合.当一个C++程序开始运行的时候,与该程序相关的数据就会被加载到内存中.当数据与内存发生关联的时候,这些数据就会具有如下的特性: 数据在内存中的地址.这 ...

  2. JQuery 了解

    jQuery是什么?为什么是这样?怎么用? jQuery是对JavaScript的一种封装,是一个常用功能库.javascript是做什么的jquery就是做啥的.用它主要使写js更简便而强大,有些功 ...

  3. ORACLE RETURNING 用法总结

    ORACLE RETURNING 用法总结 场景 在存储过程.PL/SQL块里需要返回INSERT.DELETE.UPDATE.MERGE等DML语句执行后的信息时使用,合理使用returning能够 ...

  4. SQLite使用(二)&&数据类型

    1.概述 我们熟知的数据库引擎大部分采用静态数据类型,即列定义的类型定义了值的存储,并且值要严格满足列的定义,同一列所有值的存储方式都相同,比如定义了一个列类型为整型 int,不能在该列上输入'abc ...

  5. sql面试题(学生表_课程表_成绩表_教师表)

    原帖链接:http://bbs.csdn.net/topics/280002741 表架构 Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程 ...

  6. MySQL 主从复制

    1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...

  7. mongodb基础篇

    一.  关于mongodb 两种非关系数据库 Redis:满足极高读写性能的Key-Value数据库 键值式储存,可以通过键快速查询到值. 内存数据库,类似于mencached.性能出色.容量低,不具 ...

  8. Linq To SQL 的问题点滴

    String 类型的字段问题 String类型的字段生成的SQL 没有判断为空的情况时 生成的SQL: 这里判断为空的逻辑很明显不是本来的意思.   左关联 SQL关联中经常会用到左关联,那么Linq ...

  9. ngx_http_core_module模块.md

    Directives aio Syntax: aio on | off | threads[=pool]; Default: aio off; Context: http, server, locat ...

  10. Go语言开发第一个Hello,World

    在网上看到go语言的各种评价,也是闻名已久,但是没有自己实践过,也不知道它的好,它的坏,今天就来试试第一个小程序 第一步.如何下载 1)下载go安装程序 下载地址:https://golang.org ...