leetcode刷题,总结,记录,备忘 237
来源:互联网 发布:淘宝自动抢单软件 编辑:程序博客网 时间:2024/06/15 20:36
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 that node.
Supposed the linked list is 1 -> 2 -> 3 -> 4
and you are given the third node with value 3
, the linked list should become 1 -> 2 -> 4
after calling your function.
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: void deleteNode(ListNode* node) { if (node == NULL) return; node->val = node->next->val; node->next = node->next->next; }};
0 0
- leetcode刷题,总结,记录,备忘 237
- leetcode刷题。总结,记录,备忘 104
- leetcode刷题。总结,记录,备忘 100
- leetcode刷题。总结,记录,备忘 191
- leetcode刷题。总结,记录,备忘。168
- leetcode刷题, 总结,记录,备忘 171
- leetcode刷题 ,总结,记录,备忘。144
- leetcode刷题,总结,记录, 备忘 141
- leetcode刷题,总结,记录,备忘。116
- leetcode刷题,总结,记录,备忘。96
- leetcode刷题。记录,总结,备忘。217
- leetcode 刷题, 总结,记录,备忘 35
- leetcode刷题,总结,记录,备忘 226
- leetcode刷题,总结,记录,备忘 169
- leetcode刷题,总结,记录,备忘137
- leetcode刷题,总结,记录,备忘83
- leetcode刷题,总结,记录,备忘70
- leetcode刷题,总结,记录,备忘 108
- Java初涉之8--main()函数入门
- html随笔
- poj 2823 单调队列
- 1001. 害死人不偿命的(3n+1)猜想
- C语言程序设计--练习
- leetcode刷题,总结,记录,备忘 237
- Android Asynchronous Http Client 中文教程
- ios7关于图片资源使用需要注意的问题
- 数组指针和指针数组的区别
- java学习笔记(三) FileStream
- hdojHPU-ACM大一暑期培训练习题1-2 1005月之数
- 04-树5. File Transfer (25)
- xcode使用
- 安卓照相加水印