当前位置:网站首页>LeetCode 237. Delete nodes in the linked list
LeetCode 237. Delete nodes in the linked list
2022-07-05 03:00:00 【Abby's daily life】
https://leetcode-cn.com/problems/delete-node-in-a-linked-list/
Ideas
- Not really deleted , Instead, update the value of the node to be deleted to the value of the next node
- Delete the node next Updated to .next.next
public void deleteNode(ListNode node) {
node.val = node.next.val;
node.next = node.next.next;
}
边栏推荐
- openresty ngx_ Lua variable operation
- The database and recharge are gone
- LeetCode146. LRU cache
- 打破信息茧房-我主动获取信息的方法 -#3
- Clean up PHP session files
- 返回二叉树中两个节点的最低公共祖先
- 【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
- Spark SQL learning bullet 2
- Hmi-30- [motion mode] the module on the right side of the instrument starts to write
- Problem solving: attributeerror: 'nonetype' object has no attribute 'append‘
猜你喜欢
VM in-depth learning (XXV) -class file overview
Three line by line explanations of the source code of anchor free series network yolox (a total of ten articles, which are guaranteed to be explained line by line. After reading it, you can change the
Tencent cloud, realize image upload
【LeetCode】501. Mode in binary search tree (2 wrong questions)
Watch the online press conference of tdengine community heroes and listen to TD hero talk about the legend of developers
IPv6 experiment
Single line function*
Hmi-30- [motion mode] the module on the right side of the instrument starts to write
SQL injection exercise -- sqli Labs
Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
随机推荐
Pat class a 1160 forever (class B 1104 forever)
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
el-select,el-option下拉选择框
Azkaban actual combat
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
Acwing game 58 [End]
How can we truncate the float64 type to a specific precision- How can we truncate float64 type to a particular precision?
Pat grade a 1119 pre- and post order traversals (30 points)
Tiny series rendering tutorial
openresty ngx_ Lua variable operation
低度酒赛道进入洗牌期,新品牌如何破局三大难题?
平台入驻与独立部署优缺点对比
TCP security of network security foundation
El tree whether leaf node or not, the drop-down button is permanent
Azkaban概述
Design and practice of kubernetes cluster and application monitoring scheme
Structure of ViewModel
【LeetCode】106. Construct binary tree from middle order and post order traversal sequence (wrong question 2)
【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)