Assuming that the N points on the graph are represented in the form of (x,y) i.e. cartesian coordinates..
Then say, A = ( a1, a2); The equation of the circle centered at A would be (x - a1)^2 + (y-a2)^2 = R^2... Now, to find the points that lie within the range R, u need to check the following for all points: Say, current point is (X1, Y1), then the point lies within range R, if (X1 - a1)^2 + (Y1-a2)^2 - R^2 < 0 All the points satisfying the above condition will constitute the answer... On Jan 5, 5:17 pm, dabbcomputers <[email protected]> wrote: > you are given with N points on graph. and a point A on graph and range > R you have to find the points that lies within the radius of R from > point A. with complexity less than O(N). -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
