WenJieWangFlyToWorld

导航

2017年5月29日 #

10 数的高度 节点数 叶子节点数 度为2的节点数

摘要: @Override public int TreeDeep(TreeNode treeNode) { if (treeNode == null) { return 0; } int ld = TreeDeep(treeNode.leftchild); int rd = TreeDeep(treeNo 阅读全文

posted @ 2017-05-29 21:52 WenjieWangFlyToWorld 阅读(235) 评论(0) 推荐(0) 编辑

8 根据前序遍历和中序遍历得到二叉树

摘要: /** * 前序遍历和中序遍历创建二叉树 Pre 前序遍历的数组 In 中序遍历的数组 lpre 前序遍历数组开始位置 hpre前序遍历结束位置 * lin前序遍历数组开始位置 hin前序遍历结束位置 */ @Override public TreeNode PreInCreat(int[] Pre 阅读全文

posted @ 2017-05-29 21:24 WenjieWangFlyToWorld 阅读(121) 评论(0) 推荐(0) 编辑

9 根据中序遍历和后序遍历得到二叉树

摘要: public TreeNode InPostCreat(int[] In, int[] Post, int lin, int hin, int lpost, int hpost) { TreeNode root = new TreeNode(0); if (Post.length == 0 || I 阅读全文

posted @ 2017-05-29 21:21 WenjieWangFlyToWorld 阅读(206) 评论(0) 推荐(0) 编辑