当前位置:网站首页>剑指offer:在O(1)时间删除链表结点
剑指offer:在O(1)时间删除链表结点
2022-08-02 14:11:00 【超级码力奥】
原题链接:https://www.acwing.com/problem/content/85/

简直不要太庙。借尸还魂了属于是。
/** * 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) {
ListNode* p = node->next->next;
node->val = node->next->val;
node->next = p;
}
};
边栏推荐
- Win11 computer off for a period of time without operating network how to solve
- Based on the matrix calculation in the linear regression equation of the coefficient estimates
- 【STM32学习1】基础知识与概念明晰
- Codeforces Round #624 (Div. 3)
- 7. Redis
- MATLAB制作简易小动画入门详解
- STM32LL library - USART interrupt to receive variable length information
- MATLAB drawing command fimplicit detailed introduction to drawing implicit function graphics
- pygame image rotate continuously
- Mysql connection error solution
猜你喜欢
随机推荐
LeetCode 2354. 优质数对的数目 二进制01表示和集合之间的转换
2342. 数位和相等数对的最大和 哈希优化
3.用户上传头像
第二十九章:树的基本概念和性质
总结计算机网络超全面试题
Exotic curiosity-a solution looking - bit operations
动态规划理论篇
7.Redis
IPV4和IPV6是什么?
MATLAB drawing command fimplicit detailed introduction to drawing implicit function graphics
【STM32学习1】基础知识与概念明晰
1. Development community homepage, register
第三十一章:二叉树的概念与性质
质数相关问题-小记
Open the door of power and electricity "Circuit" (2): Power Calculation and Judgment
基于最小二乘法的线性回归分析方程中系数的估计
golang之GMP调度模型
【离散化+前缀和】Acwing802. 区间和
C语言函数参数传递模式入门详解
mysql的索引结构为什么选用B+树?








