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
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).
分类:
其他好文 时间:
2014-06-27 12:02:32
阅读次数:
195
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
分类:
其他好文 时间:
2014-06-27 11:51:13
阅读次数:
193
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
分类:
其他好文 时间:
2014-06-27 11:40:49
阅读次数:
156
本篇文章主要介绍如何使用自定义的Gallery控件,实现...
分类:
其他好文 时间:
2014-06-27 10:09:33
阅读次数:
338
题目大意:
分析长度为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
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key....
分类:
其他好文 时间:
2014-06-27 09:15:12
阅读次数:
196
有工具在手,这题就是一个模板题,就是有点不清楚,最后问的是单个元素的值,它怎么sum求出来的
#include
#include
#include
#include
using namespace std;
#define maxn 1005
int c[maxn][maxn];
int Row, Col;
inline int Lowbit(const int &x)
{
...
分类:
其他好文 时间:
2014-06-27 07:38:00
阅读次数:
281
目前分词性能比较差,只有1.65M/s,同事在没有改变主要算法的情况下做了一点优化调整,到3.52M/s,但对性能的提升仍然不够明显。我感觉亟须解决几个问题:
1.search时keyword分词也按多种粒度进行,然后分别sloppyphrase,最后or起来,由于大粒度分的词词频低,因此idf大,它们在排序时优先级更高,符合期望。现在只做一个粒度的切法,又要求在索引里面都能找到,感觉不太现实。...
分类:
其他好文 时间:
2014-06-27 07:07:34
阅读次数:
203