C语言 | Leetcode C语言题解之第226题翻转二叉树

题目:

题解:

cpp 复制代码
struct TreeNode* invertTree(struct TreeNode* root) {
    if (root == NULL) {
        return NULL;
    }
    struct TreeNode* left = invertTree(root->left);
    struct TreeNode* right = invertTree(root->right);
    root->left = right;
    root->right = left;
    return root;
}
相关推荐
李小小钦14 小时前
D. Storming Arasaka(Codeforces 2238)
c语言·开发语言·数据结构·c++·算法
海石1 天前
1500分的题目,确实有实力,不过还是我略胜一筹
算法·leetcode
海石1 天前
【记忆化搜索】条条大路通AC,走好适合你的那一条,走到后再考虑走得快
算法·leetcode
gugucoding1 天前
21. 【C语言】打包不同类型:结构体
c语言·开发语言
gugucoding1 天前
31. 【C语言】堆栈与队列的实现
c语言·开发语言·数据结构·链表
Yang_jie_031 天前
笔记:数据结构(C语言版)第一章知识点详细归纳
c语言·数据结构·算法
czhaii1 天前
串口1中断收发-C语言-MODBUS协议
c语言·开发语言
apihz1 天前
随机驾考题目(C 照科一 / 科四 2000+ 题)免费API调用教程
android·java·c语言·开发语言·网络协议·tcp/ip
三十岁老牛再出发1 天前
07.07.每日总结
c语言·windows·python
C++ 老炮儿的技术栈2 天前
MFC 自定义纯色居中文字进度条控件
c语言·数据库·c++·windows·算法·c·visual studio