当前位置:网站首页>剑指 Offer 27. 二叉树的镜像
剑指 Offer 27. 二叉树的镜像
2022-07-02 14:21:00 【anieoo】
原题链接:剑指 Offer 27. 二叉树的镜像
solution:
class Solution {
public:
TreeNode* mirrorTree(TreeNode* root) {
if(root == NULL) return NULL;
swap(root->left,root->right);
mirrorTree(root->left);
mirrorTree(root->right);
return root;
}
};
边栏推荐
- C语言自定义函数的方法
- LeetCode 3. 无重复字符的最长子串
- PhD battle-11 preview | review and prospect backdoor attack and defense of neural network
- [leetcode] 14. Préfixe public le plus long
- [error record] the connection of the flutter device shows loading (disconnect | delete the shuttle/bin/cache/lockfile file)
- Global and Chinese market of jacquard looms 2022-2028: Research Report on technology, participants, trends, market size and share
- Yyds dry inventory uses thread safe two-way linked list to realize simple LRU cache simulation
- 如何与博格华纳BorgWarner通过EDI传输业务数据?
- Résumé de l'entrevue de Dachang Daquan
- Privacy computing technology innovation and industry practice seminar: Learning
猜你喜欢
How to choose the right kubernetes storage plug-in? (09)
移动应用性能工具探索之路
易语言abcd排序
A week of short video platform 30W exposure, small magic push helps physical businesses turn losses into profits
Machine learning perceptron model
Understand one article: four types of data index system
pwm呼吸灯
Amazon cloud technology community builder application window opens
串口控制舵机转动
LeetCode 1. Sum of two numbers
随机推荐
TCP congestion control details | 2 background
Leetcode1380: lucky numbers in matrix
Ap和F107数据来源及处理
pwm呼吸灯
DigiCert SSL证书支持中文域名申请吗?
jsp 和 servlet 有什么区别?
Analysis of how to prevent virus in industrial computer
Role and function of uboot
串口控制舵机转动
几行代码搞定RPC服务注册和发现
TCP server communication process (important)
【Leetcode】14. 最長公共前綴
LeetCode 5. Longest Palindromic Substring
Global and Chinese market of jacquard looms 2022-2028: Research Report on technology, participants, trends, market size and share
绿竹生物冲刺港股:年期内亏损超5亿 泰格医药与北京亦庄是股东
[leetcode] 14. Préfixe public le plus long
Kubernetes three open interfaces first sight
Linux Installation PostgreSQL + Patroni cluster problem
Notice on holding a salon for young editors of scientific and Technological Journals -- the abilities and promotion strategies that young editors should have in the new era
【Leetcode】13. 罗马数字转整数