#include #include #include int main(int argc,char
*argv[]){ int n=0; FILE *fp; if((fp=fopen(argv[1],"r"))==NULL) {
perror("fopen");...
分类:
其他好文 时间:
2014-05-02 18:05:54
阅读次数:
308
与C中的main函数一样,MEX程序中的开始函数为mexFunction.默认变量参数是:void mexFunction(int nlhs, mxArray
*plhs[], int nrhs, const mxArray *prhs[])其中nlhs输出参数数目plhs[]指向输出参数的指针nr...
分类:
其他好文 时间:
2014-05-02 18:01:35
阅读次数:
386
暴力法可过,效率O(n^2)
但是使用hash表可以把效率降到近乎O(n)
要巧妙使用两个map容器。
要对map和set容器很熟悉了,合起来一起使用。...
分类:
其他好文 时间:
2014-05-02 10:54:55
阅读次数:
365
安装modsecurity时,出现“configure: *** apu library not found.”。
解决方法:
yum install apr-util-devel...
分类:
其他好文 时间:
2014-05-02 10:52:44
阅读次数:
433
出现下列错误:
mlogc.c:32:23: error: curl/curl.h: No such file or directory
mlogc.c:1091: error: expected ‘)’ before ‘*’ token
mlogc.c: In function ‘logc_init’:
出错原因:缺少libcurl-dev or libcurl-devel
...
分类:
其他好文 时间:
2014-05-02 10:50:35
阅读次数:
371
29. 数组中出现次数超过一半的数字. 方法a. 排序取中 O(nlogn). 方法b.
partition 函数分割找中位数 >=O(n). 方法c. 设计数变量,扫描一遍。 O(n).#include bool Invalid_Input
= false;int getNumber(int da...
分类:
其他好文 时间:
2014-05-02 10:46:15
阅读次数:
340
本题因为数据量小,可以使用暴力法,时间效率是O(n^3)
但是这里巧用最大子段和的思想,可以把时间效率降到O(n)
思想:
1 想使用一个新的数列,计算连续出现了多少个1和连续出现了多少个零
2 求这个新数列的最大子段和
3 Flip最大子段中的 0 和 1,
4 计算出结果
比暴力法复杂很多了,但是时间效率却提高了三个档次。...
分类:
其他好文 时间:
2014-05-02 10:39:46
阅读次数:
584
横看成岭侧成峰,计算视觉大不同。观看的角度不同,成像自然不同,这对计算机视觉来说,是个大麻烦。但计算机视觉应用如此广泛,却又有不得不研究的理由。指纹机大家都用过吧,这不过是冰山之一角。产品检测,机器人,医学成像等等,都有计算机视觉的身影。学习计算机视觉,OpenCV
是个不错的选择。下载安装到指定位...
分类:
其他好文 时间:
2014-05-02 09:56:18
阅读次数:
413
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-05-02 09:54:11
阅读次数:
269