翻转二叉树

题目

翻转二叉树

链接:https://leetcode-cn.com/problems/invert-binary-tree/

代码

class Solution {
    public TreeNode invertTree(TreeNode root) {
        if (root == null)
            return null;
        TreeNode right = invertTree(root.right);
        TreeNode left = invertTree(root.left);
        root.right = left;
        root.left = right;
        return root;
    }
}
```
上一篇:Python版OpenCV笔记


下一篇:cv2.imread的用法