- 博客(17)
- 收藏
- 关注
原创 Tree107BinaryTreeLevelOrderTraversal2
BinaryTreeLevelOrderTraversal Bottom Up
2016-09-25 08:04:47 198
原创 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 value Failed case 4294967295超出int范围,话说这种
2016-09-24 23:06:41 144
原创 BM191NumberOf1Bits
Pre-defined Methods Integer.toBinaryString(int n) return binary string Integer.toBinaryString(int n).toCharArray() directly to array. 思路 知道可以用位运算,但是不会应用,参考discussion https://discuss.leetcode.com/top
2016-09-17 05:02:44 181
原创 Tree111MinimumDepthOfBinaryTree
思路 用recursive,但要注意审题,详见“注意” 注意 根据题目要求,一定要到了leaf才算,因此root比较特殊
2016-09-12 12:55:53 263
原创 Tree102BinaryTreeLevelOrderTraversal
二叉树 BinaryTree level order traversal
2016-09-08 10:50:12 248
原创 Tree226InvertBinaryTree
思路 mirrorTree by linkedList DFS或者BFS Recursive Logic Flaw1 LogicFlaw 当有val的时候,left和right有可能为null ( 叶子节点),但是当root == null的时候,根本就没有left和right啊,小心NullPointerException InvertTreeByRecursive2() 利用这个null的特
2016-09-07 23:04:31 166
原创 Tree的各种Methods
镜面反转BinaryTree见Tree101SymmetricTree private methods MirrorTree()
2016-09-07 03:23:51 273
原创 String165CompareVersionNumbers
version number comparison Leading 0 problem String with delimiter
2016-09-04 10:13:59 195
原创 String13 String12 Integer<->Roman Easy&Medium
总是觉得懒惰的罗列方法更简单,但写起来发现重复的太多,还是通用方法比较好。intToArray()方法写了好多 思路总结
2016-09-02 03:37:10 236
原创 String13RomanToInteger
roman to integer String13 easy leetcode stringBuilder
2016-09-02 01:32:04 168
原创 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 180
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人