剑指offer中的题型和leetcode101
public class Solution {
boolean isSymmetrical(TreeNode pRoot)
{
if(pRoot==null) return true;
else return check(pRoot.left,pRoot.right);
}
boolean check(TreeNode left,TreeNode right){
if(left==null && right==null) return true;
if(left==null&& right!=null|| left!=null&& right==null)
return false;
if(left.val!=right.val) return false;
else return check(left.left,right.right)&&check(left.right,right.left);
}
}
public class PointToJava {
public void Mirror(TreeNode root){
if(root==null) return;
else{
TreeNode tmp=root.left;
root.left=root.right;
root.right=tmp;
Mirror(root.left);
Mirror(root.right);
}
}
}