问题描述:
输入:空间平面上点集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
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Linked ListTwo Pointers''...
分类:
其他好文 时间:
2014-11-18 23:25:09
阅读次数:
170
7.4.Serialization—How to Pack DataIt's easy enough to send text data across the network, you're finding, but what happens if you want to send some "bi...
分类:
其他好文 时间:
2014-10-31 11:35:37
阅读次数:
151
Dancing Links(DLX)的个人心得。...
分类:
其他好文 时间:
2014-10-29 17:12:07
阅读次数:
237
Finding crossesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1501Accepted Submission(s): 802Prob...
分类:
其他好文 时间:
2014-10-21 21:26:38
阅读次数:
292
Abstract. A root-finding algorithm is a numerical method, or algorithm, for finding a value x such that f(x)=0, for a given function f. Such an x is c...
分类:
其他好文 时间:
2014-10-21 21:14:26
阅读次数:
333