The first solution I figured out is O(n^3). I thought it must be O(n^2) to get max points on a line for a given point.. but after checking several art...
分类:
其他好文 时间:
2014-07-22 22:47:15
阅读次数:
226
class Solution {public: int evalRPN(vector &tokens) { int len = tokens.size(); if (len stack; for (int i=0; i= '0' && p[0] 1...
分类:
其他好文 时间:
2014-07-22 22:45:14
阅读次数:
184
For the one pass solution... first I tried to build white\blue from red, but not working anyway. Then I referred someone' code, to build red\blue from...
分类:
其他好文 时间:
2014-07-22 22:42:54
阅读次数:
212
CombinationsGiven two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3.....
分类:
其他好文 时间:
2014-07-22 22:36:54
阅读次数:
153
class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len i2r(len, 0); vector i2l(len, 0); ...
分类:
其他好文 时间:
2014-07-22 22:34:54
阅读次数:
154
Insertion Sort ListSort a linked list using insertion sort.算法思路:最基本的插入排序,时间复杂度O(n*n),空间复杂度O(1)代码: 1 public class Solution { 2 public ListNode inse...
分类:
其他好文 时间:
2014-07-22 00:23:34
阅读次数:
204
切换到 root 账号升级和更新整个系统:$ sudo -i# apt-get update# apt-get upgrade安装 Node.js 运行环境:# apt-get install g++ make python python-software-properties# add-apt-r...
分类:
Web程序 时间:
2014-07-22 00:14:37
阅读次数:
212
接下来的几道题,都是有关路径问题,这可以说是DP问题的一种典型应用。路径有一个维度的;也有两个维度的。
Eg10:Climbing Stairs
这道题目比较简单,重在分析思路。
Eg11:Minimum Path Sum
分析:略
class Solution {
public:
int minPathSum(v...
分类:
其他好文 时间:
2014-07-21 16:48:55
阅读次数:
191
Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co...
分类:
其他好文 时间:
2014-07-21 14:11:16
阅读次数:
151
手动卸载Officescan/osce 当officescan客户端损坏 或其他一些意外情况导致officescan 无法正常卸载时? 可使用手动卸载方案 Solution: ? A.停止如下服务:? OfficeScan NT Firewall (如果存在)? OfficeScan NT ...
分类:
其他好文 时间:
2014-07-21 14:09:16
阅读次数:
1642