“`”
参考回答:
<pre><code class=""language-c"" lang=""c"">public class Solution {
public void Mirror(TreeNode root) {
if(root==null){
return;
}
TreeNode temp = root.left;
root.left = root.right;
root.right = temp;
Mirror(root.left);
Mirror(root.right);
}
}
</code></pre>
<pre><code> "“`
Was this helpful?
0 /
0