- 博客(17)
- 收藏
- 关注
原创 Tree107BinaryTreeLevelOrderTraversal2
BinaryTreeLevelOrderTraversal Bottom Up
2016-09-25 08:04:47 208
原创 BM190ReverseBits
思路Use char array注意If you change the variable on it’s own in the if logic, remember to use else if or it may deal with the changed result rather than original valueFailed case4294967295超出int范围,话说这种
2016-09-24 23:06:41 157
原创 BM191NumberOf1Bits
Pre-defined MethodsInteger.toBinaryString(int n) return binary stringInteger.toBinaryString(int n).toCharArray() directly to array. 思路知道可以用位运算,但是不会应用,参考discussion https://discuss.leetcode.com/top
2016-09-17 05:02:44 198
原创 Tree111MinimumDepthOfBinaryTree
思路用recursive,但要注意审题,详见“注意”注意根据题目要求,一定要到了leaf才算,因此root比较特殊
2016-09-12 12:55:53 283
原创 Tree226InvertBinaryTree
思路mirrorTree by linkedList DFS或者BFSRecursive Logic Flaw1LogicFlaw当有val的时候,left和right有可能为null ( 叶子节点),但是当root == null的时候,根本就没有left和right啊,小心NullPointerException InvertTreeByRecursive2() 利用这个null的特
2016-09-07 23:04:31 184
原创 Tree的各种Methods
镜面反转BinaryTree见Tree101SymmetricTree private methods MirrorTree()
2016-09-07 03:23:51 296
原创 String165CompareVersionNumbers
version number comparisonLeading 0 problemString with delimiter
2016-09-04 10:13:59 204
原创 String13 String12 Integer<->Roman Easy&Medium
总是觉得懒惰的罗列方法更简单,但写起来发现重复的太多,还是通用方法比较好。intToArray()方法写了好多思路总结
2016-09-02 03:37:10 251
原创 String13RomanToInteger
roman to integerString13 easy leetcodestringBuilder
2016-09-02 01:32:04 182
原创 String38Count and Say
String 38 Count and Say字符串里面的数字统计Logic Flaws连续数字的count和整个string的index不应该是同一个注意第三层统计(while-count)和第二层统计(for-j)之间,也就是for里面带着whil
2016-09-01 12:21:07 190
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人