Tony's Log

Algorithms, Distributed System, Machine Learning

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

2014年7月28日

摘要: Similar with "Longest Consecutive Sequence". Another usage to hashset.Take care of corner cases!class Solution {public: int firstMissingPositive(in... 阅读全文
posted @ 2014-07-28 12:27 Tonix 阅读(176) 评论(0) 推荐(0)

摘要: A BFS usage.class Solution {public: UndirectedGraphNode *cloneGraph(UndirectedGraphNode *node) { if (!node) return NULL; UndirectedGr... 阅读全文
posted @ 2014-07-28 11:49 Tonix 阅读(132) 评论(0) 推荐(0)

摘要: Similar with "Climb stairs" but with more restrictions.// Ref: http://yucoding.blogspot.com/2013/01/leetcode-question-26-decode-ways.htmlclass Solu... 阅读全文
posted @ 2014-07-28 08:25 Tonix 阅读(132) 评论(0) 推荐(0)

摘要: Typical recurrsion\DFS problem. Just take care of memory use.class Solution {public: vector> ret; void go(int currMaxN, int currK, int k, unorde... 阅读全文
posted @ 2014-07-28 06:12 Tonix 阅读(154) 评论(0) 推荐(0)