当前位置:网站首页>剑指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;
}
};
边栏推荐
- 总结计算机网络超全面试题
- Spark及相关生态组件安装配置——快速回忆
- pygame image rotate continuously
- 动态数组-vector
- 【STM32学习1】基础知识与概念明晰
- How to solve Win11 without local users and groups
- 编译error D8021 :无效的数值参数“/Wextra” cl command line error d8021 invalid numeric argument ‘/wextra‘
- 【离散化+前缀和】Acwing802. 区间和
- STM32LL library use - SPI communication
- win10 system update error code 0x80244022 how to do
猜你喜欢

mysql学习总结 & 索引
![[System Design and Implementation] Flink-based distracted driving prediction and data analysis system](/img/f0/23ac631b6eb9b794224d8ae78e6523.png)
[System Design and Implementation] Flink-based distracted driving prediction and data analysis system

奇技淫巧-位运算

Based on the least squares linear regression equation coefficient estimation

二叉树遍历之后序遍历(非递归、递归)入门详解

总结计算机网络超全面试题

cmake配置libtorch报错Failed to compute shorthash for libnvrtc.so

Mysql lock

Summarize computer network super comprehensive test questions

1.开发社区首页,注册
随机推荐
倍增和稀疏表
利用plot_surface命令绘制复杂曲面入门详解
What should I do if Windows 10 cannot connect to the printer?Solutions for not using the printer
Win10 Settings screen out from lack of sleep?Win10 set the method that never sleep
动态数组-vector
STM32LL library - USART interrupt to receive variable length information
总结计算机网络超全面试题
关于c语言的调试技巧
二叉树创建之层次法入门详解
2021-10-14
Do Windows 10 computers need antivirus software installed?
Ubuntu通过apt安装Mysql
LeetCode 2344. 使数组可以被整除的最少删除次数 最大公约数
模板系列-并查集
Article pygame drag the implementation of the method
4. Publish Posts, Comment on Posts
GMP scheduling model of golang
Cmd Markdown 公式指导手册
MATLAB绘图函数fplot详解
MATLAB绘图函数plot详解