Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's...
分类:
其他好文 时间:
2014-06-27 18:22:07
阅读次数:
191
题目Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adja...
分类:
其他好文 时间:
2014-06-27 17:25:52
阅读次数:
225
14.04 LTSenabling vnc:0. apt-get install dconf-tools1.click icon "search your computer and online sources"desktop sharing, enable2. create file and na...
分类:
其他好文 时间:
2014-06-27 17:08:58
阅读次数:
195
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:
其他好文 时间:
2014-06-27 12:30:39
阅读次数:
204
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
分类:
其他好文 时间:
2014-06-27 12:11:09
阅读次数:
181
题目大意:
分析长度为n的子串有多少种。
思路分析:
对于没出现的字符,将其分配一个数字。
然后将子串看做一个nc进制的数。
然后hash判断。
#include
#include
#include
#include
#include
#include
using namespace std;
bool vis[26666666];
int val[30...
分类:
其他好文 时间:
2014-06-27 09:45:35
阅读次数:
184
目前分词性能比较差,只有1.65M/s,同事在没有改变主要算法的情况下做了一点优化调整,到3.52M/s,但对性能的提升仍然不够明显。我感觉亟须解决几个问题:
1.search时keyword分词也按多种粒度进行,然后分别sloppyphrase,最后or起来,由于大粒度分的词词频低,因此idf大,它们在排序时优先级更高,符合期望。现在只做一个粒度的切法,又要求在索引里面都能找到,感觉不太现实。...
分类:
其他好文 时间:
2014-06-27 07:07:34
阅读次数:
203
因为新工厂的机器上面的业务混合部署非常严重,加上内网外网共用一个网卡(这个更不可思议),导致有时要定位一些进程流量的问题非常困难,所以最近花了点时间在网上搜集了一把 (aptitude search top$),粗略比较了一下,大概结果如下atop — 跟 sar 类似,配合内核模块可以做到进程级别...
分类:
Web程序 时间:
2014-06-27 00:57:40
阅读次数:
4891