- 博客(9)
- 收藏
- 关注
原创 cc150 4.1
check if a tree is balanced public int getHeight (TreeNode root) { if (root == null) return 0; return Math.max(getHeight (root.left), getHeight(root.right)) + 1; } public boolean
2015-01-30 13:12:04 535
原创 Count and say
public class Solution { public String countAndSay(int n) { if (n return null; } int num = 1; String s = "1"; for (int i = 0; i
2014-10-16 11:27:31 336
原创 Subsets - leescode
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets. For exa
2014-10-15 08:51:41 294
转载 Subset
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets. For exa
2014-10-15 08:39:22 416
原创 Unique Path 2 - leetcode
Unique Paths II Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and
2014-10-15 05:49:53 340
原创 Flatten binary tree to linkedlist - leetcode
Flatten Binary Tree to Linked List Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The fl
2014-10-15 04:27:51 353
原创 Valid parentheses - leetcode
Valid parentheses 思路: code: public class Solution { public boolean isValid(String s) { if (s.length() == 0 || s.length() == 1) { return false; }
2014-10-14 04:49:46 276
原创 Valid parentheses
Valid Parentheses Total Accepted: 21159 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in t
2014-10-14 04:21:24 287
转载 wrap_content 和fill_parent
Android fill_parent、wrap_content和match_parent的区别 (别处抄来zuo'b) 三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。 1)fill_parent 设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Wi
2014-08-10 04:32:21 538
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人