题目描述:
Finding all occurrences of a pattern in a text is a problem that arises frequently in text-editing programs.
Typically,the text is a document being edited,and the pattern searched f...
分类:
其他好文 时间:
2015-01-03 11:59:34
阅读次数:
157
题目1094:String Matching
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:1098
解决:587
题目描述:
Finding all occurrences of a pattern in a text is a problem that arises frequently in text-editin...
分类:
其他好文 时间:
2015-01-01 07:54:41
阅读次数:
217
Algorithm: Scan through the array, keep finding 1. prices[i] with the condition: prices[i] prices[i+1], or at the end of an ascending trend, trea...
分类:
其他好文 时间:
2014-12-31 06:16:24
阅读次数:
159
http://poj.org/problem?id=1200
Description
Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given text. ...
分类:
其他好文 时间:
2014-12-29 10:28:57
阅读次数:
234
这里,我介绍一下O(n)回文串处理的一种方法。Manacher算法.原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-palindrome-sub-...
分类:
其他好文 时间:
2014-11-26 18:38:27
阅读次数:
167
问题描述:
输入:空间平面上点集Q 输出:距离最近的两个点对
问题简化:如果是在一个直线上找最近的点对,则可以使用排序,之后找最近最近点。
分治思路:
Divide 将其划分为两个部分Q1,Q2 T(n) = O(n)
Conquer 分别找最近点对, T(n) = 2T(n/2)
Merge 比较分开点附近的两个点距离和找出的的距离T(n)= O(...
分类:
编程语言 时间:
2014-11-26 16:31:10
阅读次数:
216
问题描述:找到包含点集Q的最小凸多边形。使得点集内的点均在凸多边形的边上或内部。
即集合内任意两点的连线均在凸多边形内部。
输入:平面上的n个点的集合Q
输出: CH(Q):Q的convexhull
(一)蛮力法思路:
找到点集内的内部点去掉,剩余未边界点。
内部点的判断:只要其中三点A,B,C构成的三角形包含的点P则P为内部点...
分类:
其他好文 时间:
2014-11-26 16:28:17
阅读次数:
184
It's so funny。Today is the first day for my paper ,my graduation.Well, all things I did were finding several papers and watching two movies .Oh, they ...
分类:
其他好文 时间:
2014-11-25 22:49:39
阅读次数:
152
Reference:http://leetcode.com/2010/03/here-is-phone-screening-question-from.htmlLet’s called array1 as A and array2 as B, each with size m and n.The o...
分类:
其他好文 时间:
2014-11-24 13:33:12
阅读次数:
183
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, intmethod, Point offset=Point()) Parameters: ...
分类:
其他好文 时间:
2014-11-23 18:47:58
阅读次数:
308