Re: [algogeeks] Diameter of a set of points

2010-06-30 Thread Amir hossein Shahriari
i just find out that after finding the convex hull we can do the rest in O(h) (See Jalaj Jaiswal's post: Computational Geometry) On Tue, Jun 29, 2010 at 1:31 AM, Amir hossein Shahriari < amir.hossein.shahri...@gmail.com> wrote: > @Amit: in most of the algos for convex hull the result would be the

Re: [algogeeks] Diameter of a set of points

2010-06-28 Thread Amir hossein Shahriari
@Amit: in most of the algos for convex hull the result would be the points on the hull in clockwise or counter clockwise order now we have a point P that we want to find the farthest point from it now imagine the list as if it's circular and the range where binary search is applied on starts after

Re: [algogeeks] Diameter of a set of points

2010-06-28 Thread harit agarwal
If the points are already sorted by one of the coordinates or by the angle to a fixed vector, then the algorithm takes O(*n*) time. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.c

Re: [algogeeks] Diameter of a set of points

2010-06-28 Thread Jitendra Kushwaha
@Amir I think convex hull will take O(nlogn) time Can u tell a O(n) algo On Sun, Jun 27, 2010 at 9:43 PM, Amir hossein Shahriari < amir.hossein.shahri...@gmail.com> wrote: > it's obvious that these 2 points must be on the convex hull >> so first find the convex hull O(n) >> > > > -- Regards Jit

Re: [algogeeks] Diameter of a set of points

2010-06-28 Thread Amit Jaspal
@ above can u specify how to apply binary search here as the points are not in increasing manner...or am i missin something On Sun, Jun 27, 2010 at 9:43 PM, Amir hossein Shahriari < amir.hossein.shahri...@gmail.com> wrote: > it's obvious that these 2 points must be on the convex hull > so fir

Re: [algogeeks] Diameter of a set of points

2010-06-27 Thread Amir hossein Shahriari
it's obvious that these 2 points must be on the convex hull so first find the convex hull O(n) then for each point on the hull find the farthest point by binary search (since if you turn on the hull the distance to the base point increases until the farthest point then it starts to decrease) if the

[algogeeks] Diameter of a set of points

2010-06-26 Thread amit
Hi , can anyone tell me how to find the diameter of a set of N points i.e the distance between the 2 most farthest points efficiently -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegro