摘要: public class 对称的二叉树{ public boolean isSymmetrical(TreeNode root) { // 特殊情况考虑 if (root == null) { return true; } return isSymmetrical(root.left, root.r 阅读全文
posted @ 2018-01-06 19:14 qingtianBKY 阅读(130) 评论(0) 推荐(0) 编辑
摘要: public class 返回一个二叉树的镜像树{ // 层次遍历,左右调换 public void JingXiangTree(TreeNode root) { // 考虑特殊情况 if (root == null) { return; } if (root.left == null && roo 阅读全文
posted @ 2018-01-06 18:51 qingtianBKY 阅读(137) 评论(0) 推荐(0) 编辑