Tony's Log

Algorithms, Distributed System, Machine Learning

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

2015年10月28日

摘要: A simple application to binary tree traversal.class Solution { typedef pair Rec; // last val - length unsigned ret; void go(TreeNode *p, Rec ... 阅读全文
posted @ 2015-10-28 11:47 Tonix 阅读(164) 评论(0) 推荐(0)

摘要: Based on Bucketing and "Majority Number I".class Solution { pair majorityNumber0(vector &num) { int count = 0; int ret = 0; fo... 阅读全文
posted @ 2015-10-28 06:10 Tonix 阅读(199) 评论(0) 推荐(0)

摘要: A reverse version of the Dictionary algorithm :) If you AC-ed "Next Permutation II", copy it over and just reverse the conditions.class Solution {publ... 阅读全文
posted @ 2015-10-28 05:25 Tonix 阅读(167) 评论(0) 推荐(0)

摘要: Such a classic DP.. Thought flow:1. find out the 2 vars in the problem statement: n and k2. setup dp equation - my first thought was by n which was no... 阅读全文
posted @ 2015-10-28 04:27 Tonix 阅读(174) 评论(0) 推荐(0)