其他分享
首页 > 其他分享> > 判断对称二叉树

判断对称二叉树

作者:互联网

 

mirror

public boolean isMirror(node left, node right){

    if(null == right && null == left){
               return true;
    }else if( null == right || null == left ){
               return false;
    }

   if(right.val != left.val)
             return false;
   
   return isMirror(left.left, right.right) && isMirror(left.right, right.left)
}

 

标签:node,isMirror,判断,return,right,二叉树,对称,null,left
来源: https://www.cnblogs.com/Jomini/p/11895478.html