TreeNode mirrorTreeNode(TreeNode root){ if(root == null){ return null; } TreeNode left = mirrorTreeNode(root.left); TreeNode right = mirrorTreeNode(root.right); root.left = right; root.right = left; return root; }
原文地址:https://www.cnblogs.com/yingpu/p/9287194.html
时间: 2024-10-30 08:56:51