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;
}
相关推荐
py有趣7 小时前
力扣热门100题之环形链表
算法·leetcode·链表
py有趣7 小时前
力扣热门100题之回文链表
算法·leetcode·链表
leo_messi949 小时前
多线程(五) -- 并发工具(二) -- J.U.C并发包(八) -- CompletableFuture组合式异步编程
android·java·c语言
jie188945758669 小时前
c语言------
c语言·开发语言
样例过了就是过了11 小时前
LeetCode热题100 柱状图中最大的矩形
数据结构·c++·算法·leetcode
wsoz11 小时前
Leetcode哈希-day1
算法·leetcode·哈希算法
阿Y加油吧11 小时前
LeetCode 二叉搜索树双神题通关!有序数组转平衡 BST + 验证 BST,小白递归一把梭
java·算法·leetcode
AI+程序员在路上12 小时前
Linux C 条件变量阻塞线程用法:等待时CPU占用率为0
linux·运维·c语言
jimy112 小时前
C语言实现-----面向对象编程
c语言·数据结构
不爱吃糖的程序媛12 小时前
鸿蒙PC tiny-AES-c三方库适配实践
c语言·华为·harmonyos