当前位置:网站首页>【力扣】翻转二叉树
【力扣】翻转二叉树
2022-07-17 05:13:00 【Patrick star`】
题目:
给你一棵二叉树的根节点 root ,翻转这棵二叉树,并返回其根节点。
思路:
利用递归,让左指针指向右孩子,右指针指向左孩子
代码:
struct TreeNode* invertTree(struct TreeNode* root)
{
if(root == NULL)
{
return NULL;
}
struct TreeNode* temp = root->right;
root->right = invertTree(root->left);
root->left = invertTree(temp);
return root;
}边栏推荐
- 2021-11-10 micropyton tb6600 step drive class
- MySQL Workbench基本使用 【创建一个数据表】
- 4路编码器脉冲计数器,转速测量,8路DO,Modbus TCP数据采集模块
- Conversion, isolation and transmission of international standard signals 0-5v/0-10v/1-5v, 0-10ma/0-20ma/4-20ma, etc
- 数字信号隔离模块 ADUM1401ARWZ 亚德诺 库存现货
- Wide voltage input high voltage output voltage control type
- Go language introduction and application scenario analysis
- Introduction to Darwin streaming server
- It4058a single lithium ion battery charging management
- Darwin 反射总结
猜你喜欢
![[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning](/img/65/fbb975491d4abd5d1babdf000513e2.png)
[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning

Chrome浏览器设置 【显示右上角 翻译语言图标】

自动补全 & (自定义)拼音分词器 & 搜索时注意事项

minio安装部署及简单使用

ES聚合分析报错:“reason“ : “Text fields are not optimised for operations

Material and application circuit diagram of 0-10V, 4-20mA current voltage to PWM isolation converter

3.7V锂电池升压到5V1A,FS2114升压转换芯片设计布局

RestClient查询文档

简单Chrome脚本 自动跳过b站视频播放结束后的的充电鸣谢页面

2021 - 09 - 15
随机推荐
[transfer] Darwin streaming server core code analysis
2022/07/14 学习笔记 (day07)数组
Darwin's analytical experience
压力应变桥信号处理光电隔离放大器
宽电压输入高电压输出 电压控制型
Acwing第 59 场周赛(AK)
High voltage module isolation module hra2460d-2w
Simple chrome script automatically skips the charging acknowledgment page after the video playback of station B ends
有依赖的背包,狭义(二进制枚举),广义(树形dp)
uboot 编译前的配置命令make config分析
MCU single chip OTP
谷歌浏览器不能手动修改cookies,cookie报红标红
隔离4-20mA或0-20mA信号传输
3.7V锂电池升压到5V1A,FS2114升压转换芯片设计布局
FS68001无线充SOC芯片外围简单,5W无线充方案原理图
获取当前年月日、时分秒、星期,并实时更新
vscode 使用技巧1
数学基础课2_欧拉函数,线性筛,扩欧
Guess The String (二分,交互)
QTSS数据类型