会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hhooo
博客园
首页
新随笔
联系
管理
订阅
随笔分类 -
Leetcode
Minimum Depth of Binary Tree
摘要:改造了一下maxdepth的代码 public static int minDepth(TreeNode root) { if(root==null) return 0; int height=0; Queue q=new LinkedList(); ...
阅读全文
posted @
2015-06-24 20:03
hhrrrr
阅读(161)
评论(0)
推荐(0)
Invert Binary Tree
摘要:问题描述: 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1递归反转:先反转根节点的左子树和右子树 然后再分别反转左子树,右子树各自的下的左子树右子树。依此类推...
阅读全文
posted @
2015-06-24 12:05
hhrrrr
阅读(209)
评论(0)
推荐(0)
Maximum Depth of Binary Tree-求二叉树高度
摘要:非递归: public static int maxDepth(TreeNode root){ if(root==null) return 0; Queue q=new LinkedList(); q.offer(root); int enQu...
阅读全文
posted @
2015-06-24 11:08
hhrrrr
阅读(172)
评论(0)
推荐(0)
LeetCode-Remove Duplicates From Sorted Array
摘要:descriptions:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.注意是有序数组。。代码:if(num...
阅读全文
posted @
2015-06-15 20:10
hhrrrr
阅读(122)
评论(0)
推荐(0)
公告