Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2015年9月13日

摘要: A variation to Binary Tree iteration.class Solution { bool isSame(TreeNode *p1, TreeNode *p2) { if (!p1 && !p2) return true; if( (... 阅读全文
posted @ 2015-09-13 14:07 Tonix 阅读(199) 评论(0) 推荐(0)

摘要: Typical solution: convert it to Maximum Array problem.And here is my solution: O(n) by using Greedy strategy on this equation: sum[i..j] = sum[0..j] -... 阅读全文
posted @ 2015-09-13 13:47 Tonix 阅读(183) 评论(0) 推荐(0)

摘要: Using XOR on bits.class Solution {public: /* * @param a: The first integer * @param b: The second integer * @return: The sum of a and b... 阅读全文
posted @ 2015-09-13 13:00 Tonix 阅读(163) 评论(0) 推荐(0)