当前位置:网站首页>[force buckle] flip binary tree
[force buckle] flip binary tree
2022-07-19 06:26:00 【Patrick star`】
226. Flip binary tree - Power button (LeetCode)
subject :
Give you the root node of a binary tree root , Flip this binary tree , And return its root node .
Ideas :
Recursion , Let the left pointer point to the right child , The right pointer points to the left child
Code :
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;
}边栏推荐
- ACWing每日一题.3511
- RestClient查询文档
- 2021-11-26 pyautogui cooperates with lightning simulator to realize the automation of mobile app check-in and answer questions
- [force buckle] copy the linked list with random pointer
- 带透明png转换成c数组
- 串口循环缓存区 简单 免初始化 不用堆、指针、分段memcpy
- Acwing第58场周赛(AK)
- 2021-11-17 esp32 pin reference
- 嵌入式C语言重点(const、static、voliatile、位运算)
- 【力扣】用队列实现栈
猜你喜欢

【力扣】环形链表 II

數學基礎課2_歐拉函數,線性篩,擴歐

【力扣】复制带随机指针的链表

Positional Change of the Eyeball During Eye Movements: Evidence of Translatory Movement眼球运动过程中眼球的位

Unity2d learning Fox game production process 1: basic game character control, animation effects, lens control, item collection, bug optimization

Cours de mathématiques de base 2 Fonction Euler, écran linéaire, élargissement de l'Europe

基于运动和视觉突出性的自我视频中的注意预测

Unity2D学习 Fox Game制作 过程1:基本的游戏角色控制,动画效果,镜头控制,物品收集,bug优化

2021 - 09 - 15

结合图片看常用串口通信UART
随机推荐
busybox date 日期增加一天明天 网上都是减一天 昨天
Markdown语法和常用快捷键
【力扣】用队列实现栈
[force buckle] copy the linked list with random pointer
Using VOR depth estimation to solve the problem of target ambiguity in three-dimensional gaze interaction
MEX and Increments
Leetcode string
单表查询、添加、更新与删除数据
Decorate Apple Tree
c语言调用文件浏览器,实现选择文件的效果
Cable TV network (tree grouping)
What kind of deep learning is most suitable for your enterprise?
【力扣】括号匹配
虚拟现实中的眼睛跟踪
Learning video saliency from human gaze using candidate selection
Volatile function of embedded C language
Baby Ehab Partitions Again(dp,构造,位运算)
Common serial communication UART seen from pictures
BusyBox 1.21.1 有udpsvd功能 可以编译成功 不干涉本机busybox方法
vscode 使用技巧1